C++ Language/Type/Shortcuts/TemplatedTypedef

From Wikibooks, open books for an open world
Jump to navigation Jump to search

A "type alias" lets you use a new name for an existing type.

Traditionally, this was programmed as typedef int INTEGER_VIA_TYPEDEF;.

In modern C++, this is programmed as using INTEGER_VIA_USING = int;. Only the modern syntax can be templated.

Additional information about type aliases (includes interactive examples)