Subject: [Boost-bugs] [Boost C++ Libraries] #12745: key_nodeptr_comp broken if the key type is void*
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-01-10 19:16:30
#12745: key_nodeptr_comp broken if the key type is void*
------------------------------+------------------------
Reporter: andysem | Owner: igaztanaga
Type: Bugs | Status: new
Milestone: To Be Determined | Component: intrusive
Version: Boost 1.63.0 | Severity: Problem
Keywords: |
------------------------------+------------------------
This is a regression since 1.60. `boost::intrusive::set::insert_check()`
fails to compile if called with a key that has type `void*`. The error is
as follows:
{{{
/home/lastique/src/boost-
xcoder/boost/intrusive/detail/key_nodeptr_comp.hpp:87: error: no match for
call to
â(MediaBufferBase::callback_list::callback_reference::order_by_key) (const
MediaBufferBase::callback_list::callback_reference&)â
{ return base().get()(key_of_value()(*traits_->to_value_ptr(t1))); }
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}}}
The problem is in `key_nodeptr_comp` implementation, which has an overload
of `operator()` whith two formal parameters, the second one being used for
`enable_if_c` and having the type `void*`. This operator calls user's
ordering predicate with only one argument, which is naturally not
expected.
The suggested solution is to use SFINAE on the return type of the
operators or use a more distinct type for the hidden argument of the
operators.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12745> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC