Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(859)

Side by Side Diff: base/tuple.h

Issue 1095543003: Extend variadic template hack for /analyze. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // A Tuple is a generic templatized container, similar in concept to std::pair 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 6 // and std::tuple. The convenient MakeTuple() function takes any number of
7 // arguments and will construct and return the appropriate Tuple object. The 7 // arguments and will construct and return the appropriate Tuple object. The
8 // functions DispatchToMethod and DispatchToFunction take a function pointer or 8 // functions DispatchToMethod and DispatchToFunction take a function pointer or
9 // instance and method pointer, and unpack a tuple into arguments to the call. 9 // instance and method pointer, and unpack a tuple into arguments to the call.
10 // 10 //
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 }; 74 };
75 template <> struct MakeIndexSequenceImpl<9> { 75 template <> struct MakeIndexSequenceImpl<9> {
76 using Type = IndexSequence<0,1,2,3,4,5,6,7,8>; 76 using Type = IndexSequence<0,1,2,3,4,5,6,7,8>;
77 }; 77 };
78 template <> struct MakeIndexSequenceImpl<10> { 78 template <> struct MakeIndexSequenceImpl<10> {
79 using Type = IndexSequence<0,1,2,3,4,5,6,7,8,9>; 79 using Type = IndexSequence<0,1,2,3,4,5,6,7,8,9>;
80 }; 80 };
81 template <> struct MakeIndexSequenceImpl<11> { 81 template <> struct MakeIndexSequenceImpl<11> {
82 using Type = IndexSequence<0,1,2,3,4,5,6,7,8,9,10>; 82 using Type = IndexSequence<0,1,2,3,4,5,6,7,8,9,10>;
83 }; 83 };
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 };
84 90
85 #else // defined(WIN) && defined(_PREFAST_) 91 #else // defined(WIN) && defined(_PREFAST_)
86 92
87 template <size_t... Ns> 93 template <size_t... Ns>
88 struct MakeIndexSequenceImpl<0, Ns...> { 94 struct MakeIndexSequenceImpl<0, Ns...> {
89 using Type = IndexSequence<Ns...>; 95 using Type = IndexSequence<Ns...>;
90 }; 96 };
91 97
92 template <size_t N, size_t... Ns> 98 template <size_t N, size_t... Ns>
93 struct MakeIndexSequenceImpl<N, Ns...> 99 struct MakeIndexSequenceImpl<N, Ns...>
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 inline void DispatchToMethod(ObjT* obj, 323 inline void DispatchToMethod(ObjT* obj,
318 Method method, 324 Method method,
319 const Tuple<InTs...>& in, 325 const Tuple<InTs...>& in,
320 Tuple<OutTs...>* out) { 326 Tuple<OutTs...>* out) {
321 DispatchToMethodImpl(obj, method, in, out, 327 DispatchToMethodImpl(obj, method, in, out,
322 MakeIndexSequence<sizeof...(InTs)>(), 328 MakeIndexSequence<sizeof...(InTs)>(),
323 MakeIndexSequence<sizeof...(OutTs)>()); 329 MakeIndexSequence<sizeof...(OutTs)>());
324 } 330 }
325 331
326 #endif // BASE_TUPLE_H__ 332 #endif // BASE_TUPLE_H__
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698