Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Exception S...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 8 Topic 9569 of 9823
Post > Topic >>

Re: Exception Specifications

by Jon <j.trauntvein@[EMAIL PROTECTED] > May 2, 2008 at 12:47 PM

On May 2, 4:43 am, Keith Halligan <keith.halli...@[EMAIL PROTECTED]
> wrote:
> I'm a bit unsure about the following behaviour with exception
> specifiers in C++ functions
>
> Here's some sample code:
>
> #include <exception>
>
> class Sy***ception { };
>
> void f( ) throw (Sy***ception)
> {
>     throw std::exception();
>
> }

I may be wrong, but I believe that this code should fail to compile.
The exception specification for f() indicates that it will throw
objects only of type Sy***ception.  class Sy***ception is not derived
from std::exception so throwing an object of class std::exception
would violate the exception specification.

Regards,

Jon Trauntvein

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 8 Posts in Topic:
Exception Specifications
Keith Halligan <keith.  2008-05-02 04:43:30 
Re: Exception Specifications
Martin T <0xCDCDCDCD@[  2008-05-02 12:48:22 
Re: Exception Specifications
peter koch larsen <pet  2008-05-02 12:46:50 
Re: Exception Specifications
Francis Glassborow <fr  2008-05-02 12:46:16 
Re: Exception Specifications
Jon <j.trauntvein@[EMA  2008-05-02 12:47:05 
Re: Exception Specifications
gnuyuva <gnuyuva@[EMAI  2008-05-02 12:51:23 
Re: Exception Specifications
Greg Herlihy <greghe@[  2008-05-03 06:13:28 
Re: Exception Specifications
Francis Glassborow <fr  2008-05-03 16:10:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 1:30:56 CDT 2008.