Reduced dependencies on other Boost libraries to make the library a bit more lightweight.

This commit is contained in:
Ion Gaztañaga
2015-01-02 18:34:14 +01:00
parent 36f74c5719
commit 8503b508e8
8 changed files with 34 additions and 35 deletions

View File

@@ -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 [macroref BOOST_MOVE_BASE BOOST_MOVE_BASE] utility.
* Added [funcref boost::adl_move_swap adl_move_swap] 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] [endsect]

View File

@@ -21,6 +21,7 @@
#endif #endif
#include <boost/move/detail/config_begin.hpp> #include <boost/move/detail/config_begin.hpp>
#include <boost/move/detail/workaround.hpp>
//boost_move_no_copy_constructor_or_assign typedef //boost_move_no_copy_constructor_or_assign typedef
//used to detect noncopyable types for other Boost libraries. //used to detect noncopyable types for other Boost libraries.
@@ -259,23 +260,6 @@
#else //BOOST_NO_CXX11_RVALUE_REFERENCES #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 //! 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 //! 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. //! in the documentation to fully write a movable but not copyable class.

View File

@@ -268,7 +268,7 @@ struct is_lvalue_reference<T&>
template<class T> template<class T>
struct is_class_or_union struct is_class_or_union
{ {
struct twochar { char _[2]; }; struct twochar { char dummy[2]; };
template <class U> template <class U>
static char is_class_or_union_tester(void(U::*)(void)); static char is_class_or_union_tester(void(U::*)(void));
template <class U> template <class U>

View File

@@ -27,4 +27,15 @@
#define BOOST_MOVE_I , #define BOOST_MOVE_I ,
#define BOOST_MOVE_DOCIGN(T1) T1 #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 #endif //#ifndef BOOST_MOVE_DETAIL_WORKAROUND_HPP

View File

@@ -19,8 +19,8 @@
#endif #endif
#include <boost/move/detail/config_begin.hpp> #include <boost/move/detail/config_begin.hpp>
#include <boost/move/detail/iterator_traits.hpp>
#include <boost/move/utility_core.hpp> #include <boost/move/utility_core.hpp>
#include <iterator> //std::iterator
namespace boost { namespace boost {
@@ -40,7 +40,7 @@ class move_iterator
{ {
public: public:
typedef It iterator_type; typedef It iterator_type;
typedef typename std::iterator_traits<iterator_type>::value_type value_type; typedef typename boost::movelib::iterator_traits<iterator_type>::value_type value_type;
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_DOXYGEN_INVOKED) #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
typedef value_type && reference; typedef value_type && reference;
#else #else
@@ -50,8 +50,8 @@ class move_iterator
, value_type & >::type reference; , value_type & >::type reference;
#endif #endif
typedef It pointer; typedef It pointer;
typedef typename std::iterator_traits<iterator_type>::difference_type difference_type; typedef typename boost::movelib::iterator_traits<iterator_type>::difference_type difference_type;
typedef typename std::iterator_traits<iterator_type>::iterator_category iterator_category; typedef typename boost::movelib::iterator_traits<iterator_type>::iterator_category iterator_category;
move_iterator() move_iterator()
{} {}

View File

@@ -11,23 +11,20 @@
//! \file //! \file
#ifndef BOOST_MOVE_MOVE_TRAITS_HPP #ifndef BOOST_MOVE_TRAITS_HPP
#define BOOST_MOVE_MOVE_TRAITS_HPP #define BOOST_MOVE_TRAITS_HPP
#if defined(_MSC_VER) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
#include <boost/move/detail/config_begin.hpp> #include <boost/move/detail/config_begin.hpp>
#include <boost/type_traits/has_trivial_destructor.hpp>
#include <boost/type_traits/is_nothrow_move_constructible.hpp>
#include <boost/type_traits/is_nothrow_move_assignable.hpp>
#include <boost/type_traits/is_copy_constructible.hpp>
#include <boost/move/detail/meta_utils.hpp>
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
#include <boost/move/core.hpp> #include <boost/move/core.hpp>
#endif #endif
#include <boost/move/detail/meta_utils.hpp>
#include <boost/move/detail/type_traits.hpp>
namespace boost { namespace boost {
@@ -42,7 +39,7 @@ namespace boost {
//! when inserted in containers. //! when inserted in containers.
template <class T> template <class T>
struct has_trivial_destructor_after_move struct has_trivial_destructor_after_move
: ::boost::has_trivial_destructor<T> : ::boost::move_detail::is_trivially_destructible<T>
{}; {};
//! By default this traits returns //! By default this traits returns
@@ -52,8 +49,8 @@ struct has_trivial_destructor_after_move
template <class T> template <class T>
struct has_nothrow_move struct has_nothrow_move
{ {
static const bool value = boost::is_nothrow_move_constructible<T>::value && static const bool value = boost::move_detail::is_nothrow_move_constructible<T>::value &&
boost::is_nothrow_move_assignable<T>::value; boost::move_detail::is_nothrow_move_assignable<T>::value;
}; };
namespace move_detail { 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 //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 //but a user (usually in C++03) might specialize has_nothrow_move which includes it
static const bool value = boost::is_nothrow_move_constructible<T>::value || static const bool value = is_nothrow_move_constructible<T>::value ||
has_nothrow_move<T>::value || has_nothrow_move<T>::value ||
!boost::is_copy_constructible<T>::value; !is_copy_constructible<T>::value;
}; };
} //move_detail { } //move_detail {
@@ -73,4 +70,4 @@ struct is_nothrow_move_constructible_or_uncopyable
#include <boost/move/detail/config_end.hpp> #include <boost/move/detail/config_end.hpp>
#endif //#ifndef BOOST_MOVE_MOVE_TRAITS_HPP #endif //#ifndef BOOST_MOVE_TRAITS_HPP

View File

@@ -231,7 +231,9 @@ Global
..\..\..\..\boost\move\detail\config_end.hpp = ..\..\..\..\boost\move\detail\config_end.hpp ..\..\..\..\boost\move\detail\config_end.hpp = ..\..\..\..\boost\move\detail\config_end.hpp
..\..\..\..\boost\move\core.hpp = ..\..\..\..\boost\move\core.hpp ..\..\..\..\boost\move\core.hpp = ..\..\..\..\boost\move\core.hpp
..\..\..\..\boost\move\default_delete.hpp = ..\..\..\..\boost\move\default_delete.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\iterator.hpp = ..\..\..\..\boost\move\iterator.hpp
..\..\..\..\boost\move\detail\iterator_traits.hpp = ..\..\..\..\boost\move\detail\iterator_traits.hpp
..\..\doc\Jamfile.v2 = ..\..\doc\Jamfile.v2 ..\..\doc\Jamfile.v2 = ..\..\doc\Jamfile.v2
..\..\..\..\boost\move\make_unique.hpp = ..\..\..\..\boost\move\make_unique.hpp ..\..\..\..\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.hpp = ..\..\..\..\boost\move\detail\meta_utils.hpp
@@ -239,6 +241,7 @@ Global
..\..\doc\move.qbk = ..\..\doc\move.qbk ..\..\doc\move.qbk = ..\..\doc\move.qbk
..\..\..\..\boost\move\detail\move_helpers.hpp = ..\..\..\..\boost\move\detail\move_helpers.hpp ..\..\..\..\boost\move\detail\move_helpers.hpp = ..\..\..\..\boost\move\detail\move_helpers.hpp
..\..\..\..\boost\move\traits.hpp = ..\..\..\..\boost\move\traits.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\unique_ptr.hpp = ..\..\..\..\boost\move\unique_ptr.hpp
..\..\..\..\boost\move\detail\unique_ptr_meta_utils.hpp = ..\..\..\..\boost\move\detail\unique_ptr_meta_utils.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 ..\..\test\unique_ptr_test_utils_beg.hpp = ..\..\test\unique_ptr_test_utils_beg.hpp

View File

@@ -9,7 +9,10 @@
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
#include <boost/move/detail/config_begin.hpp> #include <boost/move/detail/config_begin.hpp>
// move
#include <boost/move/algorithm.hpp>
#include <boost/move/iterator.hpp> #include <boost/move/iterator.hpp>
// container
#include <boost/container/deque.hpp> #include <boost/container/deque.hpp>
#include <boost/container/list.hpp> #include <boost/container/list.hpp>
#include <boost/container/stable_vector.hpp> #include <boost/container/stable_vector.hpp>