[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:51:12 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:
> zoecarver wrote:
> > 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`.
> I would update this patch as suggested.
Do you want me to update all three times `_EnableIfCallable` is used, in this patch (that's fine, just checking)?


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