We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4afb5aa + d1e6f91 commit dbf6bd6Copy full SHA for dbf6bd6
doc/developer-notes.md
@@ -37,6 +37,7 @@ code.
37
38
- **Miscellaneous**
39
- `++i` is preferred over `i++`.
40
+ - `static_assert` is preferred over `assert` where possible. Generally; compile-time checking is preferred over run-time checking.
41
42
Block style example:
43
```c++
src/arith_uint256.h
@@ -250,7 +250,7 @@ class base_uint
250
251
uint64_t GetLow64() const
252
{
253
- assert(WIDTH >= 2);
+ static_assert(WIDTH >= 2, "Assertion WIDTH >= 2 failed (WIDTH = BITS / 32). BITS is a template parameter.");
254
return pn[0] | (uint64_t)pn[1] << 32;
255
}
256
};
0 commit comments