Do all C ++ compilers support async / await keywords?

I want to use async/await syntax in C ++ (UE4 framework), but due to cross-platform code, I'm not sure if this is possible ... Or is it possible? If so, how can I use it?

And also there are await and __await ( resumable , yield and __yield_value ) keywords highlighted in Visual Studio. Who cares? Maybe not all compilers support these keywords or support separately?

gcc , clang agree? Or it doesn’t accept, and I can just use the macros for each platform individually.

+5
source share
1 answer

async and await are language extensions offered by Microsoft with several versions, but the current N4134 . This is not yet accepted in the standard.

The proposal is opposed to many, for example http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0158r0.html due to the fact that it is not completely baked and has not been fully studied in TS, and there are competing offers, such as N3985 , which offers coroutines that can be implemented within the existing language standard.

As far as I know, the only compiler that actually supports async / await is MS Visual Studio.

As an update, clang 5.0 supports the current proposal of the draft joint application https://isocpp.org/files/papers/N4663.pdf , which is now accepted as TS and is advancing with an eye to the C ++ 20 standard.

+14
source

All Articles