HELLO·Android
系统源代码
IT资讯
技术文章
我的收藏
注册
登录
-
我收藏的文章
创建代码块
我的代码块
我的账号
Oreo
|
8.0.0_r4
下载
查看原文件
收藏
根目录
external
googletest
googlemock
include
gmock
gmock-generated-actions.h
// This file was GENERATED by a script. DO NOT EDIT BY HAND!!! // Copyright 2007, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Author: wan@google.com (Zhanyong Wan) // Google Mock - a framework for writing C++ mock classes. // // This file implements some commonly used variadic actions. #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ #include "gmock/gmock-actions.h" #include "gmock/internal/gmock-port.h" namespace testing { namespace internal { // InvokeHelper
knows how to unpack an N-tuple and invoke an N-ary // function or method with the unpacked values, where F is a function // type that takes N arguments. template
class InvokeHelper; template
class InvokeHelper
> { public: template
static R Invoke(Function function, const ::testing::tuple<>&) { return function(); } template
static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, const ::testing::tuple<>&) { return (obj_ptr->*method_ptr)(); } }; template
class InvokeHelper
> { public: template
static R Invoke(Function function, const ::testing::tuple
& args) { return function(get<0>(args)); } template
static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, const ::testing::tuple
& args) { return (obj_ptr->*method_ptr)(get<0>(args)); } }; template
class InvokeHelper
> { public: template
static R Invoke(Function function, const ::testing::tuple
& args) { return function(get<0>(args), get<1>(args)); } template
static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, const ::testing::tuple
& args) { return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args)); } }; template
class InvokeHelper
> { public: template
static R Invoke(Function function, const ::testing::tuple
& args) { return function(get<0>(args), get<1>(args), get<2>(args)); } template
static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, const ::testing::tuple
& args) { return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args)); } }; template
class InvokeHelper
> { public: template
static R Invoke(Function function, const ::testing::tuple
& args) { return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args)); } template
static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, const ::testing::tuple
& args) { return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), get<3>(args)); } }; template
class InvokeHelper
> { public: template
static R Invoke(Function function, const ::testing::tuple
& args) { return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args)); } template
static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, const ::testing::tuple
& args) { return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args)); } }; template
class InvokeHelper
> { public: template
static R Invoke(Function function, const ::testing::tuple
& args) { return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args)); } template
static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, const ::testing::tuple
& args) { return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args)); } }; template
class InvokeHelper
> { public: template
static R Invoke(Function function, const ::testing::tuple
& args) { return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args)); } template
static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, const ::testing::tuple
& args) { return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args)); } }; template
class InvokeHelper
> { public: template
static R Invoke(Function function, const ::testing::tuple
& args) { return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args)); } template
static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, const ::testing::tuple
& args) { return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args)); } }; template
class InvokeHelper
> { public: template
static R Invoke(Function function, const ::testing::tuple
& args) { return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args)); } template
static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, const ::testing::tuple
& args) { return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args)); } }; template
class InvokeHelper
> { public: template
static R Invoke(Function function, const ::testing::tuple
& args) { return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args), get<9>(args)); } template
static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, const ::testing::tuple
& args) { return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args), get<9>(args)); } }; // An INTERNAL macro for extracting the type of a tuple field. It's // subject to change without notice - DO NOT USE IN USER CODE! #define GMOCK_FIELD_(Tuple, N) \ typename ::testing::tuple_element
::type // SelectArgs
::type is the // type of an n-ary function whose i-th (1-based) argument type is the // k{i}-th (0-based) field of ArgumentTuple, which must be a tuple // type, and whose return type is Result. For example, // SelectArgs
, 0, 3>::type // is int(bool, long). // // SelectArgs
::Select(args) // returns the selected fields (k1, k2, ..., k_n) of args as a tuple. // For example, // SelectArgs
, 2, 0>::Select( // ::testing::make_tuple(true, 'a', 2.5)) // returns tuple (2.5, true). // // The numbers in list k1, k2, ..., k_n must be >= 0, where n can be // in the range [0, 10]. Duplicates are allowed and they don't have // to be in an ascending or descending order. template
class SelectArgs { public: typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5), GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7), GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9), GMOCK_FIELD_(ArgumentTuple, k10)); typedef typename Function
::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { return SelectedArgs(get
(args), get
(args), get
(args), get
(args), get
(args), get
(args), get
(args), get
(args), get
(args), get
(args)); } }; template
class SelectArgs
{ public: typedef Result type(); typedef typename Function
::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& /* args */) { return SelectedArgs(); } }; template
class SelectArgs
{ public: typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1)); typedef typename Function
::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { return SelectedArgs(get
(args)); } }; template
class SelectArgs
{ public: typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), GMOCK_FIELD_(ArgumentTuple, k2)); typedef typename Function
::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { return SelectedArgs(get
(args), get
(args)); } }; template
class SelectArgs
{ public: typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3)); typedef typename Function
::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { return SelectedArgs(get
(args), get
(args), get
(args)); } }; template
class SelectArgs
{ public: typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), GMOCK_FIELD_(ArgumentTuple, k4)); typedef typename Function
::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { return SelectedArgs(get
(args), get
(args), get
(args), get
(args)); } }; template
class SelectArgs
{ public: typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5)); typedef typename Function
::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { return SelectedArgs(get
(args), get
(args), get
(args), get
(args), get
(args)); } }; template
class SelectArgs
{ public: typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5), GMOCK_FIELD_(ArgumentTuple, k6)); typedef typename Function
::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { return SelectedArgs(get
(args), get
(args), get
(args), get
(args), get
(args), get
(args)); } }; template
class SelectArgs
{ public: typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5), GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7)); typedef typename Function
::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { return SelectedArgs(get
(args), get
(args), get
(args), get
(args), get
(args), get
(args), get
(args)); } }; template
class SelectArgs
{ public: typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5), GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7), GMOCK_FIELD_(ArgumentTuple, k8)); typedef typename Function
::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { return SelectedArgs(get
(args), get
(args), get
(args), get
(args), get
(args), get
(args), get
(args), get
(args)); } }; template
class SelectArgs
{ public: typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1), GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3), GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5), GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7), GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9)); typedef typename Function
::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { return SelectedArgs(get
(args), get
(args), get
(args), get
(args), get
(args), get
(args), get
(args), get
(args), get
(args)); } }; #undef GMOCK_FIELD_ // Implements the WithArgs action. template
class WithArgsAction { public: explicit WithArgsAction(const InnerAction& action) : action_(action) {} template
operator Action
() const { return MakeAction(new Impl
(action_)); } private: template
class Impl : public ActionInterface
{ public: typedef typename Function
::Result Result; typedef typename Function
::ArgumentTuple ArgumentTuple; explicit Impl(const InnerAction& action) : action_(action) {} virtual Result Perform(const ArgumentTuple& args) { return action_.Perform(SelectArgs
::Select(args)); } private: typedef typename SelectArgs
::type InnerFunctionType; Action
action_; }; const InnerAction action_; GTEST_DISALLOW_ASSIGN_(WithArgsAction); }; // A macro from the ACTION* family (defined later in this file) // defines an action that can be used in a mock function. Typically, // these actions only care about a subset of the arguments of the mock // function. For example, if such an action only uses the second // argument, it can be used in any mock function that takes >= 2 // arguments where the type of the second argument is compatible. // // Therefore, the action implementation must be prepared to take more // arguments than it needs. The ExcessiveArg type is used to // represent those excessive arguments. In order to keep the compiler // error messages tractable, we define it in the testing namespace // instead of testing::internal. However, this is an INTERNAL TYPE // and subject to change without notice, so a user MUST NOT USE THIS // TYPE DIRECTLY. struct ExcessiveArg {}; // A helper class needed for implementing the ACTION* macros. template
class ActionHelper { public: static Result Perform(Impl* impl, const ::testing::tuple<>& args) { return impl->template gmock_PerformImpl<>(args, ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template
static Result Perform(Impl* impl, const ::testing::tuple
& args) { return impl->template gmock_PerformImpl
(args, get<0>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template
static Result Perform(Impl* impl, const ::testing::tuple
& args) { return impl->template gmock_PerformImpl
(args, get<0>(args), get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template
static Result Perform(Impl* impl, const ::testing::tuple
& args) { return impl->template gmock_PerformImpl
(args, get<0>(args), get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template
static Result Perform(Impl* impl, const ::testing::tuple
& args) { return impl->template gmock_PerformImpl
(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template
static Result Perform(Impl* impl, const ::testing::tuple
& args) { return impl->template gmock_PerformImpl
(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template
static Result Perform(Impl* impl, const ::testing::tuple
& args) { return impl->template gmock_PerformImpl
(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template
static Result Perform(Impl* impl, const ::testing::tuple
& args) { return impl->template gmock_PerformImpl
(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template
static Result Perform(Impl* impl, const ::testing::tuple
& args) { return impl->template gmock_PerformImpl
(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(), ExcessiveArg()); } template
static Result Perform(Impl* impl, const ::testing::tuple
& args) { return impl->template gmock_PerformImpl
(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args), ExcessiveArg()); } template
static Result Perform(Impl* impl, const ::testing::tuple
& args) { return impl->template gmock_PerformImpl
(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args), get<9>(args)); } }; } // namespace internal // Various overloads for Invoke(). // WithArgs
(an_action) creates an action that passes // the selected arguments of the mock function to an_action and // performs it. It serves as an adaptor between actions with // different argument lists. C++ doesn't support default arguments for // function templates, so we have to overload it. template
inline internal::WithArgsAction
WithArgs(const InnerAction& action) { return internal::WithArgsAction
(action); } template
inline internal::WithArgsAction
WithArgs(const InnerAction& action) { return internal::WithArgsAction
(action); } template
inline internal::WithArgsAction
WithArgs(const InnerAction& action) { return internal::WithArgsAction
(action); } template
inline internal::WithArgsAction
WithArgs(const InnerAction& action) { return internal::WithArgsAction
(action); } template
inline internal::WithArgsAction
WithArgs(const InnerAction& action) { return internal::WithArgsAction
(action); } template
inline internal::WithArgsAction
WithArgs(const InnerAction& action) { return internal::WithArgsAction
(action); } template
inline internal::WithArgsAction
WithArgs(const InnerAction& action) { return internal::WithArgsAction
(action); } template
inline internal::WithArgsAction
WithArgs(const InnerAction& action) { return internal::WithArgsAction
(action); } template
inline internal::WithArgsAction
WithArgs(const InnerAction& action) { return internal::WithArgsAction
(action); } template
inline internal::WithArgsAction
WithArgs(const InnerAction& action) { return internal::WithArgsAction
(action); } // Creates an action that does actions a1, a2, ..., sequentially in // each invocation. template
inline internal::DoBothAction
DoAll(Action1 a1, Action2 a2) { return internal::DoBothAction
(a1, a2); } template
inline internal::DoBothAction
> DoAll(Action1 a1, Action2 a2, Action3 a3) { return DoAll(a1, DoAll(a2, a3)); } template
inline internal::DoBothAction
> > DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4) { return DoAll(a1, DoAll(a2, a3, a4)); } template
inline internal::DoBothAction
> > > DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5) { return DoAll(a1, DoAll(a2, a3, a4, a5)); } template
inline internal::DoBothAction
> > > > DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6) { return DoAll(a1, DoAll(a2, a3, a4, a5, a6)); } template
inline internal::DoBothAction
> > > > > DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, Action7 a7) { return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7)); } template
inline internal::DoBothAction
> > > > > > DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, Action7 a7, Action8 a8) { return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8)); } template
inline internal::DoBothAction
> > > > > > > DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, Action7 a7, Action8 a8, Action9 a9) { return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9)); } template
inline internal::DoBothAction
> > > > > > > > DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, Action7 a7, Action8 a8, Action9 a9, Action10 a10) { return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9, a10)); } } // namespace testing // The ACTION* family of macros can be used in a namespace scope to // define custom actions easily. The syntax: // // ACTION(name) { statements; } // // will define an action with the given name that executes the // statements. The value returned by the statements will be used as // the return value of the action. Inside the statements, you can // refer to the K-th (0-based) argument of the mock function by // 'argK', and refer to its type by 'argK_type'. For example: // // ACTION(IncrementArg1) { // arg1_type temp = arg1; // return ++(*temp); // } // // allows you to write // // ...WillOnce(IncrementArg1()); // // You can also refer to the entire argument tuple and its type by // 'args' and 'args_type', and refer to the mock function type and its // return type by 'function_type' and 'return_type'. // // Note that you don't need to specify the types of the mock function // arguments. However rest assured that your code is still type-safe: // you'll get a compiler error if *arg1 doesn't support the ++ // operator, or if the type of ++(*arg1) isn't compatible with the // mock function's return type, for example. // // Sometimes you'll want to parameterize the action. For that you can use // another macro: // // ACTION_P(name, param_name) { statements; } // // For example: // // ACTION_P(Add, n) { return arg0 + n; } // // will allow you to write: // // ...WillOnce(Add(5)); // // Note that you don't need to provide the type of the parameter // either. If you need to reference the type of a parameter named // 'foo', you can write 'foo_type'. For example, in the body of // ACTION_P(Add, n) above, you can write 'n_type' to refer to the type // of 'n'. // // We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support // multi-parameter actions. // // For the purpose of typing, you can view // // ACTION_Pk(Foo, p1, ..., pk) { ... } // // as shorthand for // // template
// FooActionPk
Foo(p1_type p1, ..., pk_type pk) { ... } // // In particular, you can provide the template type arguments // explicitly when invoking Foo(), as in Foo
(5, false); // although usually you can rely on the compiler to infer the types // for you automatically. You can assign the result of expression // Foo(p1, ..., pk) to a variable of type FooActionPk