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



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