From 291a95c30a10f8d7e2f18fb9e90dca9dc2964e3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 22 Sep 2014 00:15:30 +0200 Subject: [PATCH] Reduced unused classes from meta_utiles and simplified the implementation of several traits classes to avoid inheritance from integral_constant Moved declval to utility_core.hpp --- include/boost/move/core.hpp | 28 +- include/boost/move/default_delete.hpp | 2 +- include/boost/move/detail/meta_utils.hpp | 369 ++++++----------------- include/boost/move/iterator.hpp | 4 +- include/boost/move/make_unique.hpp | 22 +- include/boost/move/traits.hpp | 101 +------ include/boost/move/unique_ptr.hpp | 2 +- include/boost/move/utility.hpp | 21 +- include/boost/move/utility_core.hpp | 3 + test/unique_ptr_test_utils_beg.hpp | 16 +- 10 files changed, 143 insertions(+), 425 deletions(-) diff --git a/include/boost/move/core.hpp b/include/boost/move/core.hpp index ce14b1b..af21990 100644 --- a/include/boost/move/core.hpp +++ b/include/boost/move/core.hpp @@ -67,7 +67,7 @@ : public ::boost::move_detail::if_c < ::boost::move_detail::is_class_or_union::value , T - , ::boost::move_detail::empty + , ::boost::move_detail::nat >::type { rv(); @@ -79,7 +79,7 @@ ////////////////////////////////////////////////////////////////////////////// // - // move_detail::is_rv + // is_rv // ////////////////////////////////////////////////////////////////////////////// @@ -87,17 +87,7 @@ template struct is_rv - : ::boost::move_detail::integral_constant - {}; - - template - struct is_rv< rv > - : ::boost::move_detail::integral_constant - {}; - - template - struct is_rv< const rv > - : ::boost::move_detail::integral_constant + : ::boost::move_detail::is_rv_impl {}; } //namespace move_detail { @@ -109,17 +99,7 @@ ////////////////////////////////////////////////////////////////////////////// template struct has_move_emulation_enabled - : ::boost::move_detail::is_convertible< T, ::boost::rv& > - {}; - - template - struct has_move_emulation_enabled - : ::boost::move_detail::integral_constant - {}; - - template - struct has_move_emulation_enabled< ::boost::rv > - : ::boost::move_detail::integral_constant + : ::boost::move_detail::has_move_emulation_enabled_impl {}; } //namespace boost { diff --git a/include/boost/move/default_delete.hpp b/include/boost/move/default_delete.hpp index ef31719..d8494e8 100644 --- a/include/boost/move/default_delete.hpp +++ b/include/boost/move/default_delete.hpp @@ -92,7 +92,7 @@ typedef int bool_conversion::* explicit_bool_arg; namespace movelib { namespace bmupd = boost::move_upd; -namespace bmupmu = boost::move_detail; +namespace bmupmu = ::boost::move_upmu; //!The class template default_delete serves as the default deleter //!(destruction policy) for the class template unique_ptr. diff --git a/include/boost/move/detail/meta_utils.hpp b/include/boost/move/detail/meta_utils.hpp index 61d37a9..0df0086 100644 --- a/include/boost/move/detail/meta_utils.hpp +++ b/include/boost/move/detail/meta_utils.hpp @@ -21,18 +21,11 @@ namespace boost { -#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES //Forward declare boost::rv template class rv; -#endif namespace move_detail { -////////////////////////////////////// -// empty -////////////////////////////////////// -struct empty{}; - ////////////////////////////////////// // nat ////////////////////////////////////// @@ -115,22 +108,6 @@ struct identity typedef T type; }; -////////////////////////////////////// -// and_ -////////////////////////////////////// -template > -struct and_ - : public integral_constant -{}; - -////////////////////////////////////// -// not_ -////////////////////////////////////// -template -struct not_ - : public integral_constant -{}; - ////////////////////////////////////// // remove_reference ////////////////////////////////////// @@ -177,47 +154,6 @@ struct remove_reference< const rv &> #endif - -////////////////////////////////////// -// remove_const -////////////////////////////////////// -template< class T > -struct remove_const -{ - typedef T type; -}; - -template< class T > -struct remove_const -{ - typedef T type; -}; - -////////////////////////////////////// -// remove_volatile -////////////////////////////////////// -template< class T > -struct remove_volatile -{ - typedef T type; -}; - -template< class T > -struct remove_volatile -{ - typedef T type; -}; - -////////////////////////////////////// -// remove_cv -////////////////////////////////////// -template< class T > -struct remove_cv -{ - typedef typename remove_volatile - ::type>::type type; -}; - ////////////////////////////////////// // add_const ////////////////////////////////////// @@ -243,71 +179,6 @@ struct add_const #endif -////////////////////////////////////// -// remove_extent -////////////////////////////////////// -template -struct remove_extent -{ - typedef T type; -}; - -template -struct remove_extent -{ - typedef T type; -}; - -template -struct remove_extent -{ - typedef T type; -}; - -////////////////////////////////////// -// extent -////////////////////////////////////// - -template -struct extent -{ - static const std::size_t value = 0; -}; - -template -struct extent -{ - static const std::size_t value = 0; -}; - -template -struct extent -{ - static const std::size_t value = extent::value; -}; - -template -struct extent -{ - static const std::size_t value = N; -}; - -template -struct extent -{ - static const std::size_t value = extent::value; -}; - -////////////////////////////////////// -// element_pointer -////////////////////////////////////// -template -struct element_pointer -{ - typedef typename remove_extent::type element_type; - typedef element_type* type; -}; - ////////////////////////////////////// // add_lvalue_reference ////////////////////////////////////// @@ -372,46 +243,6 @@ struct is_same static const bool value = true; }; -////////////////////////////////////// -// is_pointer -////////////////////////////////////// -template< class T > -struct is_pointer -{ - static const bool value = false; -}; - -template< class T > -struct is_pointer -{ - static const bool value = true; -}; - -////////////////////////////////////// -// is_reference -////////////////////////////////////// -template< class T > -struct is_reference -{ - static const bool value = false; -}; - -template< class T > -struct is_reference -{ - static const bool value = true; -}; - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - -template< class T > -struct is_reference -{ - static const bool value = true; -}; - -#endif - ////////////////////////////////////// // is_lvalue_reference ////////////////////////////////////// @@ -427,27 +258,6 @@ struct is_lvalue_reference static const bool value = true; }; -////////////////////////////////////// -// is_array -////////////////////////////////////// -template -struct is_array -{ - static const bool value = false; -}; - -template -struct is_array -{ - static const bool value = true; -}; - -template -struct is_array -{ - static const bool value = true; -}; - ////////////////////////////////////// // is_class_or_union ////////////////////////////////////// @@ -508,28 +318,6 @@ struct has_pointer_type static const bool value = sizeof(test(0)) == 1; }; -////////////////////////////////////// -// pointer_type -////////////////////////////////////// -template ::value> -struct pointer_type_imp -{ - typedef typename D::pointer type; -}; - -template -struct pointer_type_imp -{ - typedef typename remove_extent::type* type; -}; - -template -struct pointer_type -{ - typedef typename pointer_type_imp - ::type, typename remove_reference::type>::type type; -}; - ////////////////////////////////////// // is_convertible ////////////////////////////////////// @@ -560,100 +348,125 @@ class is_convertible #endif -////////////////////////////////////// -// is_unary_function -////////////////////////////////////// -#if defined(BOOST_MSVC) || defined(__BORLANDC_) -#define BOOST_MOVE_TT_DECL __cdecl -#else -#define BOOST_MOVE_TT_DECL -#endif +////////////////////////////////////////////////////////////////////////////// +// +// has_move_emulation_enabled_impl +// +////////////////////////////////////////////////////////////////////////////// +template +struct has_move_emulation_enabled_impl + : is_convertible< T, ::boost::rv& > +{}; -#if defined(_MSC_EXTENSIONS) && !defined(__BORLAND__) && !defined(_WIN64) && !defined(_M_ARM) && !defined(UNDER_CE) -#define BOOST_MOVE_TT_TEST_MSC_FUNC_SIGS -#endif +template +struct has_move_emulation_enabled_impl +{ static const bool value = false; }; -template -struct is_unary_function_impl -{ static const bool value = false; }; +template +struct has_move_emulation_enabled_impl< ::boost::rv > +{ static const bool value = false; }; -// avoid duplicate definitions of is_unary_function_impl -#ifndef BOOST_MOVE_TT_TEST_MSC_FUNC_SIGS +////////////////////////////////////////////////////////////////////////////// +// +// is_rv_impl +// +////////////////////////////////////////////////////////////////////////////// -template -struct is_unary_function_impl +template +struct is_rv_impl +{ static const bool value = false; }; + +template +struct is_rv_impl< rv > { static const bool value = true; }; -template -struct is_unary_function_impl +template +struct is_rv_impl< const rv > { static const bool value = true; }; -#else // BOOST_MOVE_TT_TEST_MSC_FUNC_SIGS +// Code from Jeffrey Lee Hellrung, many thanks -template -struct is_unary_function_impl +template< class T > +struct is_rvalue_reference +{ static const bool value = false; }; + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + +template< class T > +struct is_rvalue_reference< T&& > { static const bool value = true; }; -#ifndef _MANAGED +#else // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct is_unary_function_impl +template< class T > +struct is_rvalue_reference< boost::rv& > { static const bool value = true; }; -#endif - -template -struct is_unary_function_impl +template< class T > +struct is_rvalue_reference< const boost::rv& > { static const bool value = true; }; -template -struct is_unary_function_impl -{ static const bool value = true; }; +#endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -#endif +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -// avoid duplicate definitions of is_unary_function_impl -#ifndef BOOST_MOVE_TT_TEST_MSC_FUNC_SIGS +template< class T > +struct add_rvalue_reference +{ typedef T&& type; }; -template -struct is_unary_function_impl -{ static const bool value = true; }; +#else // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct is_unary_function_impl -{ static const bool value = true; }; +namespace detail_add_rvalue_reference +{ + template< class T + , bool emulation = has_move_emulation_enabled_impl::value + , bool rv = is_rv_impl::value > + struct add_rvalue_reference_impl { typedef T type; }; -#else // BOOST_MOVE_TT_TEST_MSC_FUNC_SIGS + template< class T, bool emulation> + struct add_rvalue_reference_impl< T, emulation, true > { typedef T & type; }; -template -struct is_unary_function_impl -{ static const bool value = true; }; + template< class T, bool rv > + struct add_rvalue_reference_impl< T, true, rv > { typedef ::boost::rv& type; }; +} // namespace detail_add_rvalue_reference -#ifndef _MANAGED +template< class T > +struct add_rvalue_reference + : detail_add_rvalue_reference::add_rvalue_reference_impl +{ }; -template -struct is_unary_function_impl -{ static const bool value = true; }; +template< class T > +struct add_rvalue_reference +{ typedef T & type; }; -#endif +#endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct is_unary_function_impl -{ static const bool value = true; }; +template< class T > struct remove_rvalue_reference { typedef T type; }; -template -struct is_unary_function_impl -{ static const bool value = true; }; +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template< class T > struct remove_rvalue_reference< T&& > { typedef T type; }; +#else // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template< class T > struct remove_rvalue_reference< rv > { typedef T type; }; + template< class T > struct remove_rvalue_reference< const rv > { typedef T type; }; + template< class T > struct remove_rvalue_reference< volatile rv > { typedef T type; }; + template< class T > struct remove_rvalue_reference< const volatile rv > { typedef T type; }; + template< class T > struct remove_rvalue_reference< rv& > { typedef T type; }; + template< class T > struct remove_rvalue_reference< const rv& > { typedef T type; }; + template< class T > struct remove_rvalue_reference< volatile rv& > { typedef T type; }; + template< class T > struct remove_rvalue_reference< const volatile rv& >{ typedef T type; }; +#endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -#endif - -template -struct is_unary_function_impl -{ static const bool value = false; }; - -template -struct is_unary_function -{ static const bool value = is_unary_function_impl::value; }; +// Ideas from Boost.Move review, Jeffrey Lee Hellrung: +// +//- TypeTraits metafunctions is_lvalue_reference, add_lvalue_reference, and remove_lvalue_reference ? +// Perhaps add_reference and remove_reference can be modified so that they behave wrt emulated rvalue +// references the same as wrt real rvalue references, i.e., add_reference< rv& > -> T& rather than +// rv& (since T&& & -> T&). +// +//- Add'l TypeTraits has_[trivial_]move_{constructor,assign}...? +// +//- An as_lvalue(T& x) function, which amounts to an identity operation in C++0x, but strips emulated +// rvalue references in C++03. This may be necessary to prevent "accidental moves". } //namespace move_detail { } //namespace boost { diff --git a/include/boost/move/iterator.hpp b/include/boost/move/iterator.hpp index b4bc1af..79e7bfd 100644 --- a/include/boost/move/iterator.hpp +++ b/include/boost/move/iterator.hpp @@ -142,14 +142,14 @@ namespace move_detail { template struct is_move_iterator - : public ::boost::move_detail::integral_constant { + static const bool value = false; }; template struct is_move_iterator< ::boost::move_iterator > - : public ::boost::move_detail::integral_constant { + static const bool value = true; }; } //namespace move_detail { diff --git a/include/boost/move/make_unique.hpp b/include/boost/move/make_unique.hpp index 23b8555..e949785 100644 --- a/include/boost/move/make_unique.hpp +++ b/include/boost/move/make_unique.hpp @@ -16,7 +16,7 @@ #include #include #include //for std::size_t -#include +#include #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) #include @@ -36,7 +36,7 @@ namespace boost{ #if !defined(BOOST_MOVE_DOXYGEN_INVOKED) -namespace move_detail { +namespace move_upmu { //Compile time switch between //single element, unknown bound array @@ -59,7 +59,7 @@ struct unique_ptr_if typedef void t_is_array_of_known_bound; }; -} //namespace move_detail { +} //namespace move_upmu { #endif //!defined(BOOST_MOVE_DOXYGEN_INVOKED) @@ -72,7 +72,7 @@ namespace movelib { //! Returns: unique_ptr(new T(std::forward(args)...)). template inline BOOST_MOVE_DOC1ST(unique_ptr, - typename ::boost::move_detail::unique_ptr_if::t_is_not_array) + typename ::boost::move_upmu::unique_ptr_if::t_is_not_array) make_unique(BOOST_FWD_REF(Args)... args) { return unique_ptr(new T(::boost::forward(args)...)); } @@ -95,7 +95,7 @@ inline BOOST_MOVE_DOC1ST(unique_ptr, #define BOOST_PP_LOCAL_MACRO(n) \ template \ - typename ::boost::move_detail::unique_ptr_if::t_is_not_array \ + typename ::boost::move_upmu::unique_ptr_if::t_is_not_array \ make_unique(BOOST_PP_ENUM(n, BOOST_MOVE_PP_PARAM_LIST, _)) \ { return unique_ptr(new T(BOOST_PP_ENUM(n, BOOST_MOVE_PP_PARAM_FORWARD, _))); } \ //! @@ -110,7 +110,7 @@ inline BOOST_MOVE_DOC1ST(unique_ptr, //! Returns: unique_ptr(new T) (default initialization) template inline BOOST_MOVE_DOC1ST(unique_ptr, - typename ::boost::move_detail::unique_ptr_if::t_is_not_array) + typename ::boost::move_upmu::unique_ptr_if::t_is_not_array) make_unique_definit() { return unique_ptr(new T); @@ -122,10 +122,10 @@ inline BOOST_MOVE_DOC1ST(unique_ptr, //! Returns: unique_ptr(new remove_extent_t[n]()) (value initialization) template inline BOOST_MOVE_DOC1ST(unique_ptr, - typename ::boost::move_detail::unique_ptr_if::t_is_array_of_unknown_bound) + typename ::boost::move_upmu::unique_ptr_if::t_is_array_of_unknown_bound) make_unique(std::size_t n) { - typedef typename ::boost::move_detail::remove_extent::type U; + typedef typename ::boost::move_upmu::remove_extent::type U; return unique_ptr(new U[n]()); } @@ -135,10 +135,10 @@ inline BOOST_MOVE_DOC1ST(unique_ptr, //! Returns: unique_ptr(new remove_extent_t[n]) (default initialization) template inline BOOST_MOVE_DOC1ST(unique_ptr, - typename ::boost::move_detail::unique_ptr_if::t_is_array_of_unknown_bound) + typename ::boost::move_upmu::unique_ptr_if::t_is_array_of_unknown_bound) make_unique_definit(std::size_t n) { - typedef typename ::boost::move_detail::remove_extent::type U; + typedef typename ::boost::move_upmu::remove_extent::type U; return unique_ptr(new U[n]); } @@ -148,7 +148,7 @@ inline BOOST_MOVE_DOC1ST(unique_ptr, //! an array of known bound. template inline BOOST_MOVE_DOC1ST(unspecified, - typename ::boost::move_detail::unique_ptr_if::t_is_array_of_known_bound) + typename ::boost::move_upmu::unique_ptr_if::t_is_array_of_known_bound) make_unique(BOOST_FWD_REF(Args) ...) = delete; #endif diff --git a/include/boost/move/traits.hpp b/include/boost/move/traits.hpp index 66d0dd6..c4b3afe 100644 --- a/include/boost/move/traits.hpp +++ b/include/boost/move/traits.hpp @@ -47,103 +47,24 @@ struct has_trivial_destructor_after_move //! and assignment can specialize this trait to obtain some performance improvements. template struct has_nothrow_move - : public ::boost::move_detail::integral_constant - < bool - , boost::is_nothrow_move_constructible::value && - boost::is_nothrow_move_assignable::value - > -{}; +{ + static const bool value = boost::is_nothrow_move_constructible::value && + boost::is_nothrow_move_assignable::value; +}; namespace move_detail { template struct is_nothrow_move_constructible_or_uncopyable - : public ::boost::move_detail::integral_constant - < bool - //The standard requires is_nothrow_move_constructible for move_if_noexcept - //but a user (usually in C++03) might specialize has_nothrow_move which includes it - , boost::is_nothrow_move_constructible::value || - has_nothrow_move::value || - !boost::is_copy_constructible::value - > -{}; - -// Code from Jeffrey Lee Hellrung, many thanks - -template< class T > struct is_rvalue_reference : ::boost::move_detail::integral_constant { }; -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - template< class T > struct is_rvalue_reference< T&& > : ::boost::move_detail::integral_constant { }; -#else // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - template< class T > struct is_rvalue_reference< boost::rv& > - : ::boost::move_detail::integral_constant - {}; - - template< class T > struct is_rvalue_reference< const boost::rv& > - : ::boost::move_detail::integral_constant - {}; -#endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - template< class T > struct add_rvalue_reference { typedef T&& type; }; -#else // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - namespace detail_add_rvalue_reference - { - template< class T - , bool emulation = ::boost::has_move_emulation_enabled::value - , bool rv = ::boost::move_detail::is_rv::value > - struct add_rvalue_reference_impl { typedef T type; }; - - template< class T, bool emulation> - struct add_rvalue_reference_impl< T, emulation, true > { typedef T & type; }; - - template< class T, bool rv > - struct add_rvalue_reference_impl< T, true, rv > { typedef ::boost::rv& type; }; - } // namespace detail_add_rvalue_reference - - template< class T > - struct add_rvalue_reference - : detail_add_rvalue_reference::add_rvalue_reference_impl - { }; - - template< class T > - struct add_rvalue_reference - { typedef T & type; }; - -#endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - -template< class T > struct remove_rvalue_reference { typedef T type; }; - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - template< class T > struct remove_rvalue_reference< T&& > { typedef T type; }; -#else // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - template< class T > struct remove_rvalue_reference< rv > { typedef T type; }; - template< class T > struct remove_rvalue_reference< const rv > { typedef T type; }; - template< class T > struct remove_rvalue_reference< volatile rv > { typedef T type; }; - template< class T > struct remove_rvalue_reference< const volatile rv > { typedef T type; }; - template< class T > struct remove_rvalue_reference< rv& > { typedef T type; }; - template< class T > struct remove_rvalue_reference< const rv& > { typedef T type; }; - template< class T > struct remove_rvalue_reference< volatile rv& > { typedef T type; }; - template< class T > struct remove_rvalue_reference< const volatile rv& >{ typedef T type; }; -#endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - -template -typename boost::move_detail::add_rvalue_reference::type declval(); +{ + //The standard requires is_nothrow_move_constructible for move_if_noexcept + //but a user (usually in C++03) might specialize has_nothrow_move which includes it + static const bool value = boost::is_nothrow_move_constructible::value || + has_nothrow_move::value || + !boost::is_copy_constructible::value; +}; } //move_detail { - -// Ideas from Boost.Move review, Jeffrey Lee Hellrung: -// -//- TypeTraits metafunctions is_lvalue_reference, add_lvalue_reference, and remove_lvalue_reference ? -// Perhaps add_reference and remove_reference can be modified so that they behave wrt emulated rvalue -// references the same as wrt real rvalue references, i.e., add_reference< rv& > -> T& rather than -// rv& (since T&& & -> T&). -// -//- Add'l TypeTraits has_[trivial_]move_{constructor,assign}...? -// -//- An as_lvalue(T& x) function, which amounts to an identity operation in C++0x, but strips emulated -// rvalue references in C++03. This may be necessary to prevent "accidental moves". - - } //namespace boost { #include diff --git a/include/boost/move/unique_ptr.hpp b/include/boost/move/unique_ptr.hpp index be74a1f..df10fb3 100644 --- a/include/boost/move/unique_ptr.hpp +++ b/include/boost/move/unique_ptr.hpp @@ -723,7 +723,7 @@ class unique_ptr //! Effects: Invokes swap on the stored pointers and on the stored deleters of *this and u. void swap(unique_ptr& u) BOOST_NOEXCEPT { - using bmupmu::swap; + using ::boost::move_detail::swap; swap(m_data.m_p, u.m_data.m_p); swap(m_data.deleter(), u.m_data.deleter()); } diff --git a/include/boost/move/utility.hpp b/include/boost/move/utility.hpp index 5e6f213..a1ddd26 100644 --- a/include/boost/move/utility.hpp +++ b/include/boost/move/utility.hpp @@ -112,20 +112,21 @@ //! constructible or if it has no copy constructor. In all other cases const //! reference would be returned template - rvalue_reference move_if_noexcept(input_reference) noexcept; + rvalue_reference_or_const_lvalue_reference move_if_noexcept(input_reference) noexcept; - #else //BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES + #else //BOOST_MOVE_DOXYGEN_INVOKED template - inline typename ::boost::move_detail::if_c - < ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable::value - , T&& - , const T& - >::type + typename ::boost::move_detail::enable_if_c + < ::boost::move_detail::is_nothrow_move_constructible_or_uncopyable::value, T&&>::type move_if_noexcept(T& x) BOOST_NOEXCEPT - { - return ::boost::move(x); - } + { return ::boost::move(x); } + + template + typename ::boost::move_detail::enable_if_c + < !::boost::move_detail::is_nothrow_move_constructible_or_uncopyable::value, const T&>::type + move_if_noexcept(T& x) BOOST_NOEXCEPT + { return x; } #endif //BOOST_MOVE_DOXYGEN_INVOKED diff --git a/include/boost/move/utility_core.hpp b/include/boost/move/utility_core.hpp index 3e04172..ae17fd3 100644 --- a/include/boost/move/utility_core.hpp +++ b/include/boost/move/utility_core.hpp @@ -281,6 +281,9 @@ void swap(T &a, T &b) b = ::boost::move(c); } +template +typename boost::move_detail::add_rvalue_reference::type declval(); + } //namespace move_detail{ } //namespace boost{ diff --git a/test/unique_ptr_test_utils_beg.hpp b/test/unique_ptr_test_utils_beg.hpp index a98e926..1b50426 100644 --- a/test/unique_ptr_test_utils_beg.hpp +++ b/test/unique_ptr_test_utils_beg.hpp @@ -13,7 +13,7 @@ #ifndef BOOST_MOVE_UNIQUE_PTR_TEST_UTILS_BEG_HPP #define BOOST_MOVE_UNIQUE_PTR_TEST_UTILS_BEG_HPP #include -#include +#include #include ////////////////////////////////////////////// @@ -39,8 +39,8 @@ class def_constr_deleter def_constr_deleter& operator=(const def_constr_deleter&); public: - typedef typename ::boost::move_detail::remove_extent::type element_type; - static const bool is_array = ::boost::move_detail::is_array::value; + typedef typename ::boost::move_upmu::remove_extent::type element_type; + static const bool is_array = ::boost::move_upmu::is_array::value; def_constr_deleter() : state_(5) {} @@ -64,8 +64,8 @@ class copy_constr_deleter int state_; public: - typedef typename ::boost::move_detail::remove_extent::type element_type; - static const bool is_array = ::boost::move_detail::is_array::value; + typedef typename ::boost::move_upmu::remove_extent::type element_type; + static const bool is_array = ::boost::move_upmu::is_array::value; copy_constr_deleter() : state_(5) {} @@ -104,8 +104,8 @@ class move_constr_deleter BOOST_MOVABLE_BUT_NOT_COPYABLE(move_constr_deleter) public: - typedef typename ::boost::move_detail::remove_extent::type element_type; - static const bool is_array = ::boost::move_detail::is_array::value; + typedef typename ::boost::move_upmu::remove_extent::type element_type; + static const bool is_array = ::boost::move_upmu::is_array::value; move_constr_deleter() : state_(5) {} @@ -182,7 +182,7 @@ int B::count = 0; void reset_counters(); -BOOST_STATIC_ASSERT((::boost::move_detail::is_convertible::value)); +BOOST_STATIC_ASSERT((::boost::move_upmu::is_convertible::value)); //Incomplete Type function declarations struct I;