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,438
  • 68
  • 55
  • 126
byrass
  • 350
  • 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,388
  • 1
  • 12
  • 25