The assertions in boost/heap/detail/mutable_heap.hpp in in increase and in decrease cause compilation errors when assertions are enabled and value_compare is not default-constructible, even though everything builds fine without assertions.
and can simply be changed to value_comp() instead of value_compare() (calling a member function, which may have been intended and is just a typo...) to make the container work with non-default-constructible comparison callables.
I may have missed a requirement that the comparison operator must be default constructible in the documentation, but that would make the container a lot less useful for certain applications where the comparison operator has to access information, e.g., when the queue stores indices into some other data structure.
The assertions in
boost/heap/detail/mutable_heap.hpp
in inincrease
and indecrease
cause compilation errors when assertions are enabled and value_compare is not default-constructible, even though everything builds fine without assertions.The lines in question are:
BOOST_ASSERT(!value_compare()(v, handle.iterator->first));
and
BOOST_ASSERT(!value_compare()(handle.iterator->first, v));
and can simply be changed to
value_comp()
instead ofvalue_compare()
(calling a member function, which may have been intended and is just a typo...) to make the container work with non-default-constructible comparison callables. I may have missed a requirement that the comparison operator must be default constructible in the documentation, but that would make the container a lot less useful for certain applications where the comparison operator has to access information, e.g., when the queue stores indices into some other data structure.