[libcxx-commits] [PATCH] D103371: [libc++] Avoid `result_type` and `unary/binary_function` in <valarray>

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 29 14:12:22 PDT 2021


Quuxplusone created this revision.
Quuxplusone added reviewers: ldionne, Wmbat, zoecarver, libc++.
Quuxplusone added a project: libc++.
Quuxplusone requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.

Give each of the relevant functional operators a `__result_type` instead, so that we can keep using those typedefs in <valarray> even when the public binder typedefs are removed in C++20.

This is a bit of a hacky lazy way to eliminate valarray's dependency on `{unary,binary}_function`, but it kinda seems like all of valarray is a hack and so maybe this fits right in? ;)
I would be //willing// to spend some time trying to recast all this metaprogramming in terms of `decltype`, but the first thing I tried didn't immediately work, so I went with the safe route.

The main point of this patch is to clear the way for `_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS` (and incidentally `_LIBCPP_ABI_NO_BINDER_BASES`), which I have already got in a local patch on top of this one.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103371

Files:
  libcxx/include/__functional_base
  libcxx/include/functional
  libcxx/include/valarray

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103371.348660.patch
Type: text/x-patch
Size: 19583 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210529/0de2ae0f/attachment-0001.bin>


More information about the libcxx-commits mailing list