forked from boostorg/intrusive
Rollback to previous tree_value_compare SFINAE, as enable_if imported from movelib now defaults to a sfinae-friendly type
This commit is contained in:
@@ -27,7 +27,7 @@ namespace boost{
|
|||||||
namespace intrusive{
|
namespace intrusive{
|
||||||
|
|
||||||
//Needed to support smart references to value types
|
//Needed to support smart references to value types
|
||||||
template <class From, class ValuePtr, class R = void>
|
template <class From, class ValuePtr>
|
||||||
struct disable_if_smartref_to
|
struct disable_if_smartref_to
|
||||||
: detail::disable_if_c
|
: detail::disable_if_c
|
||||||
< detail::is_same
|
< detail::is_same
|
||||||
@@ -39,8 +39,7 @@ struct disable_if_smartref_to
|
|||||||
< typename pointer_rebind
|
< typename pointer_rebind
|
||||||
< ValuePtr
|
< ValuePtr
|
||||||
, const typename boost::movelib::pointer_element<ValuePtr>::type>::type>
|
, const typename boost::movelib::pointer_element<ValuePtr>::type>::type>
|
||||||
::reference>::value,
|
::reference>::value
|
||||||
R
|
|
||||||
>
|
>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
@@ -52,10 +51,6 @@ template< class ValuePtr, class KeyCompare, class KeyOfValue, class Ret = bool
|
|||||||
struct tree_value_compare
|
struct tree_value_compare
|
||||||
: public boost::intrusive::detail::ebo_functor_holder<KeyCompare>
|
: public boost::intrusive::detail::ebo_functor_holder<KeyCompare>
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
struct sfinae_type;
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef typename
|
typedef typename
|
||||||
boost::movelib::pointer_element<ValuePtr>::type value_type;
|
boost::movelib::pointer_element<ValuePtr>::type value_type;
|
||||||
typedef KeyCompare key_compare;
|
typedef KeyCompare key_compare;
|
||||||
@@ -93,7 +88,7 @@ public:
|
|||||||
|
|
||||||
template<class U>
|
template<class U>
|
||||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonkey
|
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonkey
|
||||||
, typename disable_if_smartref_to<U, ValuePtr, sfinae_type*>::type = 0) const
|
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||||
{ return this->key_comp()(nonkey); }
|
{ return this->key_comp()(nonkey); }
|
||||||
|
|
||||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key1, const key_type &key2) const
|
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key1, const key_type &key2) const
|
||||||
@@ -110,22 +105,22 @@ public:
|
|||||||
|
|
||||||
template<class U>
|
template<class U>
|
||||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const key_type &key1, const U &nonkey2
|
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const key_type &key1, const U &nonkey2
|
||||||
, typename disable_if_smartref_to<U, ValuePtr, sfinae_type*>::type = 0) const
|
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||||
{ return this->key_comp()(key1, nonkey2); }
|
{ return this->key_comp()(key1, nonkey2); }
|
||||||
|
|
||||||
template<class U>
|
template<class U>
|
||||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonkey1, const key_type &key2
|
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonkey1, const key_type &key2
|
||||||
, typename disable_if_smartref_to<U, ValuePtr, sfinae_type*>::type = 0) const
|
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||||
{ return this->key_comp()(nonkey1, key2); }
|
{ return this->key_comp()(nonkey1, key2); }
|
||||||
|
|
||||||
template<class U>
|
template<class U>
|
||||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const value_type &value1, const U &nonvalue2
|
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const value_type &value1, const U &nonvalue2
|
||||||
, typename disable_if_smartref_to<U, ValuePtr, sfinae_type*>::type = 0) const
|
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||||
{ return this->key_comp()(KeyOfValue()(value1), nonvalue2); }
|
{ return this->key_comp()(KeyOfValue()(value1), nonvalue2); }
|
||||||
|
|
||||||
template<class U>
|
template<class U>
|
||||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonvalue1, const value_type &value2
|
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonvalue1, const value_type &value2
|
||||||
, typename disable_if_smartref_to<U, ValuePtr, sfinae_type*>::type = 0) const
|
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||||
{ return this->key_comp()(nonvalue1, KeyOfValue()(value2)); }
|
{ return this->key_comp()(nonvalue1, KeyOfValue()(value2)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -133,10 +128,6 @@ template<class ValuePtr, class KeyCompare, class KeyOfValue, class Ret>
|
|||||||
struct tree_value_compare<ValuePtr, KeyCompare, KeyOfValue, Ret, true>
|
struct tree_value_compare<ValuePtr, KeyCompare, KeyOfValue, Ret, true>
|
||||||
: public boost::intrusive::detail::ebo_functor_holder<KeyCompare>
|
: public boost::intrusive::detail::ebo_functor_holder<KeyCompare>
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
struct sfinae_type;
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef typename
|
typedef typename
|
||||||
boost::movelib::pointer_element<ValuePtr>::type value_type;
|
boost::movelib::pointer_element<ValuePtr>::type value_type;
|
||||||
typedef KeyCompare key_compare;
|
typedef KeyCompare key_compare;
|
||||||
@@ -172,7 +163,7 @@ public:
|
|||||||
|
|
||||||
template<class U>
|
template<class U>
|
||||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonkey
|
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonkey
|
||||||
, typename disable_if_smartref_to<U, ValuePtr, sfinae_type*>::type = 0) const
|
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||||
{ return this->key_comp()(nonkey); }
|
{ return this->key_comp()(nonkey); }
|
||||||
|
|
||||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key1, const key_type &key2) const
|
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key1, const key_type &key2) const
|
||||||
@@ -180,12 +171,12 @@ public:
|
|||||||
|
|
||||||
template<class U>
|
template<class U>
|
||||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const key_type &key1, const U &nonkey2
|
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const key_type &key1, const U &nonkey2
|
||||||
, typename disable_if_smartref_to<U, ValuePtr, sfinae_type*>::type = 0) const
|
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||||
{ return this->key_comp()(key1, nonkey2); }
|
{ return this->key_comp()(key1, nonkey2); }
|
||||||
|
|
||||||
template<class U>
|
template<class U>
|
||||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const U &nonkey1, const key_type &key2
|
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const U &nonkey1, const key_type &key2
|
||||||
, typename disable_if_smartref_to<U, ValuePtr, sfinae_type*>::type = 0) const
|
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||||
{ return this->key_comp()(nonkey1, key2); }
|
{ return this->key_comp()(nonkey1, key2); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user