From 310ddc3485b1e58607c2010c5de53ceaa1e2bcaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 29 Aug 2016 16:52:31 +0200 Subject: [PATCH] Removed unneeded template parameters to tree_value_compare to reduce symbol length. --- include/boost/intrusive/bstree.hpp | 2 +- .../intrusive/detail/tree_value_compare.hpp | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/boost/intrusive/bstree.hpp b/include/boost/intrusive/bstree.hpp index 3fa69c1..4b7bbe5 100644 --- a/include/boost/intrusive/bstree.hpp +++ b/include/boost/intrusive/bstree.hpp @@ -262,7 +262,7 @@ struct bst_key_types , key_type >::type key_compare; typedef tree_value_compare - value_compare; + value_compare; }; template diff --git a/include/boost/intrusive/detail/tree_value_compare.hpp b/include/boost/intrusive/detail/tree_value_compare.hpp index 73bef50..70a1d79 100644 --- a/include/boost/intrusive/detail/tree_value_compare.hpp +++ b/include/boost/intrusive/detail/tree_value_compare.hpp @@ -27,15 +27,16 @@ namespace intrusive{ //This function object takes a KeyCompare function object //and compares values that contains keys using KeyOfValue -template +template struct tree_value_compare : public boost::intrusive::detail::ebo_functor_holder { + typedef KeyCompare key_compare; + typedef KeyOfValue key_of_value; + typedef typename KeyOfValue::type key_type; + typedef boost::intrusive::detail::ebo_functor_holder base_t; - typedef T value_type; - typedef KeyCompare key_compare; - typedef KeyOfValue key_of_value; - typedef Key key_type; + BOOST_INTRUSIVE_FORCEINLINE tree_value_compare() : base_t() @@ -62,19 +63,19 @@ struct tree_value_compare { return static_cast(*this); } BOOST_INTRUSIVE_FORCEINLINE bool operator()(const key_type &key1, const key_type &key2) const - { return key_compare::operator()(key1, key2); } + { return this->key_comp()(key1, key2); } template BOOST_INTRUSIVE_FORCEINLINE bool operator()(const key_type &key1, const U &nonkey2) const - { return key_compare::operator()(key1, KeyOfValue()(nonkey2)); } + { return this->key_comp()()(key1, KeyOfValue()(nonkey2)); } template BOOST_INTRUSIVE_FORCEINLINE bool operator()(const U &nonkey1, const key_type &key2) const - { return key_compare::operator()(KeyOfValue()(nonkey1), key2); } + { return this->key_comp()(KeyOfValue()(nonkey1), key2); } template BOOST_INTRUSIVE_FORCEINLINE bool operator()(const U &nonkey1, const V &nonkey2) const - { return key_compare::operator()(KeyOfValue()(nonkey1), KeyOfValue()(nonkey2)); } + { return this->key_comp()(KeyOfValue()(nonkey1), KeyOfValue()(nonkey2)); } }; } //namespace intrusive{