diff --git a/include/boost/intrusive/avltree.hpp b/include/boost/intrusive/avltree.hpp index 09cdb525..ffdd5b01 100644 --- a/include/boost/intrusive/avltree.hpp +++ b/include/boost/intrusive/avltree.hpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/include/boost/intrusive/detail/ebo_functor_holder.hpp b/include/boost/intrusive/detail/ebo_functor_holder.hpp index df49e4ce..0455de1d 100644 --- a/include/boost/intrusive/detail/ebo_functor_holder.hpp +++ b/include/boost/intrusive/detail/ebo_functor_holder.hpp @@ -29,246 +29,9 @@ namespace boost { namespace intrusive { namespace detail { -#if defined(BOOST_MSVC) || defined(__BORLANDC_) -#define BOOST_INTRUSIVE_TT_DECL __cdecl -#else -#define BOOST_INTRUSIVE_TT_DECL -#endif - -#if defined(_MSC_EXTENSIONS) && !defined(__BORLAND__) && !defined(_WIN64) && !defined(_M_ARM) && !defined(_M_ARM64) && !defined(UNDER_CE) -#define BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS -#endif - -template -struct is_unary_or_binary_function_impl -{ static const bool value = false; }; - -// see boost ticket #4094 -// avoid duplicate definitions of is_unary_or_binary_function_impl -#ifndef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#if 201703L <= BOOST_CXX_VERSION && !defined(BOOST_NO_CXX11_NOEXCEPT) - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#endif - -#else // BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#ifndef _MANAGED - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#endif - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#if 201703L <= BOOST_CXX_VERSION && !defined(BOOST_NO_CXX11_NOEXCEPT) - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#ifndef _MANAGED - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#endif - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#endif - -#endif - -// see boost ticket #4094 -// avoid duplicate definitions of is_unary_or_binary_function_impl -#ifndef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#if 201703L <= BOOST_CXX_VERSION && !defined(BOOST_NO_CXX11_NOEXCEPT) - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#endif - -#else // BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#ifndef _MANAGED - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#endif - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#if 201703L <= BOOST_CXX_VERSION && !defined(BOOST_NO_CXX11_NOEXCEPT) - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#ifndef _MANAGED - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#endif - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#endif - -#endif - -// see boost ticket #4094 -// avoid duplicate definitions of is_unary_or_binary_function_impl -#ifndef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#if 201703L <= BOOST_CXX_VERSION && !defined(BOOST_NO_CXX11_NOEXCEPT) - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#endif - -#else // BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#ifndef _MANAGED - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#endif - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#if 201703L <= BOOST_CXX_VERSION && !defined(BOOST_NO_CXX11_NOEXCEPT) - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#ifndef _MANAGED - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#endif - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -template -struct is_unary_or_binary_function_impl -{ static const bool value = true; }; - -#endif - -#endif - -template -struct is_unary_or_binary_function_impl -{ static const bool value = false; }; - -template -struct is_unary_or_binary_function : is_unary_or_binary_function_impl -{}; - -template::value> +template class ebo_functor_holder + : public T { BOOST_COPYABLE_AND_MOVABLE(ebo_functor_holder) @@ -276,33 +39,34 @@ class ebo_functor_holder typedef T functor_type; inline ebo_functor_holder() - : t_() + : T() {} inline explicit ebo_functor_holder(const T &t) - : t_(t) + : T(t) {} inline explicit ebo_functor_holder(BOOST_RV_REF(T) t) - : t_(::boost::move(t)) + : T(::boost::move(t)) {} template inline ebo_functor_holder(BOOST_FWD_REF(Arg1) arg1, BOOST_FWD_REF(Arg2) arg2) - : t_(::boost::forward(arg1), ::boost::forward(arg2)) + : T(::boost::forward(arg1), ::boost::forward(arg2)) {} inline ebo_functor_holder(const ebo_functor_holder &x) - : t_(x.t_) + : T(static_cast(x)) {} inline ebo_functor_holder(BOOST_RV_REF(ebo_functor_holder) x) - : t_(x.t_) + : T(BOOST_MOVE_BASE(T, x)) {} inline ebo_functor_holder& operator=(BOOST_COPY_ASSIGN_REF(ebo_functor_holder) x) { - this->get() = x.get(); + const ebo_functor_holder&r = x; + this->get() = r; return *this; } @@ -312,28 +76,24 @@ class ebo_functor_holder return *this; } - inline ebo_functor_holder& operator=(const T &x) + inline ebo_functor_holder& operator=(const T &t) { - this->get() = x; + this->get() = t; return *this; } - inline ebo_functor_holder& operator=(BOOST_RV_REF(T) x) + inline ebo_functor_holder& operator=(BOOST_RV_REF(T) t) { - this->get() = ::boost::move(x); + this->get() = ::boost::move(t); return *this; } - inline T& get(){return t_;} - inline const T& get()const{return t_;} - - private: - T t_; + inline T& get(){return *this;} + inline const T& get()const{return *this;} }; template -class ebo_functor_holder - : public T +class ebo_functor_holder { BOOST_COPYABLE_AND_MOVABLE(ebo_functor_holder) @@ -341,57 +101,44 @@ class ebo_functor_holder typedef T functor_type; inline ebo_functor_holder() - : T() - {} - - inline explicit ebo_functor_holder(const T &t) - : T(t) - {} - - inline explicit ebo_functor_holder(BOOST_RV_REF(T) t) - : T(::boost::move(t)) + : t_() {} - template - inline ebo_functor_holder(BOOST_FWD_REF(Arg1) arg1, BOOST_FWD_REF(Arg2) arg2) - : T(::boost::forward(arg1), ::boost::forward(arg2)) + inline explicit ebo_functor_holder(T * t) + : t_(t) {} inline ebo_functor_holder(const ebo_functor_holder &x) - : T(static_cast(x)) + : t_(x.t_) {} inline ebo_functor_holder(BOOST_RV_REF(ebo_functor_holder) x) - : T(BOOST_MOVE_BASE(T, x)) + : t_(x.t_) {} inline ebo_functor_holder& operator=(BOOST_COPY_ASSIGN_REF(ebo_functor_holder) x) { - const ebo_functor_holder&r = x; - this->get() = r; + this->t_ = x.t_; return *this; } inline ebo_functor_holder& operator=(BOOST_RV_REF(ebo_functor_holder) x) { - this->get() = ::boost::move(x.get()); + this->t_ = ::boost::move(x.t_); return *this; } - inline ebo_functor_holder& operator=(const T &x) + inline ebo_functor_holder& operator=(T * t) { - this->get() = x; + this->t_ = t; return *this; } - inline ebo_functor_holder& operator=(BOOST_RV_REF(T) x) - { - this->get() = ::boost::move(x); - return *this; - } + inline T& get(){return *t_;} + inline const T& get()const{return *t_;} - inline T& get(){return *this;} - inline const T& get()const{return *this;} + private: + T * t_; }; } //namespace detail { diff --git a/include/boost/intrusive/detail/key_nodeptr_comp.hpp b/include/boost/intrusive/detail/key_nodeptr_comp.hpp index 4e7f7c27..eabaa000 100644 --- a/include/boost/intrusive/detail/key_nodeptr_comp.hpp +++ b/include/boost/intrusive/detail/key_nodeptr_comp.hpp @@ -22,7 +22,6 @@ #endif #include -#include #include