หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
'enum' : forward declaration of enum type is not allowed
Remarks
The compiler no longer supports forward declaration of a managed enumeration.
Forward declaration of an enum type is not allowed under /Za.
Example
The following example generates C2599:
// C2599.cpp
// compile with: /clr /c
enum class Status; // C2599
enum class Status2 { stop2, hold2, go2};
ref struct MyStruct {
// Delete the following line to resolve.
Status m_status;
Status2 m_status2; // OK
};
enum class Status { stop, hold, go };