/usr/include/boost/test/data/monomorphic
Edit: /usr/include/boost/test/data/monomorphic/fwd.hpp (7098B)
// (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 singleton;
template
class collection;
template
class array;
template
class init_list;
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
!defined(BOOST_NO_CXX11_HDR_TUPLE)
template
class delayed_dataset;
#endif
#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 {};
template
struct is_dataset : is_dataset {};
//____________________________________________________________________________//
//! A const dataset is a dataset
template
struct is_dataset : is_dataset {};
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
//! Helper to check if a list of types contains a dataset
template
struct has_dataset : is_dataset {};
template
struct has_dataset
: std::integral_constant::value || has_dataset::value>
{};
#endif
} // 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&& );
//____________________________________________________________________________//
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
!defined(BOOST_TEST_ERRONEOUS_INIT_LIST)
//! @overload boost::unit_test::data::make()
template
inline typename std::enable_if<
!monomorphic::has_dataset::value,
monomorphic::init_list
>::type
make( T&& arg0, Args&&... args );
#endif
//____________________________________________________________________________//
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
!defined(BOOST_NO_CXX11_HDR_TUPLE)
template
inline typename std::enable_if<
monomorphic::is_dataset< dataset_t >::value,
monomorphic::delayed_dataset
>::type
make_delayed(Args... args);
#endif
//____________________________________________________________________________//
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