C++ 23 · Input, exceptions and threads

Handle exceptions

Catch exceptions by const reference.

try {
    auto n = std::stoi(text);
} catch (const std::exception& e) {
    std::cerr << e.what() << '\n';
}

Official C++ 23 documentation

More input, exceptions and threads commands

All input, exceptions and threads commands · C++ 23 cheatsheet

Was this page helpful?