I have a class made (among others) of a std::set
declared as,
std::set<customPair, decltype(comp)> mySet;
with (defined outside the class),
bool comp (customPair a, customPair b) { return a.first >= b.first}
and,
typedef std::pair<int, int> customPair;
Thus, in my class
declaration, I declare mySet
with
class Example:
public:
std::set<customPair, decltype(comp)> mySet;
when I write (i.e. define) it in my constructor,
Example::Example(){
mySet(comp);
}
I get the following error:
.../stl_tree.h:880:7 error: function returning a function
key_comp() const
I am wondering why:
std::set<customPair, decltype(comp)> mySet(comp);
does work when, for example declared on the fly in any method, but does fail in my case (within class)?