หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
'type': only enumeration type is allowed as an argument to compiler intrinsic type trait '__underlying_type'
Remarks
You can only get the underlying type of an enumeration type.
Example
The following example generates C2154:
// C2154.cpp
// compile with: /c
struct S {};
enum E {};
enum class EC {};
__underlying_type(S) s; // C2154
__underlying_type(int) i; // C2154
__underlying_type(E) e; // OK
__underlying_type(EC) ec; // OK