changing throw(...) changes interface?

D

Daniel Etzold

Hi,

does adding a throw(...) or throw() to a method or just changing
the number of exceptions listed within a throw change the
interface?

Example: having a class with a method within a class library
class x {
....
void f()
[or void f() throw( int )]
};

and changing it to
class x { ...
void f() throw() [or throw( int ) and so on]
[or void f() throw( int, char*) respectively]
};

will the library still be binary compatible?

Regards,
Daniel
 
V

Victor Bazarov

Daniel said:
does adding a throw(...) or throw() to a method or just changing
the number of exceptions listed within a throw change the
interface?

No, but it changes the type ("signature").
Example: having a class with a method within a class library
class x {
...
void f()
[or void f() throw( int )]
};

and changing it to
class x { ...
void f() throw() [or throw( int ) and so on]
[or void f() throw( int, char*) respectively]
};

will the library still be binary compatible?

Binary compatibility is beyond the scope of comp.lang.c++. You
should ask in the newsgroup for your compiler.

V
 
D

Daniel Etzold

Victor said:
Daniel Etzold wrote:


Binary compatibility is beyond the scope of comp.lang.c++. You
should ask in the newsgroup for your compiler.

I'm using GCC in various versions.
 
V

Victor Bazarov

Daniel said:
I'm using GCC in various versions.

Then you should consider posting to 'gnu.g++.help' or go to their
web site and find where they hang out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top