fcpp::asserts::invariant Class Reference
Enforce assertions that a condition will never change during the running lifetime of that code. More...
#include <asserts.h>
Static Public Member Functions | |
static invariant | eval (bool condition) |
Evaluate the invariant and throw std::invalid_argument if violated. More... | |
Friends | |
template<typename Text > | |
invariant && | operator<< (invariant &&item, const Text &text) |
Sets the message as an incoming stream. More... | |
Detailed Description
Enforce assertions that a condition will never change during the running lifetime of that code.
Member Function Documentation
◆ eval()
|
inlinestatic |
Evaluate the invariant and throw std::invalid_argument if violated.
- Remarks
- Object cannot be an lvalue and will be destroyed right after creation.
- Parameters
-
condition Any predicate that affirms the invariant condition.
- Returns
- invariant Item holding invariant evaluation.
Friends And Related Function Documentation
◆ operator<<
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/src/asserts.h