J
Jon
Normally I can search and find answers to things like this but with this
one I'm not even sure what to search for and haven't had any luck. Anyway,
I'm trying to use a template name as a template parameter and can't seem
to figure out what I need to do. Code follows:
template <class MAPTYPE, class KEYTYPE, class VALUETYPE> class double_map
{
MAPTYPE<KEYTYPE,VALUETYPE> forward_; // for "forward" lookups
MAPTYPE<VALUETYPE,KEYTYPE> reverse_; // for "reverse" lookups
....
So I want to use MAPTYPE (which is a template itself) within this template
to specialize on the KEYTYPE and VALUETYPE parameters. For example, want
I want to be able to do something like:
double_map<hash_map, string, int> mymap;
or
double_map<unordered_map, string, int> mymap;
etc...
I can't seem to work out what I need to do to achieve this and keep the
syntax nice.
Any help would be appreciated.
one I'm not even sure what to search for and haven't had any luck. Anyway,
I'm trying to use a template name as a template parameter and can't seem
to figure out what I need to do. Code follows:
template <class MAPTYPE, class KEYTYPE, class VALUETYPE> class double_map
{
MAPTYPE<KEYTYPE,VALUETYPE> forward_; // for "forward" lookups
MAPTYPE<VALUETYPE,KEYTYPE> reverse_; // for "reverse" lookups
....
So I want to use MAPTYPE (which is a template itself) within this template
to specialize on the KEYTYPE and VALUETYPE parameters. For example, want
I want to be able to do something like:
double_map<hash_map, string, int> mymap;
or
double_map<unordered_map, string, int> mymap;
etc...
I can't seem to work out what I need to do to achieve this and keep the
syntax nice.
Any help would be appreciated.