ki******@gmail.com wrote:
Victor Bazarov wrote:
>I can tell you the Comeau online trial compiler says it's
because "declaration is incompatible with constant
"C::Type *A" (declared at line 5)"
Thanks. But I don't see the difference between these two variants.
(typeid(typename T<C>::pType) == typeid(typename C::Type*)) returns
true. Moreover struct D parametrized using pType not C::Type*.
I was curious about that as well. I don't have the exact answer, for
you though. My best guess is that by the time you try using the
'T<C>::pType' the T<Chasn't been instantitated yet. It would cause
an instantiation but does not until you actually instantiate the 'Val'
member in 'D', and then the compiler probably gets lost trying to
resolve what 'pType' is supposed to be. The difference with the 'Val'
declaration itself is that here you're trying to use it as a template
argument.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask