Ticket #12745 (closed Bugs: fixed)

Opened 4 months ago

Last modified 3 months ago

key_nodeptr_comp broken if the key type is void*

Reported by: andysem Owned by: igaztanaga
Milestone: To Be Determined Component: intrusive
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:


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.


Change History

comment:2 Changed 3 months ago by andysem

  • Status changed from new to closed
  • Resolution set to fixed

Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.