Why do type aliases in C++ use ‘using’ instead of ‘typedef’ in their syntax?

Here is what Bjarne Stroustrup says about why they introduced using instead of extending typedef: The keyword using is used to get a linear notation “name followed by what it refers to.” We tried with the conventional and convoluted typedef solution, but never managed to get a complete and coherent solution until we settled on …

Read more

What is the difference between ‘typedef’ and ‘using’?

They are equivalent, from the standard (emphasis mine) (7.1.3.2): 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 …

Read more