区分C++ 11原始类型名称和typedef-name?

And*_*zos 7 c++ c++11

无论如何要区分类型的原始名称和该类型的typedef-name?

例如:

class C1 {};

typedef C1 C2;
Run Code Online (Sandbox Code Playgroud)

C1和C2现在都命名相同的类型.在上述代码之后的代码中,是否有一种情况是,参考所讨论的类型的名称C1的出现不能用C2替换(反之亦然)?

Dav*_*eas 5

A typedef creates an alias, and they are indistinguishable as a type. There are on the other hand some specific syntax constructs that require the real type and not the typedef-ed (declaration/definition of constructor/destructors...), but that is a different question. As a type they are indistinguishable.


Bat*_*eba 3

它们在以下方面完全typedef无法区分。