[heap] Boost heap and default constructors for comparators

The Boost heap library (at least binomial and fibonacci heaps) requires
a default constructor of its comparator in order to call 'pop()' on a heap.
I ran into this because I was trying to use a std::binary_negate<>
wrapper around another comparator: this has no default constructor. So
it's pretty easy to work around; I just have to provide a custom version
of binary_negate.
However, is this intentional? Should it be fixed?
The problem is a little strange; it only surfaces if you call the
'pop()' function of the heap. If you look at the error location,
binomial_heap.hpp:831, it is
// private constructor, just used in pop()
explicit binomial_heap(node_list_type & child_list, size_type size):
super_t(value_compare())
To wit, with 1.49 beta 1:
#include

The Boost heap library (at least binomial and fibonacci heaps) requires a default constructor of its comparator in order to call 'pop()' on a heap.
I ran into this because I was trying to use a std::binary_negate<> wrapper around another comparator: this has no default constructor. So it's pretty easy to work around; I just have to provide a custom version of binary_negate.
However, is this intentional? Should it be fixed?
this should be fixed (not sure if it will make it into 1.49, as it is supposed to be released in a few days ... cheers, tim
participants (2)
-
Evan Driscoll
-
Tim Blechmann