I have a class (Namely A) which contains std::set as member variable. Now I want create 2 objects of class A such that:
- One should hold integers in ascending order (odd numbers)
- other should hold integers in descending order (even numbers)
class A {
std::set<int, <magic custom operator>>;
};
A obj1 - Ascending order
A obj2 - Descending order
How can I achieve this functionality at compile(run) time, so that the set will hold the objects in ascending or descending order based on the object.
Any help on this is very much appreciated.