A sentinel that stops a numeric generator when the value reaches a certain point.
More...
#include <sentinel.hpp>
|
| | sentinel (std::function< bool(long, long)> lambda) |
| | Constructor.
|
| bool | operator() (long value, long step) const noexcept |
| | Check if the generator should stop.
|
A sentinel that stops a numeric generator when the value reaches a certain point.
- Examples
- generatorSentinel.cpp.
◆ sentinel()
| z::core::sentinel::sentinel |
( |
std::function< bool(long, long)> | lambda | ) |
|
|
inline |
Constructor.
- Parameters
-
| lambda | The lambda function that determines when the generator should stop. |
◆ operator()()
| bool z::core::sentinel::operator() |
( |
long | value, |
|
|
long | step ) const |
|
inlinenoexcept |
Check if the generator should stop.
- Parameters
-
| value | The current value of the generator. |
| step | The step size of the generator. |
- Returns
- True if the generator should stop, false otherwise.
The documentation for this class was generated from the following file: