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
Re: [boost] BOOST_TRY like macros: time to add them?
by John Maddock other posts by this author
Feb 29 2004 4:28PM messages near this date
Re: [boost] BOOST_TRY like macros: time to add them? | RE: [boost] Proxy indirect container adaptor: 4 claims
>  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).

I doubt you'll find a satisfactory one, there are pragmas that can disable
those warnings, but that introduces even more code than the traditional:

#ifndef BOOST_NO_EXCEPTIONS
catch(x)
{
}
#endif

I suggest we review these when the first of these lib's comes up for review,
anyone else want to comment?

John.

_______________________________________________
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