R_N
R_N

Reputation: 111

Using boost fibonacci_heap

Using fibonacci_heap results in a compilation error:

struct Less: public binary_function<Node*, Node*, bool>
{
    bool operator()(const Node*& __x,  Node*& __y) const
        { return __x->time < __y->time; }

};

boost::fibonacci_heap<Node*, Less >*    m_heap;

then

Less* ls = new Less;
m_heap = new boost::fibonacci_heap<Node*, Less >(1000, (*ls));

Any attempt to run m_heap->push(n) results in

no match for call to ‘(TimeSync::Less) (TimeSync::Node* const&, TimeSync::Node*&)’
UnmanagedUtils/Trading/Simulation/TimeSync.h:50: note: candidates are: bool TimeSync::Less::operator()(const TimeSync::Node*&, TimeSync::Node*&) const
/usr/local/include/boost-1_35/boost/property_map.hpp: In function ‘Reference boost::get(const boost::put_get_helper<Reference, PropertyMap>&, const K&) [with PropertyMap = boost::identity_property_map, Reference = unsigned int, K = TimeSync::Node*]’:

Upvotes: 1

Views: 539

Answers (1)

Kerrek SB
Kerrek SB

Reputation: 476950

Change the signature to operator()(Node * const &, Node * const &) const.

Upvotes: 2

Related Questions