I have an std::set with the Compare class which requires additional parameter to compare keys. This variable parameter is determined in run-time and I pack it inside the set's keys just to make it accessible to Compare.
However, the parameter logically belongs to the set rather than the keys so this solution looks awkward and duplicates the same value over all keys.
Is there an elegant way to pass additional parameter to the Compare class? (I first thought about set::value_comp, but it returns compare object by value while I need a reference).
Thanks.