Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8371729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:14:01+00:00 2026-06-09T14:14:01+00:00

What are the exception classes that are included in the standard C++ library, and

  • 0

What are the exception classes that are included in the standard C++ library, and what should they be used for? I know there are a few new C++11 exceptions, but I’m not sure what they are or where they are.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:14:03+00:00Added an answer on June 9, 2026 at 2:14 pm
    std::exception <exception> interface (debatable if you should catch this)
        std::bad_alloc <new> failure to allocate storage
            std::bad_array_new_length <new> invalid array length
        std::bad_cast <typeinfo> execution of an invalid dynamic-cast
        std::bad_exception <exception> signifies an incorrect exception was thrown
        std::bad_function_call <functional> thrown by "null" std::function
        std::bad_typeid <typeinfo> using typeinfo on a null pointer
        std::bad_weak_ptr <memory> constructing a shared_ptr from a bad weak_ptr
        std::logic_error <stdexcept> errors detectable before the program executes
            std::domain_error <stdexcept> parameter outside the valid range
            std::future_error <future> violated a std::promise/std::future condition
            std::invalid_argument <stdexcept> invalid argument
            std::length_error <stdexcept> length exceeds its maximum allowable size
            std::out_of_range <stdexcept> argument value not in its expected range
        std::runtime_error <stdexcept> errors detectable when the program executes
            std::overflow_error <stdexcept> arithmetic overflow error.
            std::underflow_error <stdexcept> arithmetic underflow error.
            std::range_error <stdexcept> range errors in internal computations
            std::regex_error <regex> errors from the regular expression library.
            std::system_error <system_error> from operating system or other C API
                std::ios_base::failure <ios> Input or output error
    

    Source: http://en.cppreference.com/w/cpp/error/exception
    In practice, most exceptions are custom exceptions derived from logic_error and runtime_error. Not that these are neglected, but that many exceptions are domain specific.

    Keep in mind that an exception should reflect what went wrong and not who threw it. (No "MyProgramException"s)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few classes that perform background tasks that might raise exceptions. They
I have a problem with auto_ptr in Exception classes, that I eventually reduced to:
When a with @Transactional annotated method throws an Exception, but no classes are declared
Some classes, like exceptions or templates, only need the header file (.h), often there
In this C++ tutorial , in the section titled Standard exceptions, there is this
I have a library-only Android eclipse project (no main class, only library classes) that
I'm building a PHP library that throws various custom Exceptions when it encounters errors.
Problem: during execution, instances of classes that derives from System.Workflow.ComponentModel.Activity is serialized by the
I need to create some base exception classes and inherit from it. I see
What's the proper way to declare custom exception classes in modern Python? My primary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.