You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
helpviewer_keywords: ["/await enable coroutine support [C++]", "-await enable coroutine support [C++]", "await enable coroutine support [C++]"]
7
7
ms.assetid: 302c8e69-09b6-4c58-bcdd-0a6a8713a8df
8
8
---
9
-
# /await (Enable coroutine support)
9
+
# `/await` (Enable coroutine support)
10
10
11
-
Use the **/await** compiler option to enable compiler support for coroutines.
11
+
Use the **`/await`** compiler option to enable compiler support for coroutines.
12
12
13
13
## Syntax
14
14
15
-
> /await
15
+
> **`/await`**\
16
+
> **`/await:strict`**
16
17
17
18
## Remarks
18
19
19
-
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](https://devblogs.microsoft.com/cppblog/category/coroutine/). For more information about the coroutines standard proposal, see [N4628 Working Draft, Technical Specification for C++ Extensions for Coroutines](https://wg21.link/n4628).
20
+
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](https://devblogs.microsoft.com/cppblog/category/coroutine/). For more information about the coroutines standard proposal, see [N4628 Working Draft, Technical Specification for C++ Extensions for Coroutines](https://wg21.link/n4628).
20
21
21
-
The **/await** option is available beginning in Visual Studio 2015.
22
+
The **`/await`** option is available beginning in Visual Studio 2015.
23
+
24
+
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.
25
+
26
+
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.
27
+
28
+
> [!NOTE]
29
+
> 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.
22
30
23
31
### To set this compiler option in the Visual Studio development environment
24
32
25
33
1. Open your project's **Property Pages** dialog box.
0 commit comments