S
softwareEngineer
Hi all,
I'd like to manage a template in a STL vector container i.e. :
template <typename T>
class MY_Value
{
// ...
T GetValue ();
private :
T _val;
};
now in my main would :
std::vector <MY_Value*> v;
MyValue<int> iV1 = 1;
MyValue<int> iV2 = 2;
v[0] = &iV1;
v[1] = &iV2;
but i have had a problem because (obviously) MyValue it's a template .... ;
There is a workaround to manage a template in a standard container (vector for
example) ?
bye.
I'd like to manage a template in a STL vector container i.e. :
template <typename T>
class MY_Value
{
// ...
T GetValue ();
private :
T _val;
};
now in my main would :
std::vector <MY_Value*> v;
MyValue<int> iV1 = 1;
MyValue<int> iV2 = 2;
v[0] = &iV1;
v[1] = &iV2;
but i have had a problem because (obviously) MyValue it's a template .... ;
There is a workaround to manage a template in a standard container (vector for
example) ?
bye.