Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is std::future::then() and the concurrency TS?

Tags:

c++

c++20

When seaching for std::future::then on google, the top result is a stackoverflow question about the status of the function in c++17. Now that c++20 has been finalized and Clang and GCC is well into implementing c++20, I am left wondering what is the status of the function and the Concurrency TS generally?

It isn't mentioned on the implementation status page of libc++, libstdc++ or the implementation status page maintained by cppreference), and the TS page on cppreference doesn't say anything about current status.

I have also tried running some very simple examples on Godbolt, but neither are able to find <experimental/future>, and not because it has been moved to the <future> header (neither can find future::then.

Additionally, the internet has not been especially helpful. At least I can only find blog posts from 1-2 years ago talking about "hoping" to get the Concurrency TS in c++20, but cannot find any mentions in numerous overviews of new c++ 20 features (a few examples.

Has the Concurrency TS been dropped?

like image 433
Rasmus Damgaard Nielsen Avatar asked Aug 11 '20 14:08

Rasmus Damgaard Nielsen


Video Answer


1 Answers

Has the Concurrency TS been dropped?

Yes.

P1445 discusses this, SG1 voted to withdraw the TS. Note that atomic smart pointers, latches, and barriers are in C++20.

As far as improving future goes, the direction there is called executors and the design currently being iterated on is P0443, which allows for lazy composition of work in a way that would be much more efficient than future::then. Two of the authors gave a talk on this at CppCon that goes into the issues pretty well.

like image 109
Barry Avatar answered Oct 05 '22 05:10

Barry