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 6 of 8 Topic 9569 of 9775
Post > Topic >>

Re: Exception Specifications

by gnuyuva <gnuyuva@[EMAIL PROTECTED] > May 2, 2008 at 12:51 PM

On May 2, 3:43 pm, 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();
> }
>

If you 'try' f(), then you can't 'catch' the std::exception.
I think such constructs should be warned by the compilers but my
gcc is happy with this stuff.

Maybe,

void f() throw (Sy***ception, std::exception)
{ throw std::exception(); }

is what you needed.

-- 
      [ 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 Tue Jul 8 23:39:29 CDT 2008.