0

I've recently come across:

using vi = vector<int>;
using mvi = map<vi, int>;

Is it equivalent to #define? Is it correct to use this?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
byrass
  • 360
  • 2
  • 12

1 Answers1

2

This particular form has the same functionality as typedef. See this post for a good explanation of the using keyword: What is the logic behind the "using" keyword in C++?

Also, it is not the same as #define. That is a pre-processor macro.

Community
  • 1
  • 1
Anton
  • 1,458
  • 1
  • 14
  • 28