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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:37:19+00:00 2026-05-24T11:37:19+00:00

class ESClass { public: void PrintMe() throw(); void PrintMe(int) throw(int); }; I want to

  • 0
class ESClass
{
public:
    void PrintMe() throw();
    void PrintMe(int) throw(int);
};

I want to know whether or not we can define different exception specification for overloaded functions. In other words, can we give different exception specification to different version of the function PrintMe?

Note from VS2010:

warning C4290: C++ exception specification ignored except to indicate
a function is not __declspec(nothrow)

  • 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-05-24T11:37:20+00:00Added an answer on May 24, 2026 at 11:37 am

    Yes: they are different functions, they can have different exception specifications.

    If a virtual member function has an exception specification, any override (not overload) must have an exception specification that is at least as strict as the member function being overridden.

    Of course, you should “never write an exception specification” except in those few situations where you must.

    Visual C++ does not fully support exception specifications, so it allows some code that is not actually valid per the C++ language specification. The warning you mention just means that you are using code that uses a C++ language feature not supported by Visual C++:

    A function is declared using exception specification, which Visual C++ accepts but does not implement. Code with exception specifications that are ignored during compilation may need to be recompiled and linked to be reused in future versions supporting exception specifications.

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

Sidebar

Related Questions

I have these classes: class Base { public: virtual void foo(int x = 0)
I have 2 classes: class Base { public: virtual int Foo(int n); virtual void
I want a magic to happen like that... class SomeClass {} public static void
I'm having the following classes: class Base { public virtual void Print() { Console.WriteLine(Base);
I have two classes class PopulationMember { public: void operationOnThisMember1(); void operationOnThisMember2(); ... private:
I have the fallowing classes: class CpuUsage { public: CpuUsage(); virtual ~CpuUsage(); void SetCpuTotalTime(CpuCore
I have the following classes: class A { public: virtual void f() {} };
I have the following classes: class A { public: virtual void myfunc(unsigned char c,
So I have the following classes: class A{ public A(int n1){ n=n1; } int
I have two classes: class A { public: virtual void somefunction() = 0; };

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.