1 // (C) Copyright Gennadiy Rozental 2001.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
9 ///Defines monomorphic dataset based on C type arrays
10 // ***************************************************************************
12 #ifndef BOOST_TEST_DATA_MONOMORPHIC_ARRAY_HPP_121411GER
13 #define BOOST_TEST_DATA_MONOMORPHIC_ARRAY_HPP_121411GER
16 #include <boost/test/data/config.hpp>
17 #include <boost/test/data/monomorphic/fwd.hpp>
19 #include <boost/test/detail/suppress_warnings.hpp>
21 //____________________________________________________________________________//
26 namespace monomorphic {
28 // ************************************************************************** //
29 // ************** array ************** //
30 // ************************************************************************** //
32 /// Dataset view of a C array
38 static const int arity = 1;
40 typedef T const* iterator;
43 array( T const* arr_, std::size_t size_ )
49 data::size_t size() const { return m_size; }
50 iterator begin() const { return m_arr; }
58 //____________________________________________________________________________//
60 //! An array dataset is a dataset
62 struct is_dataset<array<T>> : mpl::true_ {};
64 } // namespace monomorphic
66 //____________________________________________________________________________//
68 //! @overload boost::unit_test::data::make()
69 template<typename T, std::size_t size>
70 inline monomorphic::array<typename boost::remove_const<T>::type>
73 return monomorphic::array<typename boost::remove_const<T>::type>( a, size );
77 } // namespace unit_test
80 #include <boost/test/detail/enable_warnings.hpp>
82 #endif // BOOST_TEST_DATA_MONOMORPHIC_ARRAY_HPP_121411GER