Alias declaration with usingsuggest change
The syntax of
using is very simple: the name to be defined goes on the left hand side, and the definition goes on the right hand side. No need to scan to see where the name is.
using I = int; using A = int; // array of 100 ints using FP = void(*)(int); // pointer to function of int returning void using MP = void (Foo::*)(int); // pointer to member function of Foo of int returning void
Creating a type alias with
using has exactly the same effect as creating a type alias with
typedef. It is simply an alternative syntax for accomplishing the same thing.
using can be templated. A “template typedef” created with
using is called an alias template.
Found a mistake? Have a question or improvement idea? Let me know.
Table Of Contents