0

I have a struct which has a member of the type boost::heap:.pairing_heap. I my intention is to pass a comparision function (which can be member , but not necessary) for the pairing heap. How can I achieve that. I tried this.

I don't understand the error message. Everything seems fine to me.

struct B{
  //some more fields: irrelevant here
  bool compare_(std::pair<int,int>&, std::pair<int,int>&);
  boost::heap::pairing_heap<std::pair<int,int>, boost::heap::compare<compare_> > in;
 };

bool Block::compare_(std::pair<int,int>& c, std::pair<int,int>& d)
{
   //returns true or false based on some criteria
}

error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> struct boost::heap::compare’
Utkrist Adhikari
  • 1,052
  • 3
  • 15
  • 42
  • 1
    You're using a [reserved identifier](http://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier) (assuming that's yours). – chris Jul 26 '13 at 08:37
  • Presumably it is unhappy because you are passing a member function, which actually has three parameters, if you count the inmplicit 1st parameter for `this`. – juanchopanza Jul 26 '13 at 08:41

0 Answers0