From 9137a38982207bd527099ac558cc18ab6e8fb619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 12 Feb 2019 23:20:49 +0100 Subject: [PATCH] Fixes #38 --- doc/intrusive.qbk | 1 + include/boost/intrusive/detail/ebo_functor_holder.hpp | 6 +++--- include/boost/intrusive/treap.hpp | 10 ++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/intrusive.qbk b/doc/intrusive.qbk index b745e50..cb5d075 100644 --- a/doc/intrusive.qbk +++ b/doc/intrusive.qbk @@ -3886,6 +3886,7 @@ to be inserted in intrusive containers are allocated using `std::vector` or `std * Fixed bugs: * [@https://github.com/boostorg/intrusive/pull/33 GitHub Pull #33: ['Fix compilation in case if key is void*, again]] * [@https://github.com/boostorg/intrusive/issues/35 GitHub Issue #35: ['key_of_value on treap_set seems to be broken in 1.69]] + * [@https://github.com/boostorg/intrusive/issues/38 GitHub Issue #38: ['treap: Same type for priority and key comparison leads to ambiguous base class error]] [endsect] diff --git a/include/boost/intrusive/detail/ebo_functor_holder.hpp b/include/boost/intrusive/detail/ebo_functor_holder.hpp index 27415c1..8883166 100644 --- a/include/boost/intrusive/detail/ebo_functor_holder.hpp +++ b/include/boost/intrusive/detail/ebo_functor_holder.hpp @@ -158,7 +158,7 @@ template struct is_unary_or_binary_function : is_unary_or_binary_function_impl {}; -template::value> +template::value> class ebo_functor_holder { BOOST_COPYABLE_AND_MOVABLE(ebo_functor_holder) @@ -222,8 +222,8 @@ class ebo_functor_holder T t_; }; -template -class ebo_functor_holder +template +class ebo_functor_holder : public T { BOOST_COPYABLE_AND_MOVABLE(ebo_functor_holder) diff --git a/include/boost/intrusive/treap.hpp b/include/boost/intrusive/treap.hpp index c6b4eb2..5656975 100644 --- a/include/boost/intrusive/treap.hpp +++ b/include/boost/intrusive/treap.hpp @@ -66,6 +66,8 @@ struct treap_prio_types >::type priority_compare; }; +struct treap_tag; + /// @endcond //! The class template treap is an intrusive treap container that @@ -92,7 +94,7 @@ class treap_impl //Use public inheritance to avoid MSVC bugs with closures , public detail::ebo_functor_holder < typename treap_prio_types::priority_compare - > + , treap_tag> /// @endcond { public: @@ -104,10 +106,10 @@ class treap_impl typedef tree_type implementation_defined; typedef treap_prio_types < typename ValueTraits::pointer - , VoidOrPrioOfValue, VoidOrPrioComp> treap_prio_types_t; + , VoidOrPrioOfValue, VoidOrPrioComp> treap_prio_types_t; typedef detail::ebo_functor_holder - prio_base; + prio_base; /// @endcond @@ -173,7 +175,7 @@ class treap_impl //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) //! or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. treap_impl() - : tree_type(), prio_base(priority_compare()) + : tree_type(), prio_base() {} //! Effects: Constructs an empty container.