side note — virtual function is also very rare in STL classes. I don’t know any.
STL functions seldom throw exception. See P 248 [[c++standard library]]
- at() method of vector/string/map… throws, since it’s the “checked” version of the subscript operator
- reserve() method throws
Besides these two unusual functions, STL would only throw the standard low-level exceptions like memory allocation failures. All other error conditions are undefined-behavior, such as
- top()/pop() on priority queue
- std::string operator[index] with invalid index
However, Payload data types going into STL container can create exceptions:
- If a payload class ctor/assignment throws, then it would propagate.
- Payload destructors should never throw. [[c++coding standard]] says it’s forbidden by STL standard.