@@ -85,6 +85,12 @@ struct UnaryFunctor {
85
85
int operator ()(bool x) { return x ? 1 : -1 ; }
86
86
};
87
87
88
+ struct UnaryMoveOnlyFunctor : UnaryFunctor {
89
+ UnaryMoveOnlyFunctor () = default ;
90
+ UnaryMoveOnlyFunctor (const UnaryMoveOnlyFunctor&) = delete ;
91
+ UnaryMoveOnlyFunctor (UnaryMoveOnlyFunctor&&) = default ;
92
+ };
93
+
88
94
const char * Binary (const char * input, short n) { return input + n; } // NOLINT
89
95
90
96
int Ternary (int x, char y, short z) { return x + y + z; } // NOLINT
@@ -698,12 +704,18 @@ TEST(InvokeArgumentTest, Function0) {
698
704
EXPECT_EQ (1 , a.Perform (std::make_tuple (2 , &Nullary)));
699
705
}
700
706
701
- // Tests using InvokeArgument with a unary function .
707
+ // Tests using InvokeArgument with a unary functor .
702
708
TEST (InvokeArgumentTest, Functor1) {
703
709
Action<int (UnaryFunctor)> a = InvokeArgument<0 >(true ); // NOLINT
704
710
EXPECT_EQ (1 , a.Perform (std::make_tuple (UnaryFunctor ())));
705
711
}
706
712
713
+ // Tests using InvokeArgument with a unary move-only functor.
714
+ TEST (InvokeArgumentTest, Functor1MoveOnly) {
715
+ Action<int (UnaryMoveOnlyFunctor)> a = InvokeArgument<0 >(true ); // NOLINT
716
+ EXPECT_EQ (1 , a.Perform (std::make_tuple (UnaryMoveOnlyFunctor ())));
717
+ }
718
+
707
719
// Tests using InvokeArgument with a 5-ary function.
708
720
TEST (InvokeArgumentTest, Function5) {
709
721
Action<int (int (*)(int , int , int , int , int ))> a = // NOLINT
0 commit comments