In the C ++ header file, I see this code:
typedef typename _Mybase::value_type value_type;
Now, as I understand it, a quote from Schildt’s “C ++ Complete Reference”. typename can be replaced by a class of keywords, the second use of typename is to tell the compiler that the name used in the template declaration is a type name, not an object name.
Similarly, you can define new data type names using the typedef keyword. You're not actually creating a new data type, but rather defining a new name for an existing type.
However, can you explain exactly what the above line of code means, where typedef and typename combined together. And what does " :: " mean in a statement?
c ++ typedef typename
Arvind Aug 22 '13 at 15:56 2013-08-22 15:56
source share