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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:15:14+00:00 2026-06-08T22:15:14+00:00

My Visual C++ code uses the std::exception constructor that accepts a string and I’m

  • 0

My Visual C++ code uses the std::exception constructor that accepts a string and I’m trying to port the code to Linux / G++. What exception class should I use?

  • 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-08T22:15:17+00:00Added an answer on June 8, 2026 at 10:15 pm

    Microsoft Visual C++’s std::exception(const char*) constructor is non-standard. While in the C++ Standard Library, std::exception has a const char* what() const method, it provides no way of specifying a string except by overriding.

    You should rewrite your code to use std::runtime_error or one of the other classes from <stdexcept> as an alternative. Existing code that catches std::exception does not need to be changed, of course, since std::runtime_error derives from it.

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

Sidebar

Related Questions

I was trying to clean up some code that uses char* with std::string and
I've got a loop in my code that uses std::basic_string<HANDLE> , and then waits
The SPE IDE that I use for my Python code uses this visual cue
I have some code that I want to build. The code uses boost::ptr_map class
I'm trying to port some assembly code written in Visual Studio into GNU inline
Currently I'm using Visual Studio 2008 (SP1) and developing some code that uses nested
I'm running this C# code in Visual Studio in debug mode: public class MyHandlerFactory
I'm writing a logging class that uses a templatized operator<< function. I'm specializing the
I have in Visual Studio 2008 a .NET 3.5 C# project that uses a
What is wrong with this code: Header: #include <map> using namespace std; template<class T>

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.