
28 Mar
2012
28 Mar
'12
4:09 p.m.
On 3/28/2012 4:39 AM, Michel Morin wrote:
In the code below,
const int f(); decltype(f()) i = 0;
`i` has type `int` (not `const int`) in C++11. This is because `f()` is a prvalue of a non-class type (i.e. `const int`) and so its cv qualifiers are ignored.
C++0x drafts (before FDIS) had a special rule for function calls in decltype: if e is a function call or an invocation of an overloaded operator (parentheses around e are ignored), decltype(e) is the return type of the statically chosen function; but this was removed in FDIS. <snip>
That wording should still be FDIS. That's decltype v1.1 that Stephan was referring to in the other result_of thread you've discussed. -- Eric Niebler BoostPro Computing http://www.boostpro.com