Boost logo

Boost :

Subject: [boost] decltype and incomplete types (was: [config] vc10 and BOOST_NO_DECLTYPE)
From: Eric Niebler (eric_at_[hidden])
Date: 2010-04-06 23:50:28


On 4/6/2010 6:22 PM, Daniel Walker wrote:
> 7.1.6.2.4 states:
>
> "The type denoted by decltype(e) is defined as follows: ... if e is a
> function call (5.2.2) or an invocation of an overloaded operator
> (parentheses around e are ignored), decltype(e) is the return type of
> the statically chosen function;"
>
> 5.2.2.3 states:
>
> "The type of the function call expression is the return type of the
> statically chosen function (i.e., ignoring the virtual keyword), even
> if the type of the function actually called is different. This type
> shall be a complete object type, a reference type or the type void."
>
> So, it seems the draft requires compilers to reject code taking
> decltype of an incomplete type.

Ouch. The implication is that we can't sub the TR1 implementation of
result_of with the C++0x implementation without causing some valid code
to break. That's terrible. Let's hope this is just an oversight. I'm
following up with CWG.

In the mean time, what are the chances of backing out the decltype-based
implementation of boost::result_of completely (until we have a better plan)?

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk