LdsGen 1.2.6
Loading...
Searching...
No Matches
ldsgen::SequenceGenerator Concept Reference

Concept for the sequence generator protocol. More...

#include <lds.hpp>

Concept definition

template<typename G, typename V>
concept ldsgen::SequenceGenerator = requires(G g, unsigned long n) {
{ g.pop() } -> std::convertible_to<V>;
{ g.peek() } -> std::convertible_to<V>;
g.skip(static_cast<unsigned int>(n));
g.reseed(n);
{ g.get_index() } -> std::convertible_to<unsigned long>;
}
Concept for the sequence generator protocol.
Definition lds.hpp:155

Detailed Description

Concept for the sequence generator protocol.

Requires the uniform strategy interface shared by every generator: pop/peek/skip/ reseed/get_index. Every generator class in this library satisfies it, so generic code can be written against the protocol without knowing the concrete generator.

Template Parameters
GThe candidate generator type.
VThe value type it produces.