0

I am reading C++ 11 wikipedia page about new features and did not understand this part about type aliasing: https://en.wikipedia.org/wiki/C%2B%2B11#Template_aliases

The using syntax can be also used as type aliasing in C++11:

typedef void (*FunctionType)(double); // Old style
using FunctionType = void (*)(double); // New introduced syntax

What is type aliasing and what is it used for?

Community
  • 1
  • 1
arenard
  • 522
  • 4
  • 11

1 Answers1

0

The typedef keyword is used to create a new name for an existing type---that is, a type alias. Every type alias that can be formed using typedef can also be formed using the new alias-declaration syntax that starts with using. A type alias declared using an alias-declaration has exactly the same effect as one declared using typedef.

Brian Bi
  • 91,815
  • 8
  • 136
  • 249