Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Recommended practise for exceptions specifications?

Reply
Thread Tools

Recommended practise for exceptions specifications?

 
 
Carsten Fuchs
Guest
Posts: n/a
 
      05-18-2005
Hello all,

what please is the recommended (most future-safe, standard-compliant
etc.) practise for exception specifications?

I did some googling, and the trend seemed to be "don't use exception
specifications at all". Well, I was wondering if this is still valid, or
if there are newer trends in the standard that (partially) solve the
related problems.

Thank you very much.

Best regards,
Carsten



--
Ca3D - Engine http://www.Ca3D-Engine.de
Carsten Fuchs http://www.Ca3D-Engine.de/c_Carsten.php
 
Reply With Quote
 
 
 
 
Rapscallion
Guest
Posts: n/a
 
      05-18-2005
Carsten Fuchs wrote:
> what please is the recommended (most future-safe, standard-compliant
> etc.) practise for exception specifications?
>
> I did some googling, and the trend seemed to be "don't use exception
> specifications at all". Well, I was wondering if this is still valid,

or
> if there are newer trends in the standard that (partially) solve the
> related problems.


Also read the respective chapters in Stroustrup's "The C++ Programming
Language".

 
Reply With Quote
 
 
 
 
ben
Guest
Posts: n/a
 
      05-18-2005
exception specification is not an easy task for compiler writers so most
compilers are shipped without that feature compliant to the standard. Read
your compiler documentation.

ben

"Carsten Fuchs" <> wrote in message
news:428b0d3f$0$14746$...
> Hello all,
>
> what please is the recommended (most future-safe, standard-compliant
> etc.) practise for exception specifications?
>
> I did some googling, and the trend seemed to be "don't use exception
> specifications at all". Well, I was wondering if this is still valid, or
> if there are newer trends in the standard that (partially) solve the
> related problems.
>
> Thank you very much.
>
> Best regards,
> Carsten
>
>
>
> --
> Ca3D - Engine http://www.Ca3D-Engine.de
> Carsten Fuchs http://www.Ca3D-Engine.de/c_Carsten.php



 
Reply With Quote
 
Carsten Fuchs
Guest
Posts: n/a
 
      05-18-2005
ben wrote:
> Read your compiler documentation.


I have, that is the very problem: I want portable, compiler-independent
code. That is also the reason why I posted here rather than in a
compiler-specific group.

Best,
Carsten



--
Ca3D - Engine http://www.Ca3D-Engine.de
Carsten Fuchs http://www.Ca3D-Engine.de/c_Carsten.php
 
Reply With Quote
 
Ron Natalie
Guest
Posts: n/a
 
      05-18-2005
ben wrote:
> exception specification is not an easy task for compiler writers so most
> compilers are shipped without that feature compliant to the standard. Read
> your compiler documentation.
>

Even when they are compliant with the standard, the feature is by
and large, useless.
 
Reply With Quote
 
Jerry Coffin
Guest
Posts: n/a
 
      05-19-2005
Carsten Fuchs wrote:
> Hello all,
>
> what please is the recommended (most future-safe, standard-compliant
> etc.) practise for exception specifications?
>
> I did some googling, and the trend seemed to be "don't use exception
> specifications at all".


That's still pretty much the case.

> Well, I was wondering if this is still valid, or
> if there are newer trends in the standard that (partially) solve the
> related problems.


There are some compilers that can optimize some code if you use an
empty exception specification, and based on that a few people recommend
that particular use in limited circumstances. IMO, this is rarely
really justified. From what I've seen so far, it's usually quite a bit
of work for a fairly minor optimization, and a fair amount of potential
for problems as well.

IOW, I'm still fairly firmly in the "don't use them" camp, but it seems
only fair to say that there is another camp out there, and even if you
don't hear from any of them directly, you should be aware that there's
_some_ difference of opinion on the subject.

--
Later,
Jerry.

The universe is a figment of its own imagination.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best practise hierarchy for user-defined exceptions Slaunger Python 2 11-17-2008 01:23 PM
Exceptions - How do you make it work like built-in exceptions? Lie Python 3 01-14-2008 06:45 PM
Exceptions + Performance on path without exceptions gratch06@gmail.com C++ 3 04-16-2007 08:52 PM
Checked exceptions vs unchecked exceptions Ahmed Moustafa Java 5 07-14-2004 01:46 PM
Custom exceptions -- inherit from exceptions.Exception? Paul Miller Python 3 11-12-2003 09:24 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57