EXT C++ Library - exceptions

The EXT C++ Library introduces few more named exception types in <stdexcept> manner that can be thrown by other EXT Library facilities.


All EXT C++ exception types are derived from ext::exception type which is derived from std::runtime_error (which is derived from std::exception). Types derived from ext::exception are these:

The exception types are defined in "ext/ext_bits/extexcept" file, include the <ext/c++> header file.


#include <ext/c++>
#include <windows.h>

int main () {
    try {
        // ...
        if (!/*...*/)
            throw ext::runtime_error ("?", GetLastError ());
        // ...
    } catch (const std::exception & e) {
        std::printf ("%s\n", e.what ());


Purpose of exceptions defined for EXT C++ is mainly to improve readability of the source code and to extend base of exception types.

Note that these exception can be thrown by other EXT Library facilities, but it's always documented wherever such possibility exists.