[PATCH] D88977: Reapply [ADT] function_ref's constructor is unavailable if the argument is not callable.

Kadir Cetinkaya via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 09:19:53 PDT 2020


kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

If you have some pointers to gcc bug being discussed in some place, it might be nice to include.



================
Comment at: llvm/include/llvm/ADT/STLExtras.h:201
+      // Functor must be callable and return a suitable type.
+      std::enable_if_t<std::is_void<Ret>::value ||
+                       std::is_convertible<
----------------
nit: I would propbably merge the two into a single parameter, but up to you.

```
std::enable_if_t<
// This is not the copy-constructor.
!std::is_same<std::remove_cv_t<std::remove_reference_t<Callable>>,
                        function_ref>::value &&
// Functor must be callable and return a suitable type.
(std::is_void<Ret>::value || std::is_convertible<
                           std::result_of_t<Callable(Params...)>, Ret>::value)> * = nullptr
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88977/new/

https://reviews.llvm.org/D88977



More information about the llvm-commits mailing list