G
Guest
I think, a class template with a static vector member:
----------------------------
template <class C>
struct Shared
{
unsigned int count;
C data;
};
template <class C>
class SharedObject
{
public:
............
protected:
Shared<C> *pointer;
static vector <Shared<C>*> pointers;
};
----------------------------
Is it valid in C++?
Ofcourse, if C is class Texture2D or C is class Model3D I want 2 different static vectors:
All SharedObject<Texture2D> must have the same static vector<Texture2D>
and
All SharedObject<Model3D> must have the same static vector<Model3D>
Is this possible?
thanks
----------------------------
template <class C>
struct Shared
{
unsigned int count;
C data;
};
template <class C>
class SharedObject
{
public:
............
protected:
Shared<C> *pointer;
static vector <Shared<C>*> pointers;
};
----------------------------
Is it valid in C++?
Ofcourse, if C is class Texture2D or C is class Model3D I want 2 different static vectors:
All SharedObject<Texture2D> must have the same static vector<Texture2D>
and
All SharedObject<Model3D> must have the same static vector<Model3D>
Is this possible?
thanks