[libcxx-commits] [PATCH] D60368: Add bind_front function (P0356R5)

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 29 09:26:12 PST 2020


zoecarver added inline comments.


================
Comment at: libcxx/include/functional:2981
 invoke_result_t<_Fn, _Args...>
-invoke(_Fn&& __f, _Args&&... __args)
+_LIBCPP_CONSTEXPR_AFTER_CXX17 invoke(_Fn&& __f, _Args&&... __args)
     noexcept(is_nothrow_invocable_v<_Fn, _Args...>)
----------------
curdeius wrote:
> I guess you should add tests for constexpr to https://github.com/llvm/llvm-project/blob/master/libcxx/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp.
Good point. I should probably make this a different patch. 


================
Comment at: libcxx/include/functional:2991
 
-template <class _DecayFunc>
-class _LIBCPP_TEMPLATE_VIS __not_fn_imp {
-  _DecayFunc __fd;
-
-public:
-    __not_fn_imp() = delete;
-
-    template <class ..._Args>
-    _LIBCPP_INLINE_VISIBILITY
-    auto operator()(_Args&& ...__args) &
-            noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
-        -> decltype(          !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
-        { return              !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
-
-    template <class ..._Args>
-    _LIBCPP_INLINE_VISIBILITY
-    auto operator()(_Args&& ...__args) &&
-            noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
-        -> decltype(          !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
-        { return              !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...); }
+#endif
 
----------------
curdeius wrote:
> Spurious #endif?
I don't think so. This one corresponds to line 2977. Because of how the diff is rendered, it looks like I added this one instead of the one on 3095. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60368



More information about the libcxx-commits mailing list