Bagikan melalui


Compiler Error C3541

'type': typeid tidak dapat diterapkan ke tipe yang berisi 'auto'

Operator typeid tidak dapat diterapkan ke tipe yang ditunjukkan karena berisi penentu auto .

Contoh

Contoh berikut menghasilkan C3541.

// C3541.cpp
// Compile with /Zc:auto
#include <typeinfo>
int main() {
    auto x = 123;
    typeid(x);    // OK
    typeid(auto); // C3541
    return 0;
}

Baca juga

kata kunci otomatis
/Zc:auto (Deduce Variable Type)
typeid