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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:08:50+00:00 2026-06-14T01:08:50+00:00

I’m using c++ and i’m in a really deeply nested set of functions and

  • 0

I’m using c++ and i’m in a really deeply nested set of functions and a special case has occurred and I would like to exit to the top level.

Now I hear c++ exceptions are deprecated now so what should I use instead in this case?

So what i’m really asking is, are setjmp() and longjmp() OK in c++ code?

  • 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-14T01:08:54+00:00Added an answer on June 14, 2026 at 1:08 am

    If possible I would avoid using setjmp/longjmp, as most C stuff, in C++ code. For what concerns C++ exceptions, as far as I know, they are not deprecated. Indeed, I think it would be very hard to deprecate such a pervasive feature without severely hindering backwards compatibility. It’s possible that you have heard that (some form of) exception specifications, a feature of the recent C++11 standard that was not present in the previous version of the language, has been deprecated during the approval process (see, e.g., this post on Herb Sutter’s blog).

    This said, exceptions in C++ are not easy to use well. C++ has lots of features, and sometimes they interplay in very complex ways. Some necessary (but not sufficient) advices are:

    • Derive your exceptions from std::exception;
    • Manage your resources via RAII;
    • Catch by reference, not by value or by pointer.

    But the best advice is: understand exactly how exceptions work – precanned advices do not work well. At the purpose, you might read this, this, this and this about how to use exceptions and RAII. Especially “More Effective C++” has a whole chapter dedicated to exceptions, exposing some intricate consequences of apparently simple snippets of code. It raises your overall awareness of the language.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to count the length of a string with PHP. The string
I am using JSon response to parse title,date content and thumbnail images and place
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.