...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::unit_test::data::monomorphic::generated_by — Generators interface.
// In header: <boost/test/data/monomorphic/generate.hpp> template<typename Generator> class generated_by { public: // types typedef Generator::sample sample; typedef Generator generator_type; // member classes/structs/unions struct iterator { // public member functions explicit iterator(Generator &); sample const & operator*() const; void operator++(); }; // public member functions explicit generated_by(Generator &&); generated_by(generated_by &&); data::size_t size() const; iterator begin() const; // public data members static const int arity; };
This class implements the dataset concept over a generator. Examples of generators are:
The generator concept is the following:
the type of the generated samples is given by field sample
the member function capacity
should return the size of the collection being generated (potentially infinite)
the member function next
should change the state of the generator to the next generated value
the member function reset
should put the state of the object in the same state as right after its instanciation
generated_by
public member functionsexplicit generated_by(Generator && G);
generated_by(generated_by && rhs);
data::size_t size() const;Size of the underlying dataset.
iterator begin() const;Iterator on the beginning of the dataset.