Re: [cxx-abi-dev] Proposed ABI changes for new C++0x SFINAE rules
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cxx-abi-dev] Proposed ABI changes for new C++0x SFINAE rules
- To: David Vandevoorde <daveed@xxxxxxx>
- Subject: Re: [cxx-abi-dev] Proposed ABI changes for new C++0x SFINAE rules
- From: Jason Merrill <jason@xxxxxxxxxx>
- Date: Thu, 16 Sep 2010 13:10:56 -0400
On 09/16/2010 09:55 AM, David Vandevoorde wrote:
I guess that means the compiler needs to track both the full expression and its constant value, and so on through array types and template-ids that use them.
I'm not sure I understand this point. Mostly (for this purpose), the compiler has to track the "instantiation-dependent" property for the expression.
Say you have
template <int I>
struct A;
template <> struct A<sizeof(size_t)>
{
typedef size_t type;
};
template <class T>
void f (A<sizeof(sizeof(T))>::type);
--------------
The compiler needs to recognize that A<sizeof(sizeof(T))> is not a
dependent type, so we need to treat it as A<8> and not require typename
to name the nested type. But for substitution we need to treat it as
A<sizeof(sizeof(T))>.
Jason