C++ – meaning of a statement combining typedef and typename [duplicate]

typedef is defining a new type for use in your code, like a shorthand.

typedef typename _MyBase::value_type value_type;
value_type v;
//use v

typename here is letting the compiler know that value_type is a type and not a static member of _MyBase.

the :: is the scope of the type. It is kind of like “is in” so value_type “is in” _MyBase. or can also be thought of as contains.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)