Skip to content

Commit f7a9150

Browse files
author
thk123
committed
Adding extra information about invariant messages
1 parent 392c765 commit f7a9150

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CODING_STANDARD.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ Formatting is enforced using clang-format. For more information about this, see
188188
- Avoid `assert`. If the condition is an actual invariant, use INVARIANT,
189189
PRECONDITION, POSTCONDITION, CHECK_RETURN, UNREACHABLE or DATA_INVARIANT. If
190190
there are possible reasons why it might fail, throw an exception.
191+
- Use "should" style statements for messages in invariants (e.g. "Array
192+
should have a non-zero size") to make it clear both the violation and the
193+
expected behavior. (As opposed to "no zero size arrays" where it isn't
194+
clear if the zero-size array is the problem, or the lack of it).
191195
- All raw pointers (such as those returned by `symbol_tablet::lookup`) are
192196
assumed to be non-owning, and should not be `delete`d. Raw pointers that
193197
point to heap-allocated memory should be private data members of an object

0 commit comments

Comments
 (0)