Review Request: C++-Parser: Eat typename
Esben Mose Hansen
kde at mosehansen.dk
Thu May 6 07:47:47 UTC 2010
On Wednesday 05 May 2010 14:34:52 David Nolden wrote:
> Currently we simply have no use for the "typename" keyword. At some point I
> have to check out in the language specification why it is needed
> sometimes, but I think that KDevelop understands such cases even without
> it.
It is mostly the "dependent type" problem, that is, when the type is not
available until instantiation. E.g.
struct A {
typedef int cheese;
};
template<typename T>
struct B {
typedef typename T::cheese stelton;
};
I had a book once that showed an example where not requiring the keyword could
lead to the compiler picking the wrong definition of something, but I can't
remember it offhand, and the book disappeared some time ago.
--
Kind regards, Esben
More information about the KDevelop-devel
mailing list