[libcxx-commits] [PATCH] D64752: Implement deduction guides for std::function (P0433).

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 15 09:15:55 PDT 2019


Quuxplusone created this revision.
Quuxplusone added reviewers: ldionne, mclow.lists.
Herald added subscribers: libcxx-commits, dexonsmith.

P0433 (adopted in C++17) added two deduction guides for `std::function`.
This patch implements those deduction guides in libc++.

`__function_ctad<_Tp>` is really tedious. It could be simplified by:

- using macros to generate the 2x2x2x2 = 16 partial specializations (MSVC does this)
- using `noexcept(_Np)` to deduce the noexcept-specification, reducing the number of partial specializations by half (libstdc++ does this)
- completely ignoring the possibility of `volatile`-qualified `operator()` overloads, reducing the number of partial specializations by half (libstdc++ does this)
- deciding that it would be easier to ask LWG to revert this whole part of P0433, than bother to implement it


Repository:
  rCXX libc++

https://reviews.llvm.org/D64752

Files:
  include/functional
  test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct.fail.cpp
  test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64752.209872.patch
Type: text/x-patch
Size: 8161 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190715/b65160f5/attachment.bin>


More information about the libcxx-commits mailing list