Std::experimental::pmr maturity

Hi,
While GCC makes it non-experimental for some time when will libc++ start moving it to non-experimental? Also, I am wondering whether it is mature enough for application development.

1 Like

We are working on it (see https://llvm.org/D89057). Maybe we will get it done in the LLVM15 time frame. I’m quite confident that we will have it in LLVM16 if we don’t get it in LLVM15. We don’t provide many guarantees for the experimental features, so you probably shouldn’t use them in production. (i.e. neither API nor ABI stability are guaranteed)

2 Likes

I’m sorry if this is a silly question but isn’t the API particularly guaranteed by the C++ standard?

Only the API in the std namespace is guaranteed by the standard. Everything inside std::experimental is part of an IS. The IS may change the API and there might be differences between the API inside std and std::experimental. I don’t think there are any differences between the two in this case, but I don’t know.

Do you mean TS?

I don’t think there are any differences between the two in this case, but I don’t know.

There is no std::resource_adaptor in C++17, and std::polymorphic_allocator has some new members added in C++20 and a default template argument, which were not present in std::experimental::polymorphic_allocator.

Do you mean TS?

Oops, yes that’s what I meant.

There is no std::resource_adaptor in C++17, and std::polymorphic_allocator has some new members added in C++20 and a default template argument, which were not present in std::experimental::polymorphic_allocator .

Interesting, I didn’t know that. Thanks!

I really want to see this feature sooner. I wonder how usable the experimental version would be for prototyping.

On the other hand for production there are a bunch of C++20/23 features which are way more important to me to see in Xcode as soon as possible - ranges, coro, expected. Especially that Xcode doesn’t get the latest Clang feautures quickly.
I saw somewhere that there was a plan to replace Apple Clang in Xcode with upstream LLVM but there isn’t any news since then.

Is there a roadmap for LLVM 15, 16? Thanks for your work!

No, there is no roadmap. Most of the work on libc++ is voluntary, so it’s mostly what people feel like implementing. If you want to get the features earlier feel free to contribute a few patches :slight_smile:. For std::pmr you’ll have to wait a bit longer. It’s just really large.

As @philnik said there’s no roadmap. The team working on libc++ is quite small so it will take some time for us to implement all C++20/C++23 features.

Coro should be done.
Ranges is being worked on, but it’s large so it will take some time before it’s done.
I’m not aware of anybody working on std::expected, but that’s been voted in quite recently. (It might even make sense to wait for the P2505: Monadic Functions for std::expected to land before starting to implement it.)

Of course you’re welcome to aid us and implement things in libc++ you care about.

For std::expected I’ve actually got ⚙ D124516 [libc++][WIP] Implement P0323R12 (expected), but the implementation doesn’t work properly because clang doesn’t support Conditionally Trivial Special Member Functions currently and I think it’s a lot more work to implement all of them in base classes (and a lot uglier) than it’s worth.

I missed that review. If waiting for Clang results in cleaner code I prefer to wait for Clang support.