C++ ‘typedef’ vs. ‘using … = …’ [duplicate]

They are the same.

To quote the C++11 standard (or the draft to be specific):

A typedef-name can also be introduced by an alias-declaration. The identifier following the using keyword
becomes a typedef-name and the optional attribute-specifier-seq following the identifier appertains to that
typedef-name. It has the same semantics as if it were introduced by the typedef specifier. In particular, it
does not define a new type and it shall not appear in the type-id.

I think the “the same semantics as the typedef specifier” say it all.

Leave a Comment