static const map<const Type*, int>* priority;
where Type is my own special class.
Initialization (why c++ demanded this I have no idea, auto wouldn’t even work)
const map<const Type*, int, less<const Type*>, allocator<pair<const Type* const, int>>>* ToolProperty::priority
= new map<const Type*, int, less<const Type*>, allocator<pair<const Type* const, int>>>();
And finally, trying to use it (where it is telling me that I’m passing in the wrong type)
static void setPriority(const Type* type, int newPriority)
{
(*priority)[type] = newPriority;
}
priority is a pointer to a const map, but operator[] can’t be used with
const associative containers.