|
Boost : |
Subject: Re: [boost] [Config] Patch: clang implemented N3276 decltype
From: Daniel Walker (daniel.j.walker_at_[hidden])
Date: 2012-03-07 00:28:06
On Mar 6, 2012, at 11:59 PM, Eric Niebler wrote:
> On 3/6/2012 8:45 PM, Daniel Walker wrote:
>> On Mar 6, 2012, at 11:09 PM, Eric Niebler wrote:
>>
>>> On 3/6/2012 6:27 PM, Daniel Walker wrote:
>>>> On Mar 6, 2012, at 9:04 PM, Eric Niebler wrote:
>>>>> On 3/6/2012 5:10 PM, Michel Morin wrote:
>>>>>> BTW, BOOST_NO_DECLTYPE_N3276 needs to be a more descriptive name?
>>>>>
>>>>> I couldn't think of a better name, and
>>>>> BOOST_NO_DECLTYPE_ON_FUNCTION_CALL_EXPRESSION_FORCES_TYPE_COMPLETENESS
>>>>> is too long.
>>>>>
>>>>> :-P
>>>>
>>>> How about BOOST_NO_INCOMPLETE_DECLTYPE?
>>>
>>> Ambiguous. Does that mean that decltype support is incomplete or that
>>> decltype doesn't force type-completeness?
>>
>> BOOST_NO_INCOMPLETE_DECLTYPE means the compiler does not support incomplete decltypes; i.e. it does not support decltype expressions that are incomplete types.
>
> But that's not the issue. The issue is this:
>
> template<typename T> struct S {};
> template<typename T> S<T> fun(T) {}
> typedef decltype(fun(0)) Si_t; // HERE
>
> Does the third line force the instantiation of S<int>?
>
> Decltype works just fine on incomplete types in the simple case, so far
> as I know:
>
> struct S;
> extern S s;
> typedef decltype(s) S_t; // OK
>
Oh yeah, I forgot this only comes up with call expressions. How about BOOST_NO_INCOMPLETE_DECLTYPE_CALL_EXPRESSIONS? The macro means the compiler does not support incomplete decltypes of call expressions.
- Daniel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk