From: Sid Sacek (ssacek_at_[hidden])
Date: 2007-11-10 07:28:28
Microsoft compiler doesn't fully support "Exception Specifications". The details are below. If you use this feature, it will not be
This is from MSDN:
Visual C++ departs from the ANSI Standard in its implementation of exception specifications. The following table summarizes the
Visual C++ implementation of exception specifications:
Exception specification Meaning
The function does not throw an exception. However, if an exception is thrown out of a function marked throw(), the Visual C++
compiler will not call unexpected (see unexpected (CRT) and unexpected (<exception>) for more information). If a function is marked
with throw(), the Visual C++ compiler will assume that the function does not throw C++ exceptions and generated code accordingly.
Due to code optimizations that maybe performed by the C++ compiler (based on the assumption that the function does not throw any C++
exceptions) if function does throw an exception, the program may not execute correctly.
The function can throw an exception.
The function can throw an exception of type type. However, in Visual C++ .NET, this is interpreted as throw(...). See Function
From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of Sergey Shandar
Sent: Saturday, November 10, 2007 7:19 AM
Subject: Re: [boost] Is there any interest in a casting library where you don't need to specify a type of receiver?
> Sergey Shandar wrote:
>> 3. I found this one today:
>> template<class T>
>> operator T &() const
>> throw(typename ::boost::disable_if< ::boost::is_same<T, MyClass
>> const> >::type *)
> You've solved the millenium problem! :-)
> gcc3.4.5 and 4.1.2 seem to work fine.
Right, here is the new problem: If you specify at least one throw type
(we do) then you have to specify all possible exceptions for the function!
operator T &() const
throw(typename ::boost::disable_if< ::boost::is_same<T, MyClass const> >::type *)
throw( what else? )
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk