[libcxx-commits] [PATCH] D103753: [libc++] [P0619] Add _LIBCPP_ABI_NO_BINDER_BASES and remove binder typedefs in C++20.
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Jun 5 15:39:17 PDT 2021
Quuxplusone added inline comments.
================
Comment at: libcxx/include/functional:79
template <class T> // <class T=void> in C++14
-struct plus : binary_function<T, T, T>
-{
+struct plus {
T operator()(const T& x, const T& y) const;
----------------
Wmbat wrote:
> Is it ok to remove the inheritance to `binary_function` from all arithmetic operators for all C++ versions?
(Note that here we're talking only about the synopsis comment.) Personally I think this simplification is fine, but I'll take suggestions from Louis if he really wants to complicate matters. E.g. we could do
```
template <class T> // <class T=void> in C++14
struct plus { // derives from binary_function<T, T, T> before C++11
```
but that seems more costly than beneficial IMHO. Honestly I'd welcome a suggestion to just write
```
template <class T=void>
struct plus {
```
at this point in the century. We never bothered to say `// constexpr in C++11` or whatever, either.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103753/new/
https://reviews.llvm.org/D103753
More information about the libcxx-commits
mailing list