Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Class template singleton

boost::unit_test::data::monomorphic::singleton — Models a single element data set.

Synopsis

// In header: <boost/test/data/monomorphic/singleton.hpp>

template<typename T> 
class singleton : public boost::unit_test::data::monomorphic::dataset< boost::decay< T >::type >
{
public:
  // member classes/structs/unions

  struct iterator :
    public boost::unit_test::data::monomorphic::dataset< T >::iterator
  {
    // construct/copy/destruct
    explicit iterator(singleton< T > const &);

    // public member functions
    virtual base::data_type const & operator*();
    virtual void operator++();
  };

  enum @8 { arity = = 1 };
  // construct/copy/destruct
  explicit singleton(T &&);
  singleton(singleton &&);

  // public member functions
  T const & value() const;
  virtual data::size_t size() const;
  virtual iter_ptr begin() const;
};

Description

singleton public construct/copy/destruct

  1. explicit singleton(T && value);
    Constructor.
  2. singleton(singleton && s);
    Move constructor.

singleton public member functions

  1. T const & value() const;
  2. virtual data::size_t size() const;
    Dataset size.
  3. virtual iter_ptr begin() const;
    Iterator to use to iterate over this dataset.

PrevUpHomeNext