I would like to create a std::map<T1, std::set<T2> >
where the set
s use a non-default comparator. For example, if I were declaring the set
on its own, I would declare it as:
std::set<int,bool(*)(int,int)> s (fn_pt);
where fn_pt
is a function pointer. In my example, when I add a new key to the std::map
, I would like the set to be constructed with that non-default comparator. Is such a thing possible?
To further complicate things, my compiler does not support C++11, so I can only accept a solution that does not require C++11; however, if there is a C++11 way of doing this, I would be interested in seeing that as well.