Kompilatorfel C3537

"type": du kan inte casta till en typ som innehåller "auto"

Anmärkningar

Det går inte att omvandla en variabel till den angivna typen eftersom typen innehåller nyckelordet auto och standardalternativet /Zc:auto compiler är i kraft.

Example

Följande kod ger C3537 eftersom variablerna omvandlas till en typ som innehåller nyckelordet auto .

// C3537.cpp
// Compile with /Zc:auto
int main()
{
   int value = 123;
   auto(value);                        // C3537
   (auto)value;                        // C3537
   auto x1 = auto(value);              // C3537
   auto x2 = (auto)value;              // C3537
   auto x3 = static_cast<auto>(value); // C3537
   return 0;
}

Se även

automatiskt nyckelord