From 2de5382dbb2c8a01f4b8ab3f25b0d06221767151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 29 Aug 2016 00:03:46 +0200 Subject: [PATCH] Simplify tree_value_compare overloads to avoid compilation errors in some old GCC versions. --- .../intrusive/detail/tree_value_compare.hpp | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/include/boost/intrusive/detail/tree_value_compare.hpp b/include/boost/intrusive/detail/tree_value_compare.hpp index ebce307..73bef50 100644 --- a/include/boost/intrusive/detail/tree_value_compare.hpp +++ b/include/boost/intrusive/detail/tree_value_compare.hpp @@ -25,7 +25,6 @@ namespace boost{ namespace intrusive{ - //This function object takes a KeyCompare function object //and compares values that contains keys using KeyOfValue template @@ -62,18 +61,20 @@ struct tree_value_compare BOOST_INTRUSIVE_FORCEINLINE key_compare &key_comp() { return static_cast(*this); } + BOOST_INTRUSIVE_FORCEINLINE bool operator()(const key_type &key1, const key_type &key2) const + { return key_compare::operator()(key1, key2); } + template - struct is_key - : boost::intrusive::detail::is_same - {}; + BOOST_INTRUSIVE_FORCEINLINE bool operator()(const key_type &key1, const U &nonkey2) const + { return key_compare::operator()(key1, KeyOfValue()(nonkey2)); } + + template + BOOST_INTRUSIVE_FORCEINLINE bool operator()(const U &nonkey1, const key_type &key2) const + { return key_compare::operator()(KeyOfValue()(nonkey1), key2); } template - BOOST_INTRUSIVE_FORCEINLINE bool operator()(const U &key1, const V &key2) const - { return key_compare::operator()(KeyOfValue()(key1), KeyOfValue()(key2)); } - - template - BOOST_INTRUSIVE_FORCEINLINE bool operator()(const U &key1, const V &key2) - { return key_compare::operator()(KeyOfValue()(key1), KeyOfValue()(key2)); } + BOOST_INTRUSIVE_FORCEINLINE bool operator()(const U &nonkey1, const V &nonkey2) const + { return key_compare::operator()(KeyOfValue()(nonkey1), KeyOfValue()(nonkey2)); } }; } //namespace intrusive{