oshima@chromium.org | cc65491 | 2011-09-28 09:33:59 +0900 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 4 | |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 5 | // A Tuple is a generic templatized container, similar in concept to std::pair |
| 6 | // and std::tuple. The convenient MakeTuple() function takes any number of |
| 7 | // arguments and will construct and return the appropriate Tuple object. The |
| 8 | // functions DispatchToMethod and DispatchToFunction take a function pointer or |
| 9 | // instance and method pointer, and unpack a tuple into arguments to the call. |
deanm@google.com | 96aac0a | 2008-08-25 22:42:07 +0900 | [diff] [blame] | 10 | // |
| 11 | // Tuple elements are copied by value, and stored in the tuple. See the unit |
| 12 | // tests for more details of how/when the values are copied. |
| 13 | // |
| 14 | // Example usage: |
| 15 | // // These two methods of creating a Tuple are identical. |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 16 | // Tuple<int, const char*> tuple_a(1, "wee"); |
| 17 | // Tuple<int, const char*> tuple_b = MakeTuple(1, "wee"); |
deanm@google.com | 96aac0a | 2008-08-25 22:42:07 +0900 | [diff] [blame] | 18 | // |
| 19 | // void SomeFunc(int a, const char* b) { } |
| 20 | // DispatchToFunction(&SomeFunc, tuple_a); // SomeFunc(1, "wee") |
| 21 | // DispatchToFunction( |
| 22 | // &SomeFunc, MakeTuple(10, "foo")); // SomeFunc(10, "foo") |
| 23 | // |
| 24 | // struct { void SomeMeth(int a, int b, int c) { } } foo; |
| 25 | // DispatchToMethod(&foo, &Foo::SomeMeth, MakeTuple(1, 2, 3)); |
| 26 | // // foo->SomeMeth(1, 2, 3); |
| 27 | |
tfarina | b6d62d8 | 2015-05-14 07:10:15 +0900 | [diff] [blame] | 28 | #ifndef BASE_TUPLE_H_ |
| 29 | #define BASE_TUPLE_H_ |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 30 | |
rsleevi@chromium.org | 274c722 | 2013-06-27 21:48:02 +0900 | [diff] [blame] | 31 | #include "base/bind_helpers.h" |
| 32 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 33 | // Index sequences |
| 34 | // |
| 35 | // Minimal clone of the similarly-named C++14 functionality. |
| 36 | |
| 37 | template <size_t...> |
| 38 | struct IndexSequence {}; |
| 39 | |
| 40 | template <size_t... Ns> |
| 41 | struct MakeIndexSequenceImpl; |
| 42 | |
brucedawson | 864de22 | 2015-01-22 07:02:16 +0900 | [diff] [blame] | 43 | #if defined(_PREFAST_) && defined(OS_WIN) |
| 44 | |
| 45 | // Work around VC++ 2013 /analyze internal compiler error: |
| 46 | // https://connect.microsoft.com/VisualStudio/feedback/details/1053626 |
| 47 | |
| 48 | template <> struct MakeIndexSequenceImpl<0> { |
| 49 | using Type = IndexSequence<>; |
| 50 | }; |
| 51 | template <> struct MakeIndexSequenceImpl<1> { |
| 52 | using Type = IndexSequence<0>; |
| 53 | }; |
| 54 | template <> struct MakeIndexSequenceImpl<2> { |
| 55 | using Type = IndexSequence<0,1>; |
| 56 | }; |
| 57 | template <> struct MakeIndexSequenceImpl<3> { |
| 58 | using Type = IndexSequence<0,1,2>; |
| 59 | }; |
| 60 | template <> struct MakeIndexSequenceImpl<4> { |
| 61 | using Type = IndexSequence<0,1,2,3>; |
| 62 | }; |
| 63 | template <> struct MakeIndexSequenceImpl<5> { |
| 64 | using Type = IndexSequence<0,1,2,3,4>; |
| 65 | }; |
| 66 | template <> struct MakeIndexSequenceImpl<6> { |
| 67 | using Type = IndexSequence<0,1,2,3,4,5>; |
| 68 | }; |
| 69 | template <> struct MakeIndexSequenceImpl<7> { |
| 70 | using Type = IndexSequence<0,1,2,3,4,5,6>; |
| 71 | }; |
| 72 | template <> struct MakeIndexSequenceImpl<8> { |
| 73 | using Type = IndexSequence<0,1,2,3,4,5,6,7>; |
| 74 | }; |
| 75 | template <> struct MakeIndexSequenceImpl<9> { |
| 76 | using Type = IndexSequence<0,1,2,3,4,5,6,7,8>; |
| 77 | }; |
| 78 | template <> struct MakeIndexSequenceImpl<10> { |
| 79 | using Type = IndexSequence<0,1,2,3,4,5,6,7,8,9>; |
| 80 | }; |
| 81 | template <> struct MakeIndexSequenceImpl<11> { |
| 82 | using Type = IndexSequence<0,1,2,3,4,5,6,7,8,9,10>; |
| 83 | }; |
brucedawson | 8b05256 | 2015-04-21 03:20:37 +0900 | [diff] [blame] | 84 | template <> struct MakeIndexSequenceImpl<12> { |
| 85 | using Type = IndexSequence<0,1,2,3,4,5,6,7,8,9,10,11>; |
| 86 | }; |
| 87 | template <> struct MakeIndexSequenceImpl<13> { |
| 88 | using Type = IndexSequence<0,1,2,3,4,5,6,7,8,9,10,11,12>; |
| 89 | }; |
brucedawson | 864de22 | 2015-01-22 07:02:16 +0900 | [diff] [blame] | 90 | |
| 91 | #else // defined(WIN) && defined(_PREFAST_) |
| 92 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 93 | template <size_t... Ns> |
| 94 | struct MakeIndexSequenceImpl<0, Ns...> { |
| 95 | using Type = IndexSequence<Ns...>; |
| 96 | }; |
| 97 | |
| 98 | template <size_t N, size_t... Ns> |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 99 | struct MakeIndexSequenceImpl<N, Ns...> |
| 100 | : MakeIndexSequenceImpl<N - 1, N - 1, Ns...> {}; |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 101 | |
brucedawson | 864de22 | 2015-01-22 07:02:16 +0900 | [diff] [blame] | 102 | #endif // defined(WIN) && defined(_PREFAST_) |
| 103 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 104 | template <size_t N> |
| 105 | using MakeIndexSequence = typename MakeIndexSequenceImpl<N>::Type; |
| 106 | |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 107 | // Traits ---------------------------------------------------------------------- |
| 108 | // |
| 109 | // A simple traits class for tuple arguments. |
| 110 | // |
| 111 | // ValueType: the bare, nonref version of a type (same as the type for nonrefs). |
| 112 | // RefType: the ref version of a type (same as the type for refs). |
| 113 | // ParamType: what type to pass to functions (refs should not be constified). |
| 114 | |
| 115 | template <class P> |
| 116 | struct TupleTraits { |
| 117 | typedef P ValueType; |
| 118 | typedef P& RefType; |
| 119 | typedef const P& ParamType; |
| 120 | }; |
| 121 | |
| 122 | template <class P> |
| 123 | struct TupleTraits<P&> { |
| 124 | typedef P ValueType; |
| 125 | typedef P& RefType; |
| 126 | typedef P& ParamType; |
| 127 | }; |
| 128 | |
| 129 | // Tuple ----------------------------------------------------------------------- |
| 130 | // |
| 131 | // This set of classes is useful for bundling 0 or more heterogeneous data types |
| 132 | // into a single variable. The advantage of this is that it greatly simplifies |
| 133 | // function objects that need to take an arbitrary number of parameters; see |
| 134 | // RunnableMethod and IPC::MessageWithTuple. |
| 135 | // |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 136 | // Tuple<> is supplied to act as a 'void' type. It can be used, for example, |
deanm@google.com | ff4b729 | 2008-08-21 19:58:08 +0900 | [diff] [blame] | 137 | // when dispatching to a function that accepts no arguments (see the |
| 138 | // Dispatchers below). |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 139 | // Tuple<A> is rarely useful. One such use is when A is non-const ref that you |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 140 | // want filled by the dispatchee, and the tuple is merely a container for that |
| 141 | // output (a "tier"). See MakeRefTuple and its usages. |
| 142 | |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 143 | template <typename IxSeq, typename... Ts> |
| 144 | struct TupleBaseImpl; |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 145 | template <typename... Ts> |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 146 | using TupleBase = TupleBaseImpl<MakeIndexSequence<sizeof...(Ts)>, Ts...>; |
| 147 | template <size_t N, typename T> |
| 148 | struct TupleLeaf; |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 149 | |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 150 | template <typename... Ts> |
| 151 | struct Tuple : TupleBase<Ts...> { |
| 152 | Tuple() : TupleBase<Ts...>() {} |
| 153 | explicit Tuple(typename TupleTraits<Ts>::ParamType... args) |
| 154 | : TupleBase<Ts...>(args...) {} |
| 155 | }; |
| 156 | |
| 157 | // Avoids ambiguity between Tuple's two constructors. |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 158 | template <> |
| 159 | struct Tuple<> {}; |
| 160 | |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 161 | template <size_t... Ns, typename... Ts> |
| 162 | struct TupleBaseImpl<IndexSequence<Ns...>, Ts...> : TupleLeaf<Ns, Ts>... { |
| 163 | TupleBaseImpl() : TupleLeaf<Ns, Ts>()... {} |
| 164 | explicit TupleBaseImpl(typename TupleTraits<Ts>::ParamType... args) |
| 165 | : TupleLeaf<Ns, Ts>(args)... {} |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 166 | }; |
| 167 | |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 168 | template <size_t N, typename T> |
| 169 | struct TupleLeaf { |
mdempsky | 00c9723 | 2014-12-16 08:26:13 +0900 | [diff] [blame] | 170 | TupleLeaf() {} |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 171 | explicit TupleLeaf(typename TupleTraits<T>::ParamType x) : x(x) {} |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 172 | |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 173 | T& get() { return x; } |
| 174 | const T& get() const { return x; } |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 175 | |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 176 | T x; |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 177 | }; |
| 178 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 179 | // Tuple getters -------------------------------------------------------------- |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 180 | // |
| 181 | // Allows accessing an arbitrary tuple element by index. |
| 182 | // |
| 183 | // Example usage: |
| 184 | // Tuple<int, double> t2; |
| 185 | // get<0>(t2) = 42; |
| 186 | // get<1>(t2) = 3.14; |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 187 | |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 188 | template <size_t I, typename T> |
| 189 | T& get(TupleLeaf<I, T>& leaf) { |
| 190 | return leaf.get(); |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 191 | } |
| 192 | |
mdempsky | f705f9f | 2014-12-10 20:22:23 +0900 | [diff] [blame] | 193 | template <size_t I, typename T> |
| 194 | const T& get(const TupleLeaf<I, T>& leaf) { |
| 195 | return leaf.get(); |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 196 | } |
| 197 | |
erg@google.com | e6ffcb5 | 2010-08-18 03:38:24 +0900 | [diff] [blame] | 198 | // Tuple types ---------------------------------------------------------------- |
| 199 | // |
| 200 | // Allows for selection of ValueTuple/RefTuple/ParamTuple without needing the |
| 201 | // definitions of class types the tuple takes as parameters. |
| 202 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 203 | template <typename T> |
| 204 | struct TupleTypes; |
erg@google.com | e6ffcb5 | 2010-08-18 03:38:24 +0900 | [diff] [blame] | 205 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 206 | template <typename... Ts> |
| 207 | struct TupleTypes<Tuple<Ts...>> { |
| 208 | using ValueTuple = Tuple<typename TupleTraits<Ts>::ValueType...>; |
| 209 | using RefTuple = Tuple<typename TupleTraits<Ts>::RefType...>; |
| 210 | using ParamTuple = Tuple<typename TupleTraits<Ts>::ParamType...>; |
erg@google.com | e6ffcb5 | 2010-08-18 03:38:24 +0900 | [diff] [blame] | 211 | }; |
| 212 | |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 213 | // Tuple creators ------------------------------------------------------------- |
| 214 | // |
| 215 | // Helper functions for constructing tuples while inferring the template |
| 216 | // argument types. |
| 217 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 218 | template <typename... Ts> |
| 219 | inline Tuple<Ts...> MakeTuple(const Ts&... arg) { |
| 220 | return Tuple<Ts...>(arg...); |
phajdan.jr@chromium.org | 5a468fc | 2010-07-21 01:56:26 +0900 | [diff] [blame] | 221 | } |
| 222 | |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 223 | // The following set of helpers make what Boost refers to as "Tiers" - a tuple |
| 224 | // of references. |
| 225 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 226 | template <typename... Ts> |
| 227 | inline Tuple<Ts&...> MakeRefTuple(Ts&... arg) { |
| 228 | return Tuple<Ts&...>(arg...); |
phajdan.jr@chromium.org | 5a468fc | 2010-07-21 01:56:26 +0900 | [diff] [blame] | 229 | } |
| 230 | |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 231 | // Dispatchers ---------------------------------------------------------------- |
| 232 | // |
| 233 | // Helper functions that call the given method on an object, with the unpacked |
| 234 | // tuple arguments. Notice that they all have the same number of arguments, |
| 235 | // so you need only write: |
| 236 | // DispatchToMethod(object, &Object::method, args); |
| 237 | // This is very useful for templated dispatchers, since they don't need to know |
| 238 | // what type |args| is. |
| 239 | |
| 240 | // Non-Static Dispatchers with no out params. |
| 241 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 242 | template <typename ObjT, typename Method, typename A> |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 243 | inline void DispatchToMethod(ObjT* obj, Method method, const A& arg) { |
rsleevi@chromium.org | 274c722 | 2013-06-27 21:48:02 +0900 | [diff] [blame] | 244 | (obj->*method)(base::internal::UnwrapTraits<A>::Unwrap(arg)); |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 245 | } |
| 246 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 247 | template <typename ObjT, typename Method, typename... Ts, size_t... Ns> |
| 248 | inline void DispatchToMethodImpl(ObjT* obj, |
| 249 | Method method, |
| 250 | const Tuple<Ts...>& arg, |
| 251 | IndexSequence<Ns...>) { |
| 252 | (obj->*method)(base::internal::UnwrapTraits<Ts>::Unwrap(get<Ns>(arg))...); |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 253 | } |
| 254 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 255 | template <typename ObjT, typename Method, typename... Ts> |
maruel@chromium.org | 8fe7adc | 2009-03-04 00:01:12 +0900 | [diff] [blame] | 256 | inline void DispatchToMethod(ObjT* obj, |
| 257 | Method method, |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 258 | const Tuple<Ts...>& arg) { |
| 259 | DispatchToMethodImpl(obj, method, arg, MakeIndexSequence<sizeof...(Ts)>()); |
noelutz@google.com | dd96ed8 | 2011-02-18 04:47:13 +0900 | [diff] [blame] | 260 | } |
| 261 | |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 262 | // Static Dispatchers with no out params. |
| 263 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 264 | template <typename Function, typename A> |
| 265 | inline void DispatchToMethod(Function function, const A& arg) { |
| 266 | (*function)(base::internal::UnwrapTraits<A>::Unwrap(arg)); |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 267 | } |
| 268 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 269 | template <typename Function, typename... Ts, size_t... Ns> |
| 270 | inline void DispatchToFunctionImpl(Function function, |
| 271 | const Tuple<Ts...>& arg, |
| 272 | IndexSequence<Ns...>) { |
| 273 | (*function)(base::internal::UnwrapTraits<Ts>::Unwrap(get<Ns>(arg))...); |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 274 | } |
| 275 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 276 | template <typename Function, typename... Ts> |
| 277 | inline void DispatchToFunction(Function function, const Tuple<Ts...>& arg) { |
| 278 | DispatchToFunctionImpl(function, arg, MakeIndexSequence<sizeof...(Ts)>()); |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 279 | } |
| 280 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 281 | // Dispatchers with out parameters. |
| 282 | |
| 283 | template <typename ObjT, |
| 284 | typename Method, |
| 285 | typename In, |
| 286 | typename... OutTs, |
| 287 | size_t... OutNs> |
| 288 | inline void DispatchToMethodImpl(ObjT* obj, |
| 289 | Method method, |
| 290 | const In& in, |
| 291 | Tuple<OutTs...>* out, |
| 292 | IndexSequence<OutNs...>) { |
| 293 | (obj->*method)(base::internal::UnwrapTraits<In>::Unwrap(in), |
| 294 | &get<OutNs>(*out)...); |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 295 | } |
| 296 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 297 | template <typename ObjT, typename Method, typename In, typename... OutTs> |
maruel@chromium.org | 8fe7adc | 2009-03-04 00:01:12 +0900 | [diff] [blame] | 298 | inline void DispatchToMethod(ObjT* obj, |
| 299 | Method method, |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 300 | const In& in, |
| 301 | Tuple<OutTs...>* out) { |
| 302 | DispatchToMethodImpl(obj, method, in, out, |
| 303 | MakeIndexSequence<sizeof...(OutTs)>()); |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 304 | } |
| 305 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 306 | template <typename ObjT, |
| 307 | typename Method, |
| 308 | typename... InTs, |
| 309 | typename... OutTs, |
| 310 | size_t... InNs, |
| 311 | size_t... OutNs> |
| 312 | inline void DispatchToMethodImpl(ObjT* obj, |
| 313 | Method method, |
| 314 | const Tuple<InTs...>& in, |
| 315 | Tuple<OutTs...>* out, |
| 316 | IndexSequence<InNs...>, |
| 317 | IndexSequence<OutNs...>) { |
| 318 | (obj->*method)(base::internal::UnwrapTraits<InTs>::Unwrap(get<InNs>(in))..., |
| 319 | &get<OutNs>(*out)...); |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 320 | } |
| 321 | |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 322 | template <typename ObjT, typename Method, typename... InTs, typename... OutTs> |
maruel@chromium.org | 8fe7adc | 2009-03-04 00:01:12 +0900 | [diff] [blame] | 323 | inline void DispatchToMethod(ObjT* obj, |
| 324 | Method method, |
mdempsky | 0c1d6ed | 2014-12-10 12:10:59 +0900 | [diff] [blame] | 325 | const Tuple<InTs...>& in, |
| 326 | Tuple<OutTs...>* out) { |
| 327 | DispatchToMethodImpl(obj, method, in, out, |
| 328 | MakeIndexSequence<sizeof...(InTs)>(), |
| 329 | MakeIndexSequence<sizeof...(OutTs)>()); |
ojan@google.com | 3835509 | 2008-10-10 06:58:05 +0900 | [diff] [blame] | 330 | } |
| 331 | |
tfarina | b6d62d8 | 2015-05-14 07:10:15 +0900 | [diff] [blame] | 332 | #endif // BASE_TUPLE_H_ |