Original Post
What is your opion of this code? Is it unsafe? Can something similar be done using STL? ALLOCATOR is a class that stores any type of object //*************************************************************** enum LIST_TYPE { BASE, ITEM, SOLDIER, NUMTYPES }; // Lots of lists with different types all inheriting from the base class ENTITY ALLOCATOR * Base; ALLOCATOR * ItemEntity; ALLOCATOR * Soldier; // One list to hold them all! ALLOCATOR * List[NUMTYPES]; //*************************************************************** //*************************************************************** // Constructor code //*************************************************************** Base = new ALLOCATOR (1); List[BASE] = Base; ItemEntity = new ALLOCATOR (1); List[ITEM] = reinterpret_cast *> (ItemEntity); Soldier = new ALLOCATOR (1); List[SOLDIER] = reinterpret_cast *> (Soldier); //***************************************************************