// (C) Copyright Gennadiy Rozental 2001. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. // /// @file /// Forward declares monomorphic datasets interfaces // *************************************************************************** #ifndef BOOST_TEST_DATA_MONOMORPHIC_FWD_HPP_102212GER #define BOOST_TEST_DATA_MONOMORPHIC_FWD_HPP_102212GER // Boost.Test #include #include #include // Boost #include #include #include #include // STL #include #include // STL #include //____________________________________________________________________________// namespace boost { namespace unit_test { namespace data { namespace monomorphic { #if !defined(BOOST_TEST_DOXYGEN_DOC__) template class dataset; template class singleton; template class collection; template class array; template class init_list; #endif // ************************************************************************** // // ************** monomorphic::is_dataset ************** // // ************************************************************************** // //! Helper metafunction indicating if the specified type is a dataset. template struct is_dataset : mpl::false_ {}; //____________________________________________________________________________// //! A reference to a dataset is a dataset template struct is_dataset : is_dataset {}; //____________________________________________________________________________// //! A const dataset is a dataset template struct is_dataset : is_dataset {}; } // namespace monomorphic // ************************************************************************** // // ************** data::make ************** // // ************************************************************************** // //! @brief Creates a dataset from a value, a collection or an array //! //! This function has several overloads: //! @code //! // returns ds if ds is already a dataset //! template 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 monomorphic::singleton make(T&& v); //! monomorphic::singleton make( char* str ); //! monomorphic::singleton make( char const* str ); //! //! // creates a collection dataset, for forward iterable and non dataset type C //! template monomorphic::collection make(C && c); //! //! // creates an array dataset //! template monomorphic::array make( T (&a)[size] ); //! @endcode template inline typename std::enable_if::value,DataSet>::type make(DataSet&& ds) { return std::forward( ds ); } //____________________________________________________________________________// // warning: doxygen is apparently unable to handle @overload from different files, so if the overloads // below are not declared with @overload in THIS file, they do not appear in the documentation. //! @overload boost::unit_test::data::make() template inline typename std::enable_if::value && !monomorphic::is_dataset::value && !is_array::type>::value, monomorphic::singleton>::type make( T&& v ); //____________________________________________________________________________// //! @overload boost::unit_test::data::make() template inline typename std::enable_if::value,monomorphic::collection>::type make( C&& c ); //____________________________________________________________________________// //! @overload boost::unit_test::data::make() template inline monomorphic::array< typename boost::remove_const::type > make( T (&a)[size] ); //____________________________________________________________________________// //! @overload boost::unit_test::data::make() inline monomorphic::singleton make( char* str ); //____________________________________________________________________________// //! @overload boost::unit_test::data::make() inline monomorphic::singleton make( char const* str ); //____________________________________________________________________________// //! @overload boost::unit_test::data::make() template inline monomorphic::init_list make( std::initializer_list&& ); //____________________________________________________________________________// namespace result_of { //! Result of the make call. template struct make { typedef decltype( data::make( declval() ) ) type; }; } // namespace result_of } // namespace data } // namespace unit_test } // namespace boost #include #endif // BOOST_TEST_DATA_MONOMORPHIC_FWD_HPP_102212GER