diff --git a/include/boost/move/detail/meta_utils.hpp b/include/boost/move/detail/meta_utils.hpp index c3314dd..3929ab5 100644 --- a/include/boost/move/detail/meta_utils.hpp +++ b/include/boost/move/detail/meta_utils.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// (C) Copyright Ion Gaztanaga 2012-2012. +// (C) Copyright Ion Gaztanaga 2012-2015. // 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) @@ -18,7 +18,7 @@ # pragma once #endif -#include +#include #include //for std::size_t //Small meta-typetraits to support move @@ -40,78 +40,6 @@ struct nat{}; ////////////////////////////////////// template struct natify{}; -////////////////////////////////////// -// if_c -////////////////////////////////////// -template -struct if_c -{ - typedef T1 type; -}; - -template -struct if_c -{ - typedef T2 type; -}; - -////////////////////////////////////// -// if_ -////////////////////////////////////// -template -struct if_ -{ - typedef typename if_c<0 != T1::value, T2, T3>::type type; -}; - -//enable_if_ -template -struct enable_if_c -{ - typedef T type; -}; - -////////////////////////////////////// -// enable_if_c -////////////////////////////////////// -template -struct enable_if_c {}; - -////////////////////////////////////// -// enable_if -////////////////////////////////////// -template -struct enable_if : public enable_if_c {}; - -////////////////////////////////////// -// disable_if -////////////////////////////////////// -template -struct disable_if : public enable_if_c {}; - -////////////////////////////////////// -// integral_constant -////////////////////////////////////// -template -struct integral_constant -{ - static const T value = v; - typedef T value_type; - typedef integral_constant type; -}; - -typedef integral_constant true_type; -typedef integral_constant false_type; - -////////////////////////////////////// -// identity -////////////////////////////////////// -template -struct identity -{ - typedef T type; -}; - ////////////////////////////////////// // remove_reference ////////////////////////////////////// @@ -231,22 +159,6 @@ struct add_const_lvalue_reference ::type type; }; - -////////////////////////////////////// -// is_same -////////////////////////////////////// -template -struct is_same -{ - static const bool value = false; -}; - -template -struct is_same -{ - static const bool value = true; -}; - ////////////////////////////////////// // is_lvalue_reference ////////////////////////////////////// @@ -475,6 +387,4 @@ template< class T > struct remove_rvalue_reference { typedef T type; }; } //namespace move_detail { } //namespace boost { -#include - #endif //#ifndef BOOST_MOVE_DETAIL_META_UTILS_HPP diff --git a/include/boost/move/detail/meta_utils_core.hpp b/include/boost/move/detail/meta_utils_core.hpp new file mode 100644 index 0000000..23721fb --- /dev/null +++ b/include/boost/move/detail/meta_utils_core.hpp @@ -0,0 +1,116 @@ +////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2015-2015. +// 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/move for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +//! \file + +#ifndef BOOST_MOVE_DETAIL_META_UTILS_CORE_HPP +#define BOOST_MOVE_DETAIL_META_UTILS_CORE_HPP + +#if defined(_MSC_VER) +# pragma once +#endif + +//Small meta-typetraits to support move + +namespace boost { +namespace move_detail { + +////////////////////////////////////// +// if_c +////////////////////////////////////// +template +struct if_c +{ + typedef T1 type; +}; + +template +struct if_c +{ + typedef T2 type; +}; + +////////////////////////////////////// +// if_ +////////////////////////////////////// +template +struct if_ +{ + typedef typename if_c<0 != T1::value, T2, T3>::type type; +}; + +//enable_if_ +template +struct enable_if_c +{ + typedef T type; +}; + +////////////////////////////////////// +// enable_if_c +////////////////////////////////////// +template +struct enable_if_c {}; + +////////////////////////////////////// +// enable_if +////////////////////////////////////// +template +struct enable_if : public enable_if_c {}; + +////////////////////////////////////// +// disable_if +////////////////////////////////////// +template +struct disable_if : public enable_if_c {}; + +////////////////////////////////////// +// integral_constant +////////////////////////////////////// +template +struct integral_constant +{ + static const T value = v; + typedef T value_type; + typedef integral_constant type; +}; + +typedef integral_constant true_type; +typedef integral_constant false_type; + +////////////////////////////////////// +// identity +////////////////////////////////////// +template +struct identity +{ + typedef T type; +}; + +////////////////////////////////////// +// is_same +////////////////////////////////////// +template +struct is_same +{ + static const bool value = false; +}; + +template +struct is_same +{ + static const bool value = true; +}; + +} //namespace move_detail { +} //namespace boost { + +#endif //#ifndef BOOST_MOVE_DETAIL_META_UTILS_CORE_HPP diff --git a/proj/vc7ide/Move.sln b/proj/vc7ide/Move.sln index a40d63e..4b230a8 100644 --- a/proj/vc7ide/Move.sln +++ b/proj/vc7ide/Move.sln @@ -237,6 +237,7 @@ Global ..\..\doc\Jamfile.v2 = ..\..\doc\Jamfile.v2 ..\..\..\..\boost\move\make_unique.hpp = ..\..\..\..\boost\move\make_unique.hpp ..\..\..\..\boost\move\detail\meta_utils.hpp = ..\..\..\..\boost\move\detail\meta_utils.hpp + ..\..\..\..\boost\move\detail\meta_utils_core.hpp = ..\..\..\..\boost\move\detail\meta_utils_core.hpp ..\..\..\..\boost\move\move.hpp = ..\..\..\..\boost\move\move.hpp ..\..\doc\move.qbk = ..\..\doc\move.qbk ..\..\..\..\boost\move\detail\move_helpers.hpp = ..\..\..\..\boost\move\detail\move_helpers.hpp