Try forwarding declaring Node and then defining the operator not inline
// In Node.h
class Node;
struct CompareNode : public std::binary_function<Node*, Node*, bool>
{
bool operator()(Node* lhs, Node* rhs) const;
};
typedef boost::heap::fibonacci_heap<
Node*,
boost::heap::compare<CompareNode> > FibonacciHeap;
typedef FibonacciHeap::handle_type HeapHandle;
class Node{
HeapHandle handle_;
int getFScore();
};
// In Node.cpp
#include "Node.h"
bool CompareNode::operator()(Node* lhs, Node* rhs) const {
return lhs->getFScore() > rhs->getFScore();
}