id summary reporter owner description type status milestone component version severity resolution keywords cc 7357 copy constructor of mutable_heap does not copy Compare base class Alex Hagen-Zanker timblechmann "The copy constructor of priority_queue_mutable_wrapper only copies over the elements in the queue and it default constructs the Compare base class. Therefore the third assertion in the code below fails. This is a severe problem when an indirect comparison is applied. #include #include struct multiplied_compare { multiplied_compare(int m = 1) : m(m) {} bool operator()(const int& a, const int& b) const { return m*a < m*b; } int m; }; int main() { typedef boost::heap::d_ary_heap< int, boost::heap::mutable_, boost::heap::compare, boost::heap::arity<4> > heap_type; heap_type plus(1); plus.push(100); plus.push(200); assert(plus.top() == 200); heap_type minus(-1); minus.push(100); minus.push(200); assert(minus.top() == 100); heap_type copy = minus; copy.clear(); copy.push(100); copy.push(200); assert(copy.top() == 100); return 0; }" Bugs closed To Be Determined heap Boost 1.52.0 Problem fixed indirect compare, mutable heap