3
#include <vector>

template<class T>
using vec = std::vector<T>;

int main()
{
    std::vector a{2,3};
    // vec b{2,3}; // not going to work
}

Are we still forced to use macros? There are so many disadvantages in using them...

Hrisip
  • 900
  • 4
  • 13

1 Answers1

4

This is a known problem with CTAD that has been fixed in C++20

Are we still forced to use macros?

No. I'd recommend using std::vector if you want CTAD

Guillaume Racicot
  • 39,621
  • 9
  • 77
  • 141