[all-commits] [llvm/llvm-project] dd15c2: [libc++] [P1518R2] Better CTAD behavior for contai...

Quuxplusone via All-commits all-commits at lists.llvm.org
Fri Jun 18 12:55:51 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dd15c2723cd29574c341ec189409a6c83fbefb04
      https://github.com/llvm/llvm-project/commit/dd15c2723cd29574c341ec189409a6c83fbefb04
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2021-06-18 (Fri, 18 Jun 2021)

  Changed paths:
    M libcxx/docs/Cxx2bStatusPaperStatus.csv
    M libcxx/include/deque
    M libcxx/include/forward_list
    M libcxx/include/list
    M libcxx/include/queue
    M libcxx/include/stack
    M libcxx/include/vector
    M libcxx/test/std/containers/associative/map/map.cons/deduct.pass.cpp
    M libcxx/test/std/containers/associative/multimap/multimap.cons/deduct.pass.cpp
    M libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp
    M libcxx/test/std/containers/container.adaptors/queue/queue.cons/deduct.pass.cpp
    M libcxx/test/std/containers/container.adaptors/stack/stack.cons/deduct.pass.cpp
    M libcxx/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp
    M libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.pass.cpp
    M libcxx/test/std/containers/sequences/list/list.cons/deduct.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp
    M libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct.pass.cpp
    M libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct.pass.cpp

  Log Message:
  -----------
  [libc++] [P1518R2] Better CTAD behavior for containers with allocators.

P1518 does the following in C++23 but we'll just do it in C++17 as well:
- Stop requiring `Alloc` to be an allocator on some container-adaptor deduction guides
- Stop deducing from `Allocator` on some sequence container constructors
- Stop deducing from `Allocator` on some other container constructors (libc++ already did this)

The affected constructors are the "allocator-extended" versions of
constructors where the non-allocator arguments are already sufficient
to deduce the allocator type. For example,

    std::pmr::vector<int> v1;
    std::vector v2(v1, std::pmr::new_delete_resource());
    std::stack s2(v1, std::pmr::new_delete_resource());

Differential Revision: https://reviews.llvm.org/D97742




More information about the All-commits mailing list