[PATCH] D47090: Implement C++17 <memory_resource>.

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 18 17:07:16 PDT 2018


Quuxplusone added a comment.

> I would prefer if we completed <experimental/memory_resource> (according to the current standard, not the LFTS spec), and then moved it.
>  Would you be willing to do that instead?

Let me see if I understand. libc++'s `<experimental/memory_resource>` differs from C++17 `<memory_resource>` in at least these ways:
(A) It's missing `monotonic_buffer_resource` and `{un,}synchronized_pool_resource`
(B) It's got different semantics around uses-allocator construction because of https://wg21.link/lwg2969
(C) It's got a different header name

This patch is basically proposing to fix things in the order C-A-B (and fix C by making copies of everything); you're proposing to fix things in the order A-B-C (and fix C by moving everything).

I have no objection to fixing A in `<experimental/memory_resource>` if people think that'd be useful. I didn't do that in this patch simply because I'd observed other `<experimental/*>` headers already getting replaced with `#error` messages, and it seemed like any further work on the `<experimental/*>` headers would have been wasted.

I don't know who's using `<experimental/memory_resource>` today, but in theory I worry that fixing B in `<experimental/memory_resource>` (before doing C) might actually break someone's code.

Philosophically as I understand it LWG2969 was a patch against C++17, not a patch against the TS. If LWG2969 (and incidentally I asked lwgchair to open a new issue for https://github.com/Quuxplusone/libcxx/commit/54e1a59a ) are actually supposed to be patches against *both* C++17 *and* the TS, then cool, yeah, we should fix B in `<experimental/memory_resource>`. Thoughts?


Repository:
  rCXX libc++

https://reviews.llvm.org/D47090





More information about the cfe-commits mailing list