Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Use the /await compiler option to enable compiler support for coroutines.
Note
The /await option is deprecated starting with Visual Studio 2026 and will be removed in a future release. Standard C++ coroutines are available by default in C++20 or later. Or use /await:strict option when using earlier versions of the C++ language.
Syntax
/await
/await:strict
Remarks
The /await compiler option enables compiler support for C++ coroutines and the keywords co_await, co_yield, and co_return. This option is off by default. For information about support for coroutines in Visual Studio, see the Visual Studio Team Blog. For more information about the coroutines standard proposal, see N4628 Working Draft, Technical Specification for C++ Extensions for Coroutines.
The /await option is available beginning in Visual Studio 2015 and is deprecated starting with Visual Studio 2026.
Starting in Visual Studio 2019 version 16.10, the /await:strict option can be used in place of /await. The option provides C++20-compatible coroutine support in projects that build in C++14 or C++17 mode. In /await:strict mode, library support is provided in <coroutine> and in the std namespace.
The /await:strict option disables language extensions present in /await that weren't adopted into the C++20 standard. Use of such features results in a compiler error. The option also implements coroutine behaviors such as promise parameter preview. These behaviors aren't available under /await because of binary compatibility issues in older versions of Visual Studio.
Note
Coroutine state objects obtained from coroutine_handle<T>::address() aren't compatible between /await and /await:strict modes. Use of coroutine_handle<T>::from_address() on an address obtained from a coroutine handle created by code compiled in an incompatible mode results in undefined behavior.
To set this compiler option in the Visual Studio development environment
Open your project's Property Pages dialog box.
Select the Configuration Properties > C/C++ > Command Line property page.
Enter the
/awaitor/await:strictcompiler option in the Additional Options box. Choose OK or Apply to save your changes.
To set this compiler option programmatically
- See AdditionalOptions.