Tell me how to properly implement a C ++ container that can simultaneously work as a vector (list), a LIFO stack and a FIFO queue, making maximum use of the STL features out of the box?
Application: I want a universal container type that can not only store nested structures (while the class Obj { string val; vector<Obj*> nested; } manages), but also to know the features specific to each listed container at the same time :
- vector: arbitrary read / insert / replace by index
- stack: push / pop
- queue: put / get