D
devmentee
Hello,
I am trying to create a map/dictionary where the type of key is known
ie std::string, but the value could be of any built in type. ie. int,
double etc. (something along the lines of map<string, T> where T is
template argument)
To hold the value type I have something like:
template<class T>
struct Data
{
T value;
}
Now I am trying to declare a map as below:
std::map<std::string, Data>;
this doesn't/wouldn't work and I don't know how to declare it??
if I have a method which has to pass in this map as a parameter, how
would I do it??
e.g Foo(std::map<string, Data> param ) doesn't work and I don't expect
it to either
Can someone please help!
I am trying to create a map/dictionary where the type of key is known
ie std::string, but the value could be of any built in type. ie. int,
double etc. (something along the lines of map<string, T> where T is
template argument)
To hold the value type I have something like:
template<class T>
struct Data
{
T value;
}
Now I am trying to declare a map as below:
std::map<std::string, Data>;
this doesn't/wouldn't work and I don't know how to declare it??
if I have a method which has to pass in this map as a parameter, how
would I do it??
e.g Foo(std::map<string, Data> param ) doesn't work and I don't expect
it to either
Can someone please help!