diff --git a/doc/move.qbk b/doc/move.qbk index 372b374..2c9a807 100644 --- a/doc/move.qbk +++ b/doc/move.qbk @@ -766,6 +766,7 @@ Many thanks to all boosters that have tested, reviewed and improved the library. * Added [macroref BOOST_MOVE_BASE BOOST_MOVE_BASE] utility. * Added [funcref boost::adl_move_swap adl_move_swap] utility. +* Reduced dependencies on other Boost libraries to make the library a bit more lightweight. [endsect] diff --git a/include/boost/move/core.hpp b/include/boost/move/core.hpp index 113a95d..30360ca 100644 --- a/include/boost/move/core.hpp +++ b/include/boost/move/core.hpp @@ -21,6 +21,7 @@ #endif #include +#include //boost_move_no_copy_constructor_or_assign typedef //used to detect noncopyable types for other Boost libraries. @@ -259,23 +260,6 @@ #else //BOOST_NO_CXX11_RVALUE_REFERENCES - //Compiler workaround detection - #if !defined(BOOST_MOVE_DOXYGEN_INVOKED) - #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) && !defined(__clang__) - //Pre-standard rvalue binding rules - #define BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES - #elif defined(_MSC_VER) && (_MSC_VER == 1600) - //Standard rvalue binding rules but with some bugs - #define BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG - #define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG - //Use standard library for MSVC to avoid namespace issues as - //some move calls in the STL are not fully qualified. - //#define BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE - #elif defined(_MSC_VER) && (_MSC_VER == 1700) - #define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG - #endif - #endif - //! This macro marks a type as movable but not copyable, disabling copy construction //! and assignment. The user will need to write a move constructor/assignment as explained //! in the documentation to fully write a movable but not copyable class. diff --git a/include/boost/move/detail/meta_utils.hpp b/include/boost/move/detail/meta_utils.hpp index a23c8dc..c3314dd 100644 --- a/include/boost/move/detail/meta_utils.hpp +++ b/include/boost/move/detail/meta_utils.hpp @@ -268,7 +268,7 @@ struct is_lvalue_reference template struct is_class_or_union { - struct twochar { char _[2]; }; + struct twochar { char dummy[2]; }; template static char is_class_or_union_tester(void(U::*)(void)); template diff --git a/include/boost/move/detail/workaround.hpp b/include/boost/move/detail/workaround.hpp index 3906f32..07b248a 100644 --- a/include/boost/move/detail/workaround.hpp +++ b/include/boost/move/detail/workaround.hpp @@ -27,4 +27,15 @@ #define BOOST_MOVE_I , #define BOOST_MOVE_DOCIGN(T1) T1 +#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) && !defined(__clang__) + //Pre-standard rvalue binding rules + #define BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES +#elif defined(_MSC_VER) && (_MSC_VER == 1600) + //Standard rvalue binding rules but with some bugs + #define BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG + #define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG +#elif defined(_MSC_VER) && (_MSC_VER == 1700) + #define BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG +#endif + #endif //#ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP diff --git a/include/boost/move/iterator.hpp b/include/boost/move/iterator.hpp index eaf83ef..99fa99c 100644 --- a/include/boost/move/iterator.hpp +++ b/include/boost/move/iterator.hpp @@ -19,8 +19,8 @@ #endif #include +#include #include -#include //std::iterator namespace boost { @@ -40,7 +40,7 @@ class move_iterator { public: typedef It iterator_type; - typedef typename std::iterator_traits::value_type value_type; + typedef typename boost::movelib::iterator_traits::value_type value_type; #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_DOXYGEN_INVOKED) typedef value_type && reference; #else @@ -50,8 +50,8 @@ class move_iterator , value_type & >::type reference; #endif typedef It pointer; - typedef typename std::iterator_traits::difference_type difference_type; - typedef typename std::iterator_traits::iterator_category iterator_category; + typedef typename boost::movelib::iterator_traits::difference_type difference_type; + typedef typename boost::movelib::iterator_traits::iterator_category iterator_category; move_iterator() {} diff --git a/include/boost/move/traits.hpp b/include/boost/move/traits.hpp index 4e29006..5ab0cea 100644 --- a/include/boost/move/traits.hpp +++ b/include/boost/move/traits.hpp @@ -11,23 +11,20 @@ //! \file -#ifndef BOOST_MOVE_MOVE_TRAITS_HPP -#define BOOST_MOVE_MOVE_TRAITS_HPP +#ifndef BOOST_MOVE_TRAITS_HPP +#define BOOST_MOVE_TRAITS_HPP #if defined(_MSC_VER) # pragma once #endif #include -#include -#include -#include -#include -#include #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES #include #endif +#include +#include namespace boost { @@ -42,7 +39,7 @@ namespace boost { //! when inserted in containers. template struct has_trivial_destructor_after_move - : ::boost::has_trivial_destructor + : ::boost::move_detail::is_trivially_destructible {}; //! By default this traits returns @@ -52,8 +49,8 @@ struct has_trivial_destructor_after_move template struct has_nothrow_move { - static const bool value = boost::is_nothrow_move_constructible::value && - boost::is_nothrow_move_assignable::value; + static const bool value = boost::move_detail::is_nothrow_move_constructible::value && + boost::move_detail::is_nothrow_move_assignable::value; }; namespace move_detail { @@ -63,9 +60,9 @@ struct is_nothrow_move_constructible_or_uncopyable { //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 || + static const bool value = is_nothrow_move_constructible::value || has_nothrow_move::value || - !boost::is_copy_constructible::value; + !is_copy_constructible::value; }; } //move_detail { @@ -73,4 +70,4 @@ struct is_nothrow_move_constructible_or_uncopyable #include -#endif //#ifndef BOOST_MOVE_MOVE_TRAITS_HPP +#endif //#ifndef BOOST_MOVE_TRAITS_HPP diff --git a/proj/vc7ide/Move.sln b/proj/vc7ide/Move.sln index 8429ad4..a40d63e 100644 --- a/proj/vc7ide/Move.sln +++ b/proj/vc7ide/Move.sln @@ -231,7 +231,9 @@ Global ..\..\..\..\boost\move\detail\config_end.hpp = ..\..\..\..\boost\move\detail\config_end.hpp ..\..\..\..\boost\move\core.hpp = ..\..\..\..\boost\move\core.hpp ..\..\..\..\boost\move\default_delete.hpp = ..\..\..\..\boost\move\default_delete.hpp + ..\..\..\..\boost\move\detail\fwd_macros.hpp = ..\..\..\..\boost\move\detail\fwd_macros.hpp ..\..\..\..\boost\move\iterator.hpp = ..\..\..\..\boost\move\iterator.hpp + ..\..\..\..\boost\move\detail\iterator_traits.hpp = ..\..\..\..\boost\move\detail\iterator_traits.hpp ..\..\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 @@ -239,6 +241,7 @@ Global ..\..\doc\move.qbk = ..\..\doc\move.qbk ..\..\..\..\boost\move\detail\move_helpers.hpp = ..\..\..\..\boost\move\detail\move_helpers.hpp ..\..\..\..\boost\move\traits.hpp = ..\..\..\..\boost\move\traits.hpp + ..\..\..\..\boost\move\detail\type_traits.hpp = ..\..\..\..\boost\move\detail\type_traits.hpp ..\..\..\..\boost\move\unique_ptr.hpp = ..\..\..\..\boost\move\unique_ptr.hpp ..\..\..\..\boost\move\detail\unique_ptr_meta_utils.hpp = ..\..\..\..\boost\move\detail\unique_ptr_meta_utils.hpp ..\..\test\unique_ptr_test_utils_beg.hpp = ..\..\test\unique_ptr_test_utils_beg.hpp diff --git a/test/back_move_inserter.cpp b/test/back_move_inserter.cpp index eeddd6b..6fc4829 100644 --- a/test/back_move_inserter.cpp +++ b/test/back_move_inserter.cpp @@ -9,7 +9,10 @@ // ////////////////////////////////////////////////////////////////////////////// #include +// move +#include #include +// container #include #include #include