c++ - Derived public static std::list -
will please point me in correct directions. want "static" (singular instance) std::list, std::list shared within objects having instance of "container" structure seen below. however, other elements within structure remain unique each instance.
where place keyword "static" derived std::list?
note keyword "static" below misplaced, don't know should in case.
struct container : public static std::list<int> { public: container() {} ~container() {} list<int*> handles; }; // struct
you don't need inheritance here; best way have static member:
struct container { static std::list<int> list_; } there no static inheritance well, propose implement own get, insert, remove methods modify internal static list.
Comments
Post a Comment