I would like to know if I can create a class that inherits a vector that contains vectors (2d) and can write my own methods.
using matrix = vector<vector<float>>;
class MyClass: public matrix;
...
MyClass m;
m = {{1,2,3}, {4,5,6}, {7,8,9}}
m.randomize(); // my method
m.pop_back() //class vector method
std::collections are not designed to be inherited from.virtualdestructors which means they can't be deleted polymorphically from a base pointer; but there is nothing that prohibits them being inherited from. Even the answers on the linked question indicate the same. I'm not suggesting inheriting is good advice in this case; just that stating they are "not designed to be inherited from" is factually incorrect.