std::experimental features

May 20, 2020 at 9:02pm
Regarding the features of the technical specifications (in the std::experimental namespace), are they stable enough to be used in actual programs? Or can they break? There are certain features of the Concurrency TS that I would like to use in my program but I'm not sure if I should use anything in this namespace.

The name is "experimental" so I'm not sure if that means it is unstable or if it just means that it is not an official part of the standard, but I shouldn't have problems using it in my code.
Last edited on May 20, 2020 at 9:02pm
May 20, 2020 at 9:18pm
The name is "experimental" so I'm not sure if that means it is unstable or if it just means that it is not an official part of the standard
It means both. They're provided by the library developer as just a preview. You can use them if you don't mind having to change your code in the future.
If you still want to use it but more some more stability, you can usually find an external library that implements that feature in a frozen state, often in Boost. For example, I've been using Boost.Coroutine for years.
May 20, 2020 at 10:29pm
And is it up to vendors which features of the TS they provide? I use gcc and I can't find experimental/latch or exerimental/future in the files.
May 21, 2020 at 12:54am
Well, that's true even for stuff that's in std::, particularly on weird platforms. But it's even more true for std::experimental::.
May 21, 2020 at 1:11am
I use gcc and I can't find experimental/latch or exerimental/future in the files.

It could also be a matter of "when", what version of the compiler are you using? If you intend on using C++20 features you should probably be using the latest version of gcc (gcc-10.1.0).

May 21, 2020 at 1:13am
I have gcc 10 currently (the latest version). Still no experimental/latch or experimental/future. Though I assume these will be there in later updates (not the experimental version but the regular version for C++20).
Topic archived. No new replies allowed.