A
Ajay 0x007
Hi,
I have a templated class and I want to mantain a list pointers of all
objects of that class. How it can be achieved???
If i do like below (make list as static member variable of same class)
then the list will be different for all typename X, i.e.
template <typename X> class A{
static std::vector<class<X>* > list;
A(){
list.push_back(this);
}
};
If I make a global pointer instead of static member variable as above
then I need to provide actual argumenst to X which I cannot know in
advance.
Is their any way to achiev that?
I have a templated class and I want to mantain a list pointers of all
objects of that class. How it can be achieved???
If i do like below (make list as static member variable of same class)
then the list will be different for all typename X, i.e.
template <typename X> class A{
static std::vector<class<X>* > list;
A(){
list.push_back(this);
}
};
If I make a global pointer instead of static member variable as above
then I need to provide actual argumenst to X which I cannot know in
advance.
Is their any way to achiev that?