Set up inlining for InvokeWithoutArgs when passed a functor.
Actions can now be implicitly constructed from zero-argument callables. There is no need to create wrapper objects using InvokeWithoutArgs(). PiperOrigin-RevId: 949656497 Change-Id: Ida2bc38e446e7b33aaf185ec593caf2a1959138e
This commit is contained in:
committed by
Copybara-Service
parent
4141c384aa
commit
fa005b296f
@@ -1026,9 +1026,8 @@ TEST(DoAllTest, NoArgs) {
|
||||
|
||||
TEST(DoAllTest, MoveOnlyArgs) {
|
||||
bool ran_first = false;
|
||||
Action<int(std::unique_ptr<int>)> a =
|
||||
DoAll(InvokeWithoutArgs([&] { ran_first = true; }),
|
||||
[](std::unique_ptr<int> p) { return *p; });
|
||||
Action<int(std::unique_ptr<int>)> a = DoAll(
|
||||
[&] { ran_first = true; }, [](std::unique_ptr<int> p) { return *p; });
|
||||
EXPECT_EQ(7, a.Perform(std::make_tuple(std::unique_ptr<int>(new int(7)))));
|
||||
EXPECT_TRUE(ran_first);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user