
Hi,
I'm getting compile errors trying to use iterator_to() on an unordered_set
when given a const reference (and returning a const_iterator).
It works fine for me with ordered set.
I am able to reproduce this error by adding the following two lines:
MyClass const &cr = values[0];
base_set.iterator_to(cr);
to the bottom of the Example code (just before the return 0 from main) for
unordered_set at:
http://www.boost.org/doc/libs/1_45_0/doc/html/intrusive/unordered_set_unorde...
The error is:
/opt/boost/include/boost-1_38/boost/intrusive/hashtable.hpp: In member
function
‘boost::intrusive::detail::hashtable_iterator ::type::const_pointer>::reference) const [with Config =
boost::intrusive::detail::usetopt /opt/boost/include/boost-1_38/boost/intrusive/unordered_set.hpp:733:
instantiated from ‘typename
boost::intrusive::hashtable_impl<Config>::const_iterator
boost::intrusive::unordered_set_impl<Config>::iterator_to(typename
boost::intrusive::hashtable_impl<Config>::const_reference) const [with
Config =
boost::intrusive::detail::usetopt ::type>, 3ul>]’ ::type>, 3ul> >, example.cpp:82: instantiated from here
/opt/boost/include/boost-1_38/boost/intrusive/hashtable.hpp:1682: error: no
matching function for call to
‘boost::intrusive::detail::hashtable_iterator ::type>, 3ul> >* const)’ I am using 1_38_0. I have not yet tried 1_45_0, but I have gone through the
entire list of fixed bugs on the release notes between 1_38 and 1_45.
I'll try 1_45_0 in the next few days, just in case.
I am able to work around my issue by casting away const on my reference
before calling iterator_to and assigning the result back into a
const_iterator, so for me it is nothing more than an annoyance, but I
thought I'd bring it to your attention so it can be fixed in a future
release.
Thanks,
Paul Rose