[patch-rfc] N2179: Exception Propagation in C++

Peter Dimov pdimov@mmltd.net
Mon Jul 21 14:20:00 GMT 2008


Sebastian Redl wrote:
> Paolo Carlini wrote:
>>> Is __GXX_EXPERIMENTAL_CXX0X__ defined during the compilation
>>> of libsupc++ itself?
>>> 
>> 
>> At the moment is not defined, because there are no reasons to do
>> that. Maybe you want to arrange things in such a way that it can be
>> safely defined. For sure, however, when the user normally includes
>> <exception> in its source without afterwards passing -std=c++0x, he
>> doesn't want to see in std:: anything having to do with
>> exception_ptr and more generally the C++0x features specified in
>> N2179...      
>> 
> That's understandable. However, my problem is simple: <exception>
> contains the definition of exception_ptr. Various source files of
> libsupc++ contain implementations of its members, as well as the three
> functions using it. These need to see the definition of exception_ptr.
> 
> I see three solutions:
> 1) Compile libsupc++ in experimental C++0x mode.
> 2) Add another symbol (or there may be an existing one) during the
> libsupc++ build that I can use as an alternate in making the
> definition visible, i.e.
> 
> #if defined(__GXX_EXPERIMENTAL_CXX0X__) ||
> defined(__GXX_BUILDING_LIBSUPCXX__)
> class exception_ptr ...
> 
> 3) Define my own symbol in the implementing source files, before
> including the relevant headers. However, while this solution is the
> least intrusive towards the whole of GCC, it doesn't appeal to me.

4)

Define __exception_ptr. Add

#ifdef __GXX_EXPERIMENTAL_CXX0X__
typedef __exception_ptr exception_ptr;
#endif

?



More information about the Libstdc++ mailing list