...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::collection — Dataset from a forward iterable container (collection)
// In header: <boost/test/data/monomorphic/collection.hpp> template<typename C> class collection : public boost::unit_test::data::monomorphic::dataset< boost::decay< C >::type::value_type > { public: // member classes/structs/unions struct iterator : public boost::unit_test::data::monomorphic::dataset< T >::iterator { // construct/copy/destruct explicit iterator(collection< C > const &); // public member functions virtual T const & operator*(); virtual void operator++(); }; enum @4 { arity = = 1 }; // construct/copy/destruct explicit collection(C &&); collection(collection &&); // public member functions C const & col() const; virtual data::size_t size() const; virtual iter_ptr begin() const; };
This dataset is applicable to any container implementing a forward iterator. Note that container with one element will be considered as singletons. This dataset is constructible with the boost::unit_test::data::make function.
For compilers supporting r-value references, the collection is moved instead of copied.
collection
public
construct/copy/destructexplicit collection(C && col);Constructor The collection is moved.
collection(collection && c);Move constructor.
collection
public member functionsC const & col() const;Returns the underlying collection.
virtual data::size_t size() const;Dataset size.
virtual iter_ptr begin() const;Iterator to use to iterate over this dataset.