Skip to content

Commit

Permalink
Adding extra information about invariant messages
Browse files Browse the repository at this point in the history
  • Loading branch information
thk123 committed May 30, 2018
1 parent 392c765 commit 655f220
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CODING_STANDARD.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ Formatting is enforced using clang-format. For more information about this, see
- Avoid `assert`. If the condition is an actual invariant, use INVARIANT,
PRECONDITION, POSTCONDITION, CHECK_RETURN, UNREACHABLE or DATA_INVARIANT. If
there are possible reasons why it might fail, throw an exception.
- Use "should" style statements for messages in invariants (e.g. "array
should have a non-zero size") to make it clear both the violation and the
expected behavior. (As opposed to "no zero size arrays" where it isn't
clear if the zero-size array is the problem, or the lack of it).
- The statements should start with a lower case letter.
- All raw pointers (such as those returned by `symbol_tablet::lookup`) are
assumed to be non-owning, and should not be `delete`d. Raw pointers that
point to heap-allocated memory should be private data members of an object
Expand Down

0 comments on commit 655f220

Please sign in to comment.