I have a simple struct which contains GUI controls in an application I'm working on. The struct is defined like
template<class T>
struct guiControl
{
T minValue
T defaultValue
...
}
Each control is identified by a unique integer ID in my app. I would like to access the structs with a map<int, guiControl>
, but this is not allowed:
unspecialized class template can't be used as a template argument for template parameter... use of class template requires template argument list.
OK, that makes sense to me - the compiler needs to know exactly how much space the value type of the map needs. But is there any other way for me to approximate this behavior - preferably without getting into Boost or a more complicated class heirarchy?