I need to initialize some comparator of the new data type TType based on std::set with some object o of another class Object:
typedef std::set <unsigned int, sortSet(o)> TType
This declaration is otside the class (in header file). At the time of the declaration this object does not have to exist, it will be created later.
class sortSet
{
private:
Object o;
public:
sortSet(Object &oo): o(oo) {}
bool operator() ( const unsigned int &i1, const unsigned int &i2 ) const
{
//Some code...
}
};
If the declaration was inside some method (when object has already been created), situation would be quite simple... What can I do?