|
sanisizer
Sanitize sizes to avoid integer overflow
|
Attest to additional compile-time properties of an integer. More...
#include <attest.hpp>
Public Types | |
| typedef Integer_ | Integer |
Public Member Functions | |
| constexpr | Attestation (Integer_ x) |
Public Attributes | |
| Integer_ | value |
Static Public Attributes | |
| static constexpr Integer_ | max = max_ |
Attest to additional compile-time properties of an integer.
| Integer_ | Type of the integer. |
| max_ | Maximum value of the integer, known at compile time. This should be non-negative. |
max_ is a compile-time attestations to the properties of the integer. This allows developers to specify more constraints on the integer than would otherwise be provided by Integer_. For example, we could attest that a std::size_t has a upper limit of max_ = 2^31 - 1.
| Integer_ sanisizer::Attestation< Integer_, max_ >::Integer |
Type of the integer.
|
inlineconstexpr |
| x | Value of the integer. This should be no greater than max_. |
|
staticconstexpr |
Maximum value of the integer, known at compile time. This will be non-negative.
| Integer_ sanisizer::Attestation< Integer_, max_ >::value |
Value of the integer.