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 a snapshot of the master branch, built from commit a7ba118798.
PrevUpHomeNext

Function make

boost::unit_test::data::make — Creates a dataset from a value, a collection or an array.

Synopsis

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


template<typename DataSet> 
  std::enable_if< monomorphic::is_dataset< DataSet >::value, DataSet >::type 
  make(DataSet && ds);
template<typename T> 
  std::enable_if<!is_container_forward_iterable< T >::value &&!monomorphic::is_dataset< T >::value &&!is_array< typename remove_reference< T >::type >::value, monomorphic::singleton< T > >::type 
  make(T && v);
template<typename C> 
  std::enable_if< is_container_forward_iterable< C >::value, monomorphic::collection< C > >::type 
  make(C && c);
template<typename T, std::size_t size> 
  monomorphic::array< typename boost::remove_const< T >::type > make(T(&) a);
monomorphic::singleton< char * > make(char * str);
monomorphic::singleton< char const  * > make(char const * str);
template<typename T> 
  monomorphic::init_list< T > make(std::initializer_list< T > &&);
template<typename T, class ... Args> 
  std::enable_if< !monomorphic::has_dataset< T, Args... >::value, monomorphic::init_list< T >>::type 
  make(T && arg0, Args &&... args);

Description

This function has several overloads:

// returns ds if ds is already a dataset
template <typename DataSet> DataSet make(DataSet&& ds); 

// creates a singleton dataset, for non forward iterable and non dataset type T
// (a C string is not considered as a sequence).
template <typename T> monomorphic::singleton<T> make(T&& v); 
monomorphic::singleton<char*> make( char* str );
monomorphic::singleton<char const*> make( char const* str );

// creates a collection dataset, for forward iterable and non dataset type C
template <typename C> monomorphic::collection<C> make(C && c);

// creates an array dataset
template<typename T, std::size_t size> monomorphic::array<T> make( T (&a)[size] );


PrevUpHomeNext