Template, class - data member copy problem
Hi! I have a template class say Store defined like :
Code:
template <class obj>
class Store
{
private:
obj* data;
public:
Store()
{
data = NULL;
}
Store(Store& s)
{
.... //now i dont know how to do deep copy of the data from s to my data here
//becuase if i do memcpy and pass the size as sizeof(obj), then if i have a Store<char*> then it wouldnt seem to work
//how do i solve this problem, or if there is better way of jusy copying then it would be cool too. please help
}
};
Thanx in advance..
Ankur