ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Re: new exception design guideline
by Dave Gomboc other posts by this author
Aug 25 2003 12:17AM messages near this date
[boost] [bgl] traits question | [boost] Bjam help
>  Maybe I am not seeing this from the right perspetive, but wouldn't a
better
>  design guideline be not to use multiple inheritance at all in an exception
>  hierarchy?  I do not see any reason that any exception would have an IS-A
>  relationship with any two parent classes.  I view an exception of being a
>  very specific error, but multiple inheritance implies that the exception
is
>  simultaneously two types of errors.

Quoting from Section 14.2.2, The C++ Programming Language, 3rd edition
(Bjarne Stroustrop):

Not every grouping of exceptions is a tree structure.  Often, an exception
belongs to two groups.  For example:

class Netfile_err : public Network_err, File_system_err { /* ... */ };

Such a Netfile_err can be caught by functions dealing with network
exceptions:

[code snippet elided]

and also by functions dealing with file system exceptions:

[code snippet elided]

This nonhierarchical organization of error handling is important where
services, such as networking, are transparent to users.  In this case, the
writer of [the code handling file system exceptions] might not even be aware
that a network is involved.

Dave

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved