I have a class, and I want to be able to store and retrieve some data of any type, but I don't want to have to re-declare my class as a template since this is a minor piece of the class.
So, I'd have this
class MyClass
{
public:
MyClass() {}
~MyClass() {}
template <class T>
void SetData(T &Data);
template <class T>
void GetData(T&Data);
private:
T &mData;
}
I'm pretty sure it's not possible to do it the way i want, but are there other options I haven't looked it?
Thanks