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

Marshall Clow via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 26 07:48:50 PDT 2019


mclow.lists added a comment.

More to come.



================
Comment at: include/functional:2852
+    -> decltype(!_VSTD::invoke(_VSTD::forward<_Args>(__args)...))
+    { return !_VSTD::invoke(_VSTD::forward<_Args>(__args)...); }
+};
----------------
Formatting nit. Note how the other bits of code have three identical chunks of code, all aligned so that you could see that they were identical.  Please do that here. See the code that you're replacing (lines 2815->17) for an example.


================
Comment at: test/std/utilities/function.objects/func.bind_front/bind_front.fail.cpp:33
+    auto d = std::bind_front(do_nothing, n); // expected-error {{no matching function for call to 'bind_front'}}
+    assert(d() == n);
+
----------------
This line can be removed; if the compilation never succeeds.


================
Comment at: test/std/utilities/function.objects/func.bind_front/bind_front.fail.cpp:36
+    auto a = std::bind_front(simple); // expected-error {{static_assert failed "At least one argument must be provided"}}
+    assert(a(1) == 1);
+
----------------
This one too


================
Comment at: test/std/utilities/function.objects/func.bind_front/bind_front.pass.cpp:56
+
+        static_assert(std::is_move_constructible<RetT>::value, "");
+        static_assert(!std::is_copy_constructible<RetT>::value, "");
----------------
Formatting nit. When ganging a bunch of static asserts, leave a space after the '(', so that the negations are easily visible.  See  test/std/utilities/meta/meta.unary/meta.unary.cat/nullptr.pass.cpp as an example.


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

https://reviews.llvm.org/D60368





More information about the libcxx-commits mailing list