Hi folks,
I'd like to write a (C++) method that returns an std::set of custom objects. I do not however want to expose the comparator used when inserting the objects, so I make it a private class. I create the set like this:
std::set<some_class, some_class_comparator> return_object;
now I want to return the set, so it has to be cast like this (implicitly when returning):
(const std::set<some_class>) return_object;
This is where the compiler complains. Is there a way to cast a mutable set with a comparator to an immutable without?
thanks a lot,
holger