Lines Matching defs:int
72 int Nullary() { return 1; }
76 bool Unary(int x) { return x < 0; }
84 int operator()(bool x) { return x ? 1 : -1; }
89 int Ternary(int x, char y, short z) { return x + y + z; } // NOLINT
91 int SumOf4(int a, int b, int c, int d) { return a + b + c + d; }
93 int SumOfFirst2(int a, int b, Unused, Unused) { return a + b; }
95 int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
98 int operator()(int a, int b, int c, int d, int e) {
103 int SumOf6(int a, int b, int c, int d, int e, int f) {
108 int operator()(int a, int b, int c, int d, int e, int f) {
142 int Nullary() const { return value_; }
148 int Ternary(int x, bool y, char z) { return value_ + x + y * z; }
150 int SumOf4(int a, int b, int c, int d) const {
154 int SumOfLast2(Unused, Unused, int a, int b) const { return a + b; }
156 int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
158 int SumOf6(int a, int b, int c, int d, int e, int f) {
188 int value_;
193 Action<int()> a = Invoke(Nullary); // NOLINT
199 Action<bool(int)> a = Invoke(Unary); // NOLINT
213 Action<int(int, char, short)> a = Invoke(Ternary); // NOLINT
219 Action<int(int, int, int, int)> a = Invoke(SumOf4); // NOLINT
225 Action<int(int, int, int, int, int)> a = Invoke(SumOf5); // NOLINT
231 Action<int(int, int, int, int, int, int)> a = Invoke(SumOf6); // NOLINT
289 Action<int(int, int, double, const std::string&)> a1 = Invoke(SumOfFirst2);
290 std::tuple<int, int, double, std::string> dummy =
294 Action<int(int, int, bool, int*)> a2 = Invoke(SumOfFirst2);
296 23, a2.Perform(std::make_tuple(20, 3, true, static_cast<int*>(nullptr))));
302 Action<int(std::string, bool, int, int)> a1 = Invoke(&foo, &Foo::SumOfLast2);
305 Action<int(char, double, int, int)> a2 = Invoke(&foo, &Foo::SumOfLast2);
311 Action<long(long, int)> a = Invoke(plus<long>()); // NOLINT
317 Action<long(int, short, char, bool)> a = Invoke(SumOf4); // NOLINT
326 Action<int()> a = Invoke(&foo, &Foo::Nullary); // NOLINT
349 Action<int(int, bool, char)> a = Invoke(&foo, &Foo::Ternary); // NOLINT
356 Action<int(int, int, int, int)> a = Invoke(&foo, &Foo::SumOf4); // NOLINT
363 Action<int(int, int, int, int, int)> a =
371 Action<int(int, int, int, int, int, int)> a = // NOLINT
431 Action<long(int, short, char, bool)> a = // NOLINT
438 Action<int(int n)> a = WithoutArgs(Invoke(Nullary)); // NOLINT
444 Action<bool(double x, int n)> b = WithArg<1>(Invoke(Unary)); // NOLINT
450 const Action<int(int)> a = ReturnArg<0>();
460 const Action<std::string(int, int, std::string, int)> a = ReturnArg<2>();
471 int result = 0;
472 const Action<void(int n)> a1 = SaveArg<0>(&result);
478 int result = 0;
485 int result = 0;
486 const int value = 5;
487 const Action<void(const int*)> a1 = SaveArgPointee<0>(&result);
493 int result = 0;
501 int value = 0;
502 const Action<void(int&)> a1 = SetArgReferee<0>(1);
503 a1.Perform(std::tuple<int&>(value));
508 int value = 0;
509 const Action<void(int, int&)> a1 = SetArgReferee<1>('a');
510 a1.Perform(std::tuple<int, int&>(0, value));
515 int value = 0;
516 const Action<void(bool, int, int&, const char*)> a1 = SetArgReferee<2>('a');
517 a1.Perform(std::tuple<bool, int, int&, const char*>(true, 0, value, "hi"));
548 const Action<void(bool, int, int, const char*, bool, int, int, int, int,
559 const Action<void(int n)> a = Throw('a');
607 using MyFunction = void(bool, int*, char*);
608 int numbers[] = {1, 2, 3};
611 int n[4] = {};
612 int* pn = n;
643 using MyFunction = void(bool, int*);
644 int numbers[] = {1, 2, 3};
647 int n[4] = {};
648 int* pn = n;
659 using MyFunction = void(bool, int*);
663 int codes[4] = {111, 222, 333, 444};
664 int* pcodes = codes;
684 int n = 42;
685 const Action<int()> a = ReturnPointee(&n);
696 Action<int(int, int (*)())> a = InvokeArgument<1>(); // NOLINT
702 Action<int(UnaryFunctor)> a = InvokeArgument<0>(true); // NOLINT
708 Action<int(int (*)(int, int, int, int, int))> a = // NOLINT
715 Action<int(SumOf5Functor)> a = // NOLINT
722 Action<int(int (*)(int, int, int, int, int, int))> a = // NOLINT
729 Action<int(SumOf6Functor)> a = // NOLINT
810 int n = 0;
811 Action<int(int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
819 int m = 0, n = 0;
820 Action<int(int*, int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
829 int m = 0, n = 0;
831 Action<int(int*, int*, char*)> a = // NOLINT
842 int m = 0, n = 0;
844 Action<int(int*, int*, char*, char*)> action = // NOLINT
856 int m = 0, n = 0;
858 Action<int(int*, int*, char*, char*, char*)> action = // NOLINT
871 int m = 0, n = 0;
873 Action<int(int*, int*, char*, char*, char*, char*)> action = // NOLINT
888 int m = 0, n = 0;
890 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
908 int m = 0, n = 0;
910 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
929 int m = 0, n = 0;
932 Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
961 Action<int(std::unique_ptr<int>)> a =
963 [](std::unique_ptr<int> p) { return *p; });
964 EXPECT_EQ(7, a.Perform(std::make_tuple(std::unique_ptr<int>(new int(7)))));
970 // Action<void(std::vector<int>)> isn't an
971 // Action<void(const std::vector<int>&) but can be converted.
972 Action<void(std::vector<int>)> first = [&] { ran_first = true; };
973 Action<int(std::vector<int>)> a =
974 DoAll(first, [](std::vector<int> arg) { return arg.front(); });
975 EXPECT_EQ(7, a.Perform(std::make_tuple(std::vector<int>{7})));
1000 Action<int(double, bool)> a2 = Return5();
1008 Action<void(int, int*)> a1 = IncrementArg1();
1009 int n = 0;
1017 StaticAssertTypeEq<int*, arg2_type>();
1023 Action<void(int, bool, int*)> a1 = IncrementArg2();
1024 int n = 0;
1032 StaticAssertTypeEq<std::tuple<int, char, int*>, args_type>();
1038 Action<int(int, char, int*)> a1 = Sum2();
1039 int dummy = 0;
1047 int Dummy(bool flag) { return flag ? 1 : 0; }
1052 StaticAssertTypeEq<int(bool), function_type>();
1058 Action<int(bool)> a1 = InvokeDummy();
1066 StaticAssertTypeEq<int, return_type>();
1072 Action<int(bool)> a1 = InvokeDummy2();
1084 Action<const bool*(int, const bool&)> a = ReturnAddrOfConstBoolReferenceArg();
1086 EXPECT_EQ(&b, a.Perform(std::tuple<int, const bool&>(0, b)));
1091 StaticAssertTypeEq<int&, arg0_type>();
1096 Action<int*(int&, bool, int)> a = ReturnAddrOfIntReferenceArg();
1097 int n = 0;
1098 EXPECT_EQ(&n, a.Perform(std::tuple<int&, bool, int>(n, true, 1)));
1107 Action<int(int, int)> a1 = action_test::Sum();
1116 Action<int(int)> a1 = PlusTwo();
1120 int dummy;
1128 Action<int(int m, bool t)> a1 = Plus(9);
1141 Action<int(char m, bool t)> a1 = TypedPlus(9);
1188 Action<double(int m, bool t)> a1 = Plus(100, 20, 3.4);
1200 Action<int(int)> a1 = Plus(1, 2, 3, 4);
1207 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5);
1216 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6);
1225 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7);
1234 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8);
1244 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9);
1256 Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
1274 PadArgument("foo", static_cast<int>('r'));
1291 // string, or the second parameter is an int.
1316 // second parameter to int.
1318 ConcatImplActionP3<T1, int, T2> Concat(T1 a, int b, T2 c) {
1341 DoFooActionP<int> a1 = DoFoo(1);
1345 DoFooActionP2<int, char> a2 = DoFoo(1, '2');
1346 PlusActionP3<int, int, char> a3 = Plus(1, 2, '3');
1347 PlusActionP4<int, int, int, char> a4 = Plus(1, 2, 3, '4');
1348 PlusActionP5<int, int, int, int, char> a5 = Plus(1, 2, 3, 4, '5');
1349 PlusActionP6<int, int, int, int, int, char> a6 = Plus(1, 2, 3, 4, 5, '6');
1350 PlusActionP7<int, int, int, int, int, int, char> a7 =
1352 PlusActionP8<int, int, int, int, int, int, int, char> a8 =
1354 PlusActionP9<int, int, int, int, int, int, int, int, char> a9 =
1356 PlusActionP10<int, int, int, int, int, int, int, int, int, char> a10 =
1384 int x = 1, y = 2, z = 3;
1387 Action<int()> a = Plus1<int&>(x);
1390 a = Plus2<const int&, int&>(x, y);
1393 a = Plus3<int&, const int&, int&>(x, y, z);
1396 int n[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
1397 a = Plus10<const int&, int&, const int&, int&, const int&, int&, const int&,
1398 int&, const int&, int&>(n[0], n[1], n[2], n[3], n[4], n[5], n[6],
1405 TenArgConstructorClass(int a1, int a2, int a3, int a4, int a5, int a6, int a7,
1406 int a8, int a9, int a10)
1408 int value_;
1418 const Action<int*()> a = CreateNew<int>();
1419 int* p = a.Perform(std::make_tuple());
1430 const Action<int*()> a = CreateNew<int>(42);
1431 int* p = a.Perform(std::make_tuple());
1437 ACTION_TEMPLATE(MyDeleteArg, HAS_1_TEMPLATE_PARAMS(int, k),
1453 const Action<void(int*, BoolResetter*)> a = MyDeleteArg<1>();
1454 int n = 0;
1470 const Action<std::shared_ptr<int>()> a =
1472 std::shared_ptr<int> p = a.Perform(std::make_tuple());
1477 template <typename T1, typename T2, typename T3, int k4, bool k5,
1478 unsigned int k6, typename T7, typename T8, typename T9>
1481 explicit GiantTemplate(int a_value) : value(a_value) {}
1482 int value;
1487 int, k4, bool, k5, unsigned int, k6,
1495 using Giant = GiantTemplate<std::shared_ptr<int>, bool, double, 5, true, 6,
1496 char, unsigned, int>;
1497 const Action<Giant()> a = ReturnGiant<int, bool, double, 5, true, 6, char,
1498 unsigned, int, std::shared_ptr>(42);
1510 const Action<int()> a = ReturnSum<int>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
1531 ACTION_TEMPLATE(ReturnSum, HAS_2_TEMPLATE_PARAMS(typename, Number, int, k),
1537 const Action<int()> a0 = ReturnSum();
1538 const Action<int()> a1 = ReturnSum(1);
1539 const Action<int()> a2 = ReturnSum<int>(1, 2);
1540 const Action<int()> a3 = ReturnSum<int>(1, 2, 3);
1541 const Action<int()> a4 = ReturnSum<int, 10000>(2000, 300, 40, 5);