Enforce assertions that a condition will never change during the running lifetime of that code.
More...
#include <asserts.h>
|
| static invariant | eval (bool condition) |
| | Evaluate the invariant and throw std::invalid_argument if violated.
|
|
| template<typename Text> |
| invariant && | operator<< (invariant &&item, const Text &text) |
| | Sets the message as an incoming stream.
|
Enforce assertions that a condition will never change during the running lifetime of that code.
The message is only formatted when the condition is violated, so passing checks stay cheap.
static invariant eval(bool condition)
Evaluate the invariant and throw std::invalid_argument if violated.
Definition asserts.h:100
◆ eval()
| invariant fcpp::asserts::invariant::eval |
( |
bool | condition | ) |
|
|
inlinestatic |
Evaluate the invariant and throw std::invalid_argument if violated.
- Parameters
-
| condition | Any predicate that affirms the invariant condition. |
- Returns
- invariant Item holding invariant evaluation.
◆ operator<<
template<typename Text>
| invariant && operator<< |
( |
invariant && | item, |
|
|
const Text & | text ) |
|
friend |
Sets the message as an incoming stream.
- Template Parameters
-
| Text | Type of element that will be streamed into message string. |
- Parameters
-
| item | Invariant to set the message on. |
| text | Element that will be streamed into message string. |
- Returns
- invariant&&
The documentation for this class was generated from the following file:
- /home/runner/work/fluentcpp/fluentcpp/include/fluentcpp/asserts.h