Opened 6 years ago

Closed 6 years ago

#12968 closed Bugs (duplicate)

avl_set: regression when sorting by void*

Reported by: j.gajdosik@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: intrusive
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:

Description

The code below compiles (and works) well with boost-1.58, but failes to compile with boost-1.59 and above:


In file included from /usr/include/boost/intrusive/bstree.hpp:33:0,

from /usr/include/boost/intrusive/avltree.hpp:24, from /usr/include/boost/intrusive/avl_set.hpp:17, from avl_test1.cpp:1:

/usr/include/boost/intrusive/detail/key_nodeptr_comp.hpp: In instantiation of 'bool boost::intrusive::detail::key_nodeptr_comp<KeyTypeKeyCompare, ValueTraits, KeyOfValue>::operator()(const T1&, typename boost::move_detail::enable_if_c<boost::intrusive::detail::key_nodeptr_comp<KeyTypeKeyCompare, ValueTraits, KeyOfValue>::is_same_or_nodeptr_convertible<T1>::value>::type*) const [with T1 = boost::intrusive::avltree_node<void*>*; KeyTypeKeyCompare = EntryType::KeyCompareById; ValueTraits = boost::intrusive::mhtraits<EntryType, boost::intrusive::avl_set_member_hook<>, &EntryType::avl_by_id_hook>; KeyOfValue = boost::move_detail::identity<EntryType>; typename boost::move_detail::enable_if_c<boost::intrusive::detail::key_nodeptr_comp<KeyTypeKeyCompare, ValueTraits, KeyOfValue>::is_same_or_nodeptr_convertible<T1>::value>::type = void]': /usr/include/boost/intrusive/bstree_algorithms.hpp:2025:24: required from 'static boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr boost::intrusive::bstree_algorithms<NodeTraits>::lower_bound_loop(boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr, boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr, const KeyType&, KeyNodePtrCompare) [with KeyType = void*; KeyNodePtrCompare = boost::intrusive::detail::key_nodeptr_comp<EntryType::KeyCompareById, boost::intrusive::mhtraits<EntryType, boost::intrusive::avl_set_member_hook<>, &EntryType::avl_by_id_hook>, boost::move_detail::identity<EntryType> >; NodeTraits = boost::intrusive::avltree_node_traits<void*, false>; boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr = boost::intrusive::avltree_node<void*>*]' /usr/include/boost/intrusive/bstree_algorithms.hpp:917:96: required from 'static boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr boost::intrusive::bstree_algorithms<NodeTraits>::lower_bound(const const_node_ptr&, const KeyType&, KeyNodePtrCompare) [with KeyType = void*; KeyNodePtrCompare = boost::intrusive::detail::key_nodeptr_comp<EntryType::KeyCompareById, boost::intrusive::mhtraits<EntryType, boost::intrusive::avl_set_member_hook<>, &EntryType::avl_by_id_hook>, boost::move_detail::identity<EntryType> >; NodeTraits = boost::intrusive::avltree_node_traits<void*, false>; boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr = boost::intrusive::avltree_node<void*>*; boost::intrusive::bstree_algorithms<NodeTraits>::const_node_ptr = const boost::intrusive::avltree_node<void*>*]' /usr/include/boost/intrusive/bstree_algorithms.hpp:751:49: required from 'static boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr boost::intrusive::bstree_algorithms<NodeTraits>::find(const const_node_ptr&, const KeyType&, KeyNodePtrCompare) [with KeyType = void*; KeyNodePtrCompare = boost::intrusive::detail::key_nodeptr_comp<EntryType::KeyCompareById, boost::intrusive::mhtraits<EntryType, boost::intrusive::avl_set_member_hook<>, &EntryType::avl_by_id_hook>, boost::move_detail::identity<EntryType> >; NodeTraits = boost::intrusive::avltree_node_traits<void*, false>; boost::intrusive::bstree_algorithms<NodeTraits>::node_ptr = boost::intrusive::avltree_node<void*>*; boost::intrusive::bstree_algorithms<NodeTraits>::const_node_ptr = const boost::intrusive::avltree_node<void*>*]' /usr/include/boost/intrusive/bstree.hpp:382:83: required from 'boost::intrusive::bstbase2<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, AlgoType, HeaderHolder>::iterator boost::intrusive::bstbase2<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, AlgoType, HeaderHolder>::find(const KeyType&, KeyTypeKeyCompare) [with KeyType = void*; KeyTypeKeyCompare = EntryType::KeyCompareById; ValueTraits = boost::intrusive::mhtraits<EntryType, boost::intrusive::avl_set_member_hook<>, &EntryType::avl_by_id_hook>; VoidOrKeyOfValue = void; VoidOrKeyComp = EntryType::CompareById; boost::intrusive::algo_types AlgoType = (boost::intrusive::algo_types)6u; HeaderHolder = void; boost::intrusive::bstbase2<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, AlgoType, HeaderHolder>::iterator = boost::intrusive::tree_iterator<boost::intrusive::mhtraits<EntryType, boost::intrusive::avl_set_member_hook<>, &EntryType::avl_by_id_hook>, false>]' avl_test1.cpp:33:39: required from here /usr/include/boost/intrusive/detail/key_nodeptr_comp.hpp:87:69: error: no match for call to '(EntryType::KeyCompareById) (const EntryType&)'

{ return base().get()(key_of_value()(*traits_->to_value_ptr(t1))); }

avl_test1.cpp:14:10: note: candidates are:

struct KeyCompareById {

avl_test1.cpp:15:10: note: bool EntryType::KeyCompareById::operator()(void* const&, const EntryType&) const

bool operator()(const Type &id,const EntryType &b) const

avl_test1.cpp:15:10: note: candidate expects 2 arguments, 1 provided avl_test1.cpp:17:10: note: bool EntryType::KeyCompareById::operator()(const EntryType&, void* const&) const

bool operator()(const EntryType &a,const Type &id) const

avl_test1.cpp:17:10: note: candidate expects 2 arguments, 1 provided


Note: when writing "typedef int *Type;" instead of "typedef void *Type;" it compiles.

Attachments (1)

avl_test1.cpp (911 bytes ) - added by anonymous 6 years ago.
File that does not compile any more

Download all attachments as: .zip

Change History (2)

by anonymous, 6 years ago

Attachment: avl_test1.cpp added

File that does not compile any more

comment:1 by Ion Gaztañaga, 6 years ago

Resolution: duplicate
Status: newclosed

Seems to be duplicate of:

https://svn.boost.org/trac/boost/ticket/12745

which is already fixed for soon to be release Boost 1.64. Your test compiles fine with current master code. In any case, many thanks for the report.

Note: See TracTickets for help on using tickets.