STL classes are intended for use in well-defined ways, that is, they either create them using the POD type, or an STL class that meets the class requirements, or a user-defined type that implements class requirements.
You should also not inherit from STL types; it is better to create a new class with an STL object as a member; then you can implement public methods that correspond to the method signature of the STL object.
Without going into all the rationale for these rules, this is the most portable and probably long-lived way to use STL classes. It maintains a bright line between application classes and STL classes.
source share