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] BOOST_TRY like macros: time to add them?
by Pavel Vozenilek other posts by this author
Feb 27 2004 9:48PM messages near this date
[boost] Re: boost::any: explicit constructor? | [boost] Re: BOOST_TRY like macros: time to add them?
Disabling try/catch through preprocessor when
compiling without exception support was suggested
e.g by Robert Ramey in:
http://aspn.activestate.com/ASPN/Mail/Message/boost/1799735


Right now there are 3 libraries near review, each using their
own set of similar macros:
 - circular_buffer
 - indexed_set
 - serialization

The reasons to use macros instead of RAII is convenience
and performance.

Some compilers (BCB) do not allow try/catch with
exceptions disabled so some solution is needed.

It would be better to have and use standardized macros
in Boost.


Example: macros used in indexed_set:

#if !defined(BOOST_NO_EXCEPTIONS)
#  define BOOST_INDEXED_SET_TRY try
#  define BOOST_INDEXED_SET_CATCH(x) catch(x)
#  define BOOST_INDEXED_SET_RETHROW throw
#else
#  define BOOST_INDEXED_SET_TRY
#  define BOOST_INDEXED_SET_CATCH(x) if(0)
#  define BOOST_INDEXED_SET_RETHROW
#endif

Compiles w/o warnings on VC6+, BCB gives unreachable
code warning (but I'll try to find workaround).

/Pavel



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Pavel Vozenilek
Alexander Terekhov
Gennaro Prota
Gennaro Prota
David Abrahams
David Abrahams
Peter Dimov
Gennaro Prota
David Abrahams
Alexander Terekhov
Gennaro Prota
David Abrahams
John Maddock
Peter Dimov
Pavel Vozenilek
Pavel Vozenilek
Pavel Vozenilek
Jody Hagins
Giovanni Bajo
=?iso-8859-1?Q?Joaqu=EDn=20M=AA=20L=F3pez=20Mu=F1oz?=
=?iso-8859-1?Q?Joaqu=EDn=20M=AA=20L=F3pez=20Mu=F1oz?=
Peter Dimov
=?iso-8859-1?q?Lars_Gullik_Bj=F8nnes?=
=?iso-8859-1?q?Lars_Gullik_Bj=F8nnes?=
Guillaume Melquiond
David Abrahams
Pavel Vozenilek
Guillaume Melquiond
David Abrahams
Pavel Vozenilek
Daryle Walker
John Maddock

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