[libcxx-commits] [PATCH] D62928: Constrain function assignment operator (2574)

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 5 14:34:43 PDT 2019


zoecarver marked an inline comment as done.
zoecarver added inline comments.


================
Comment at: include/functional:2231
     function& operator=(nullptr_t) _NOEXCEPT;
-    template<class _Fp, class = _EnableIfCallable<_Fp>>
+    template<class _Fp, class = _EnableIfCallable<typename decay<_Fp>::type&>>
     function& operator=(_Fp&&);
----------------
ldionne wrote:
> I think this should just be `_EnableIfCallable<typename decay<_Fp>::type>`, since we already add the reference inside `__callable` above.
> 
> Alternatively, I think it would be even better to NOT add the reference inside `__callable`, and instead do it when we call `_EnableIfCallable`.
Good catch. I will remove the reference here. If you think it would be better, I can make another patch to update all instances of `_EnableIfCallable`.


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D62928





More information about the libcxx-commits mailing list