Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
a 'new expression' whose type contains 'auto' must have an initializer
If a new expression is used with the auto keyword and the default /Zc:auto compiler option, the new expression must specify an initializer.
To correct this error
- Specify an initializer expression for the new operator.
Example
The following example demonstrates C3534. The first declaration does not yield an error because it has a direct initializer (0) whose type is int. The second declaration yields an error because it does not have an initializer. In the third declaration, the second use of the auto keyword yields an error because the new operator does not have an initializer.
// C3534.cpp
// Compile with /Zc:auto
int main()
{
new auto(0);
new auto(); // C3534
auto x = new auto(); // C3534
return 0;
}