In "The C++ Standard Library" Josuttis gives this example(on p.11):
He says that without the typename keyword, SubType would be considered a static member. Ok, that seems to make some sense because a static member can be referenced like this:
template <class T>
typename T::SubType * ptr;
He continues his explanation by saying:
#include <iostream> //cout
using namespace std;
class Box //T = Box
static int SubType;
//intialize static data member:
int Box::SubType = 4;
I don't understand why he says that SubType is a value of type T? It seems to me that when you write
T::SubType * ptr;
would be a multiplication of value SubType of type T with ptr.
that only says that SubType is a static member of T, and it doesn't speak to the type of SubType at all. In my example above, the statement:
does not say that SubType is of type Box. It just says to go look in the Box class for a static member variable called SubType. The type of SubType is actually int.