C++ (Qt)template <class T>struct ID {//... static ID<T> statID;}; template<class T> ID<T> ID<T>::statID; template<class T>struct Object { Object( ID <T> & parent );// ... // data ID<T> mID;}; struct Object_A : public Object<Object_A> {// ...}; struct Object_B : public Object<Object_B> {//...}; template<class T>struct Container : public T {// ...}; template<class T>struct Layer : public Container<T> {//...}; typedef Layer <Object_A> Layer_A;typedef Layer <Object_B> Layer_B;
C++ (Qt)struct Object_A : public Object<Object_A>
C++ (Qt)template <class T>struct ID {//... static ID<T> statID;};
C++ (Qt)struct ID {//... static ID<T> statID;};
C++ (Qt)struct ID {//... static boost::recursive_wrapper<ID<T>> statID;};
C++ (Qt)template <class T>struct ID {//... Object <T> * mObject; ID<T> * mPrev, * mNext; static ID<T> statID;};
struct Object_A : public Object<Object_A>
template <class T>struct ID { static ID<T> statID; ...};
template <class T>struct ID { static ID statID; ...};
template <class T>struct ID {... static ID getID() { return _getID(); }protected: static ID& _getID(){ static ID id; return id;} ...};