|
|
|
|
|
by haberman
6147 days ago
|
|
It's not about making compiler implementations easier -- it's about protecting template authors against having someone write: class MyBadClass {
static int bar;
};
foo<MyBadClass> y;
By writing "typename", the template author can indicate that "T::bar" the template author can indicate that "bar" is expected to be a type, not a variable. This is explained in more detail here: http://pages.cs.wisc.edu/~driscoll/typename.html. |
|