다음을 통해 공유


컴파일러 오류 C3541

'형식': typeid는 'auto'를 포함하는 형식에 적용할 수 없습니다.

지정된 형식에는 auto 지정자가 있기 때문에 typeid 연산자를 적용할 수 없습니다.

예제

다음 예제에서는 C3541이 발생합니다.

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

참고 항목

참조

auto Keyword

/Zc:auto(변수 형식 추론)

typeid