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 8659529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:02:16+00:00 2026-06-12T16:02:16+00:00

Is there any difference between throw() and noexcept other than being checked at runtime

  • 0

Is there any difference between throw() and noexcept other than being checked at runtime and compile time respectively?

This Wikipedia C++11 article suggests that the C++03 throw specifiers are deprecated.
Why so … Is the noexcept capable enough to cover all that at compile time?


Note: I checked this question and this article, but couldn’t determine the solid reason for its deprecation.

  • 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-12T16:02:17+00:00Added an answer on June 12, 2026 at 4:02 pm

    Exception specifiers were deprecated because exception specifiers are generally a terrible idea. noexcept was added because it’s the one reasonably useful use of an exception specifier: knowing when a function won’t throw an exception. Thus it becomes a binary choice: functions that will throw and functions that won’t throw.

    noexcept was added rather than just removing all throw specifiers other than throw() because noexcept is more powerful. noexcept can have a parameter which compile-time resolves into a boolean. If the boolean is true, then the noexcept sticks. If the boolean is false, then the noexcept doesn’t stick and the function may throw.

    Thus, you can do something like this:

    struct<typename T>
    {
      void CreateOtherClass() { T t{}; }
    };
    

    Does CreateOtherClass throw exceptions? It might, if T‘s default constructor can. How do we tell? Like this:

    struct<typename T>
    {
      void CreateOtherClass() noexcept(is_nothrow_default_constructible<T>::value) { T t{}; }
    };
    

    Thus, CreateOtherClass() will throw iff the given type’s default constructor throws. This fixes one of the major problems with exception specifiers: their inability to propagate up the call stack.

    You can’t do this with throw().

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

Sidebar

Related Questions

Is there any difference between doing this: $(.topHorzNavLink).click(function() { var theHoverContainer = $(#hoverContainer); var
Is there any difference between ReferencePath with condition '%(CopyLocal)'=='true' and ReferenceCopyLocalPaths ? The question
Is there any difference between: public ActionResult logOff() { FormsAuth.SignOut(); return RedirectToAction(index, Home); }
Is there any difference between '{' and '[' when formatting a JSON object?
Is there any difference between the below 2 CREATE TABLE statements in SQL Server
Is there any difference between the following two examples and should one be preferred
Is there any difference between starting a program file with any of those? #!/usr/bin/env
Is there any difference between these tow pieces of code & which approach is
Is there any difference between type casting & type conversion in c++.
Is there any difference between these two LINQ statements: var query = from a

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.