[libcxx-commits] [PATCH] D143610: [libc++] Implement P2136R3 std::invoke_r

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 13 05:46:31 PST 2023


ldionne marked 2 inline comments as done.
ldionne added inline comments.


================
Comment at: libcxx/include/__functional/invoke.h:550
+    if constexpr (is_void_v<_Result>) {
+        static_cast<void>(std::invoke(std::forward<_Fn>(__f), std::forward<_Args>(__args)...));
+    } else {
----------------
Mordante wrote:
> Why not return the void value? This is valid nowadays.
I guess there's no real reason except following the standard to the letter. cv-qualifiers are ignored from return values so that should also not be an issue. I'm leaning towards leaving as-is though.


================
Comment at: libcxx/test/std/utilities/function.objects/func.invoke/invoke_r.pass.cpp:130
+    // Note: We don't test that `std::invoke_r` works with all kinds of callable types here,
+    //       since that is extensively tested in the `std::invoke` tests.
+
----------------
Mordante wrote:
> These tests are also testing references, to non-temporaries, return types?
Yes, I just checked and they do!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143610



More information about the libcxx-commits mailing list