Std::experimental::pmr maturity

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.

Yes, libstdc++'s std::expected isn’t supported on Clang for the same reason. I’m not going to jump through hoops to implement a C++23 library feature without using C++20 language features, so it’s gated by:

#if __cplusplus > 202002L && __cpp_concepts >= 202002L

Thanks for the invitation and thank you for your contribution! I’ve been following the development recently and trying to understand what’s going on in the development process.
I’m lucky to work on production code limited by just what Xcode is providing.

I think P0848 is resolved https://github.com/llvm/llvm-project/commit/21eb1af469c3257606aec2270d544e0e8ecf77b2

I noticed that microsoft’s implementation is using deducing this and I wonder if it is a convenience feature or a requirement too.

Interesting stuff.

Well ⚙ D128619 [Clang] Implement P0848 (Conditionally Trivial Special Member Functions) I was too rush.

For std::expected? It’s just a convenience, so you don’t have to define four overloads of value() and error().

FWIW, we’re no longer using explicit object member functions for std::expected; STL couldn’t stomach the necessary C-style cast without which the feature is not fit for purpose.

I found that in libc++, std::pmr::monotonic_buffer_resource is not implemented yet. Am I correct?

Yes, that’s correct.

1 Like

Then, they will be kept in the experimental namespace for a while.

I thought the ::pmr will come out soon from the experimental, am I correct, in the 16 or 17 time frame?

I’ll try to get it into 16. No guarantees though.

1 Like

I am just curious. What is the status of this feature after the mono header patch was merged?
I couldn’t see any annotations as being - done and ready.

I’ve got a TODO list, but it’s largely complete. Checking which papers are completed by the patch is one of the things on my TODO list.

1 Like