Warning, file /include/boost/test/data/monomorphic/collection.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_TEST_DATA_MONOMORPHIC_COLLECTION_HPP_102211GER
0013 #define BOOST_TEST_DATA_MONOMORPHIC_COLLECTION_HPP_102211GER
0014
0015
0016 #include <boost/test/data/config.hpp>
0017 #include <boost/test/data/monomorphic/fwd.hpp>
0018
0019 #include <boost/test/detail/suppress_warnings.hpp>
0020
0021
0022
0023 namespace boost {
0024 namespace unit_test {
0025 namespace data {
0026 namespace monomorphic {
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 template<typename C>
0039 class collection {
0040 typedef typename boost::decay<C>::type col_type;
0041 public:
0042 typedef typename col_type::value_type sample;
0043
0044 static const int arity = 1;
0045
0046 typedef typename col_type::const_iterator iterator;
0047
0048
0049 explicit collection( C&& col ) : m_col( std::forward<C>(col) ) {}
0050
0051
0052 collection( collection&& c ) : m_col( std::forward<C>( c.m_col ) ) {}
0053
0054
0055 C const& col() const { return m_col; }
0056
0057
0058 data::size_t size() const { return m_col.size(); }
0059 iterator begin() const { return m_col.begin(); }
0060
0061 private:
0062
0063 C m_col;
0064 };
0065
0066
0067
0068
0069 template<typename C>
0070 struct is_dataset<collection<C>> : mpl::true_ {};
0071
0072 }
0073
0074
0075
0076
0077 template<typename C>
0078 inline typename std::enable_if<is_container_forward_iterable<C>::value,monomorphic::collection<C>>::type
0079 make( C&& c )
0080 {
0081 return monomorphic::collection<C>( std::forward<C>(c) );
0082 }
0083
0084 }
0085 }
0086 }
0087
0088 #include <boost/test/detail/enable_warnings.hpp>
0089
0090 #endif
0091