[libcxx-commits] [PATCH] D58587: Implement P0433: deduction guides for <map>

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 29 09:06:45 PDT 2019


Quuxplusone marked 8 inline comments as done.
Quuxplusone added inline comments.


================
Comment at: include/map:2132
+multimap(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator())
+  -> multimap<typename _VSTD::remove_const<_Key>::type, _Tp, _Compare, _Allocator>;
+
----------------
mclow.lists wrote:
> You're very consistent here with qualifying `remove_const`, and nothing else. Why?
No reason. Removed.


================
Comment at: test/std/containers/associative/map/map.cons/deduct.pass.cpp:87
+    std::map<int, long> source;
+    std::map m(source, std::allocator<int>());
+    ASSERT_SAME_TYPE(decltype(m), decltype(source));
----------------
mclow.lists wrote:
> This works? I would think that it should not. We rebind the allocator internally into something else, but we should probably reject this. [But not in this patch]
This is me getting a jump start on [P1518 Stop overconstraining allocators in container deduction guides](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1518r0.html#overconst2).

Since

    std::map<int, long> m(source, std::allocator<int>());

works (without CTAD), Mike Spertus (as of February) and I believe that

    std::map m(source, std::allocator<int>());

should work //with// CTAD as well.


Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58587/new/

https://reviews.llvm.org/D58587





More information about the libcxx-commits mailing list