//A.h
class A;
//A.cpp
#include A.h
class MyA {};
using A = MyA; // error C2371 'A' : redefinition; different basic types
A lot of legacy code uses the class name A
.
I want new code to use the name MyA
, without breaking existing code.
However, when I try to do so, I get the error C2371: 'A': redefinition; different basic types
//A.h
class MyA;
using A = MyA;
//A.cpp
#include A.h
class MyA {};
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.