#define vs typedef vs using for type alias

  alias, c++, typedef, using

In C++, what is the preferred way to define type alias?

#define intAliasType int
typedef int intAliasType
using intAliasType = int;

I heard that you shouldn’t use #define, and typedef is discouraged in C++, so I should use using. But is that true?

Source: Windows Questions C++

LEAVE A COMMENT