[libcxx-commits] [PATCH] D112510: [libc++] P0433R2: add the remaining deduction guides.

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 25 21:03:17 PDT 2021


var-const created this revision.
var-const requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Add deduction guides to `valarray` and `scoped_allocator_adaptor`. This
largely finishes implementation of the paper:

- deduction guides for other classes mentioned in the paper were implemented previously (see the list below);
- deduction guides for several classes contained in the proposal (`reference_wrapper`, `lock_guard`, `scoped_lock`, `unique_lock`, `shared_lock`) were removed by LWG2981 <https://wg21.link/LWG2981>.

The only part of the paper that isn't fully implemented in this patch is
making sure certain deduction guides don't participate in overload
resolution when given incorrect template parameters.

List of significant commits implementing the other parts of P0433 (omitting some minor fixes):

- pair <https://github.com/llvm/llvm-project/commit/af65856eec160d163c764faad250d93357be7c83>
- basic_string <https://github.com/llvm/llvm-project/commit/6d9f750dec29e8ae5366092e64cd343dae2c7464>
- array <https://github.com/llvm/llvm-project/commit/0ca8c0895c6034615593c295dd955f29b25bf3d4>
- deque <https://github.com/llvm/llvm-project/commit/dbb6f8a8179b0604e25707b5c1b72be6164f62d9>
- forward_list <https://github.com/llvm/llvm-project/commit/e076700b7786959206acef136ecf05d54078e4e1>
- list <https://github.com/llvm/llvm-project/commit/4a227e582b2f13880ea049b29988a37a0f7c0742>
- vector <https://github.com/llvm/llvm-project/commit/df8f75479278d5ce16eede342ceb5ba2fd71460b>
- queue/stack/priority_queue <https://github.com/llvm/llvm-project/commit/5b8b8b5dce587f1e5a4a31cc24f09b18bd53ff9a>
- basic_regex <https://github.com/llvm/llvm-project/commit/edd5e29cfe9f67ec8e7e0eda12eb05e616fdeebc>
- optional <https://github.com/llvm/llvm-project/commit/f35b4bc3954f3b01051fc0848535ff784809e9e2>
- map/multimap <https://github.com/llvm/llvm-project/commit/edfe8525de1f7278f4754f2bffd47b13ec291a17>
- set/multiset <https://github.com/llvm/llvm-project/commit/e20865c387e09ea0ebd5add15c762cd5271ff65f>
- unordered_set/unordered_multiset <https://github.com/llvm/llvm-project/commit/296a80102a9b72c3eda80558fb78a3ed8849b341>
- unordered_map/unordered_multimap <https://github.com/llvm/llvm-project/commit/dfcd4384cbcac0eeb7e5cbce350f875ba4da79d5>
- function <https://github.com/llvm/llvm-project/commit/e1eabcdfad89f67ae575b0c86aa4a72d277378b4>
- tuple <https://github.com/llvm/llvm-project/commit/1308011e1b5c5382281a63dd4191a1784f8d2295>
- shared_ptr/weak_ptr <https://github.com/llvm/llvm-project/commit/83564056d4b186c9fcf016cdbb388755009f7b5a>

Additional notes:

- It was revision 2 of the paper that was voted into the Standard. P0433R3 is a separate paper that is not part of the Standard.
- The paper also mandates removing several `make_*_searcher` functions (e.g. make_boyer_moore_searcher) which are currently not implemented (except in `experimental/`).
- The `__cpp_lib_deduction_guides` feature test macro from the paper was accidentally omitted from the Standard.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112510

Files:
  libcxx/docs/Status/Cxx17.rst
  libcxx/docs/Status/Cxx20Issues.csv
  libcxx/include/scoped_allocator
  libcxx/include/utility
  libcxx/include/valarray
  libcxx/test/std/numerics/numarray/template.valarray/valarray.cons/deduct.pass.cpp
  libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.fail.cpp
  libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
  libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/deduct.pass.cpp
  libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112510.382180.patch
Type: text/x-patch
Size: 11826 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211026/e4fe1c01/attachment-0001.bin>


More information about the libcxx-commits mailing list