libzed 1.9.9
A general-purpose library for quick and simple data manipulation.
 
Loading...
Searching...
No Matches
z::core::sentinel Class Reference

A sentinel that stops a numeric generator when the value reaches a certain point. More...

#include <sentinel.hpp>

Public Member Functions

 sentinel (std::function< bool(long, long)> lambda)
 Constructor.
 
bool operator() (long value, long step) const noexcept
 Check if the generator should stop.
 

Detailed Description

A sentinel that stops a numeric generator when the value reaches a certain point.

Constructor & Destructor Documentation

◆ sentinel()

z::core::sentinel::sentinel ( std::function< bool(long, long)>  lambda)
inline

Constructor.

Parameters
lambdaThe lambda function that determines when the generator should stop.

Member Function Documentation

◆ operator()()

bool z::core::sentinel::operator() ( long  value,
long  step 
) const
inlinenoexcept

Check if the generator should stop.

Parameters
valueThe current value of the generator.
stepThe 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: