I know the STL will throw on a memory allocation error or if the contained type throws in its constructor / assignment operator.
Otherwise, apparently \'a few\' STL meth
Well, I have this big, gigantic book titled, The C++ Standard, that contains a complete description of all functions in the standard library and what they can/cannot do.
Won't be 100% accurate, and is for C++03, but a half-hour effort based on grepping through GCC 4.3.4 includes, ignoring tr1 and ext but including iostream. Crucially, some of these checks might be due to this implementation prefering more defensive coding, and might not be mandated in the Standard and available universally....
bitset
std::overflow_error
- .to_ulong()
when too many bits to fit in unsigned longstd::out_of_range
- operator[]()
attempt past endnew
std::bad_alloc
typeinfo
std::bad_cast
on invalid dynamic_cast
attemptios
std::ios_base::failure
when using exception masks for error reportingstring
out_of_range
- at
/append
/assign
/insert
/erase
/replace
/copy
/substr
length_error
: attempt to exceed max_size()
during reserve
or implicit resize (e.g. assign
/insert
/+=
etc.)locale
std::bad_cast
if locale doesn't contain a facet of type Facet
std::runtime_error
in various null-pointer/undefined-facet situationsdeque
/vector
length_error
: attempt reserve()
or implicitly-grow > max_size()
out_of_range
: at()
map
std::out_of_range
: at()