|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81140 - trunk/boost/test/data/monomorphic
From: gennadiy.rozental_at_[hidden]
Date: 2012-11-01 18:39:25
Author: rogeeff
Date: 2012-11-01 18:39:25 EDT (Thu, 01 Nov 2012)
New Revision: 81140
URL: http://svn.boost.org/trac/boost/changeset/81140
Log:
gcc 4.7 version of data test case subsystem
Added:
trunk/boost/test/data/monomorphic/fwd.hpp (contents, props changed)
Added: trunk/boost/test/data/monomorphic/fwd.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/test/data/monomorphic/fwd.hpp 2012-11-01 18:39:25 EDT (Thu, 01 Nov 2012)
@@ -0,0 +1,157 @@
+// (C) Copyright Gennadiy Rozental 2012.
+// 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 : $RCSfile$
+//
+// Version : $Revision$
+//
+// Description : forward declares monomorphic datasets interfaces
+// ***************************************************************************
+
+#ifndef BOOST_TEST_DATA_MONOMORPHIC_FWD_HPP_102212GER
+#define BOOST_TEST_DATA_MONOMORPHIC_FWD_HPP_102212GER
+
+// Boost.Test
+#include <boost/test/data/config.hpp>
+#include <boost/test/data/size.hpp>
+
+// STL
+#include <list>
+#include <vector>
+
+#include <boost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace boost {
+namespace unit_test {
+namespace data {
+
+// ************************************************************************** //
+// ************** is_std_collection ************** //
+// ************************************************************************** //
+
+namespace ds_detail {
+
+template<typename T>
+struct is_std_collection : std::false_type {};
+
+template<typename T>
+struct is_std_collection<T const> : is_std_collection<T> {};
+
+template<typename T>
+struct is_std_collection<T&> : is_std_collection<T> {};
+
+template<typename T>
+struct is_std_collection<std::vector<T>> : std::true_type {};
+
+template<typename T>
+struct is_std_collection<std::list<T>> : std::true_type {};
+
+} // namespace ds_detail
+
+namespace monomorphic {
+
+template<typename T>
+struct traits;
+
+template<typename T>
+class dataset;
+
+template<typename T>
+class singleton;
+
+template<typename C>
+class collection;
+
+template<typename T>
+class array;
+
+// ************************************************************************** //
+// ************** monomorphic::is_dataset ************** //
+// ************************************************************************** //
+
+template<typename DS>
+struct is_dataset : std::false_type {};
+
+//____________________________________________________________________________//
+
+template<typename DS>
+struct is_dataset<DS&> : is_dataset<DS> {};
+
+//____________________________________________________________________________//
+
+template<typename DS>
+struct is_dataset<DS const> : is_dataset<DS> {};
+
+//____________________________________________________________________________//
+
+} // namespace monomorphic
+
+// ************************************************************************** //
+// ************** data::make ************** //
+// ************************************************************************** //
+
+template<typename DS>
+inline typename std::enable_if<monomorphic::is_dataset<DS>::value,DS>::type
+make(DS&& ds)
+{
+ return std::forward<DS>( ds );
+}
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline typename std::enable_if<!ds_detail::is_std_collection<T>::value &&
+ !monomorphic::is_dataset<T>::value,
+ monomorphic::singleton<T> >::type
+make( T&& v );
+
+//____________________________________________________________________________//
+
+template<typename C>
+inline monomorphic::collection<typename std::enable_if<ds_detail::is_std_collection<C>::value,C>::type>
+make( C&& c );
+
+//____________________________________________________________________________//
+
+template<typename T, std::size_t size>
+inline monomorphic::array<T>
+make( T (&a)[size] );
+
+//____________________________________________________________________________//
+
+inline monomorphic::singleton<char*>
+make( char* str );
+
+//____________________________________________________________________________//
+
+inline monomorphic::singleton<char const*>
+make( char const* str );
+
+//____________________________________________________________________________//
+
+namespace result_of {
+
+template<typename DS>
+struct make
+{
+ typedef decltype(data::make(std::declval<DS>())) type;
+};
+
+} // namespace result_of
+
+//____________________________________________________________________________//
+
+} // namespace data
+} // namespace unit_test
+} // namespace boost
+
+#include <boost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_DATA_MONOMORPHIC_FWD_HPP_102212GER
+
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk