This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: patch: <bits/localefwd.h> with -fno-exceptions


>>>>> "Ross" == Ross Smith <ross.s@ihug.co.nz> writes:

    Ross> Mark Mitchell wrote:
    >>  There are other approaches.  For example,
    >> 
    >> #if NO_EXCEPTIONS #define try if (true) #define catch(x) if
    >> (false) #endif
    >> 
    >> This works because try and catch blocks are always enclosed in
    >> braces.

    Ross> Why bother with the "if (true)"? If you simply "#define try"
    Ross> (i.e. try
    -> empty string), the try block becomes a plain brace-enclosed
    -> block,
    Ross> which should DTRT.

Sure -- I was just matching the transformation Ben suggested the
compiler do.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]