Kompilatorfel C2154

"type": endast uppräkningstyp tillåts som ett argument för kompilatorns inbyggda typdrag "__underlying_type"

Anmärkningar

Du kan bara hämta den underliggande typen av en uppräkningstyp .

Example

I följande exempel genereras 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

Se även

underlying_type klass