1// Copyright 2005, Google Inc.
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions are
6// met:
7//
8//     * Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10//     * Redistributions in binary form must reproduce the above
11// copyright notice, this list of conditions and the following disclaimer
12// in the documentation and/or other materials provided with the
13// distribution.
14//     * Neither the name of Google Inc. nor the names of its
15// contributors may be used to endorse or promote products derived from
16// this software without specific prior written permission.
17//
18// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29//
30// Author: wan@google.com (Zhanyong Wan)
31//
32// The Google C++ Testing Framework (Google Test)
33//
34// This header file defines the public API for Google Test.  It should be
35// included by any test program that uses Google Test.
36//
37// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
38// leave some internal implementation details in this header file.
39// They are clearly marked by comments like this:
40//
41//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
42//
43// Such code is NOT meant to be used by a user directly, and is subject
44// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
45// program!
46//
47// Acknowledgment: Google Test borrowed the idea of automatic test
48// registration from Barthelemy Dagenais' (barthelemy@prologique.com)
49// easyUnit framework.
50
51#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
52#define GTEST_INCLUDE_GTEST_GTEST_H_
53
54#include <limits>
55#include <vector>
56
57// Copyright 2005, Google Inc.
58// All rights reserved.
59//
60// Redistribution and use in source and binary forms, with or without
61// modification, are permitted provided that the following conditions are
62// met:
63//
64//     * Redistributions of source code must retain the above copyright
65// notice, this list of conditions and the following disclaimer.
66//     * Redistributions in binary form must reproduce the above
67// copyright notice, this list of conditions and the following disclaimer
68// in the documentation and/or other materials provided with the
69// distribution.
70//     * Neither the name of Google Inc. nor the names of its
71// contributors may be used to endorse or promote products derived from
72// this software without specific prior written permission.
73//
74// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
75// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
76// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
77// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
78// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
79// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
80// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
81// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
82// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
83// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
84// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
85//
86// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
87//
88// The Google C++ Testing Framework (Google Test)
89//
90// This header file declares functions and macros used internally by
91// Google Test.  They are subject to change without notice.
92
93#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
94#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
95
96// Copyright 2005, Google Inc.
97// All rights reserved.
98//
99// Redistribution and use in source and binary forms, with or without
100// modification, are permitted provided that the following conditions are
101// met:
102//
103//     * Redistributions of source code must retain the above copyright
104// notice, this list of conditions and the following disclaimer.
105//     * Redistributions in binary form must reproduce the above
106// copyright notice, this list of conditions and the following disclaimer
107// in the documentation and/or other materials provided with the
108// distribution.
109//     * Neither the name of Google Inc. nor the names of its
110// contributors may be used to endorse or promote products derived from
111// this software without specific prior written permission.
112//
113// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
114// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
115// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
116// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
117// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
118// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
119// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
120// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
121// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
122// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
123// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
124//
125// Authors: wan@google.com (Zhanyong Wan)
126//
127// Low-level types and utilities for porting Google Test to various
128// platforms.  They are subject to change without notice.  DO NOT USE
129// THEM IN USER CODE.
130
131#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
132#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
133
134// The user can define the following macros in the build script to
135// control Google Test's behavior.  If the user doesn't define a macro
136// in this list, Google Test will define it.
137//
138//   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)
139//                              is/isn't available.
140//   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions
141//                              are enabled.
142//   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string
143//                              is/isn't available (some systems define
144//                              ::string, which is different to std::string).
145//   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
146//                              is/isn't available (some systems define
147//                              ::wstring, which is different to std::wstring).
148//   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>
149//                              is/isn't available.
150//   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't
151//                              enabled.
152//   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that
153//                              std::wstring does/doesn't work (Google Test can
154//                              be used where std::wstring is unavailable).
155//   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple
156//                              is/isn't available.
157//   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the
158//                              compiler supports Microsoft's "Structured
159//                              Exception Handling".
160//   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google
161//                              Test's own tr1 tuple implementation should be
162//                              used.  Unused when the user sets
163//                              GTEST_HAS_TR1_TUPLE to 0.
164//   GTEST_LINKED_AS_SHARED_LIBRARY
165//                            - Define to 1 when compiling tests that use
166//                              Google Test as a shared library (known as
167//                              DLL on Windows).
168//   GTEST_CREATE_SHARED_LIBRARY
169//                            - Define to 1 when compiling Google Test itself
170//                              as a shared library.
171
172// This header defines the following utilities:
173//
174// Macros indicating the current platform (defined to 1 if compiled on
175// the given platform; otherwise undefined):
176//   GTEST_OS_AIX      - IBM AIX
177//   GTEST_OS_CYGWIN   - Cygwin
178//   GTEST_OS_LINUX    - Linux
179//   GTEST_OS_MAC      - Mac OS X
180//   GTEST_OS_SOLARIS  - Sun Solaris
181//   GTEST_OS_SYMBIAN  - Symbian
182//   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)
183//     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
184//     GTEST_OS_WINDOWS_MINGW    - MinGW
185//     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile
186//   GTEST_OS_ZOS      - z/OS
187//
188// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
189// most stable support.  Since core members of the Google Test project
190// don't have access to other platforms, support for them may be less
191// stable.  If you notice any problems on your platform, please notify
192// googletestframework@googlegroups.com (patches for fixing them are
193// even more welcome!).
194//
195// Note that it is possible that none of the GTEST_OS_* macros are defined.
196//
197// Macros indicating available Google Test features (defined to 1 if
198// the corresponding feature is supported; otherwise undefined):
199//   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized
200//                            tests)
201//   GTEST_HAS_DEATH_TEST   - death tests
202//   GTEST_HAS_PARAM_TEST   - value-parameterized tests
203//   GTEST_HAS_TYPED_TEST   - typed tests
204//   GTEST_HAS_TYPED_TEST_P - type-parameterized tests
205//   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used.
206//   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
207//                            the above two are mutually exclusive.
208//   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
209//
210// Macros for basic C++ coding:
211//   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
212//   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a
213//                              variable don't have to be used.
214//   GTEST_DISALLOW_ASSIGN_   - disables operator=.
215//   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
216//   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.
217//
218// Synchronization:
219//   Mutex, MutexLock, ThreadLocal, GetThreadCount()
220//                  - synchronization primitives.
221//   GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
222//                         synchronization primitives have real implementations
223//                         and Google Test is thread-safe; or 0 otherwise.
224//
225// Template meta programming:
226//   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.
227//
228// Smart pointers:
229//   scoped_ptr     - as in TR2.
230//
231// Regular expressions:
232//   RE             - a simple regular expression class using the POSIX
233//                    Extended Regular Expression syntax.  Not available on
234//                    Windows.
235//
236// Logging:
237//   GTEST_LOG_()   - logs messages at the specified severity level.
238//   LogToStderr()  - directs all log messages to stderr.
239//   FlushInfoLog() - flushes informational log messages.
240//
241// Stdout and stderr capturing:
242//   CaptureStdout()     - starts capturing stdout.
243//   GetCapturedStdout() - stops capturing stdout and returns the captured
244//                         string.
245//   CaptureStderr()     - starts capturing stderr.
246//   GetCapturedStderr() - stops capturing stderr and returns the captured
247//                         string.
248//
249// Integer types:
250//   TypeWithSize   - maps an integer to a int type.
251//   Int32, UInt32, Int64, UInt64, TimeInMillis
252//                  - integers of known sizes.
253//   BiggestInt     - the biggest signed integer type.
254//
255// Command-line utilities:
256//   GTEST_FLAG()       - references a flag.
257//   GTEST_DECLARE_*()  - declares a flag.
258//   GTEST_DEFINE_*()   - defines a flag.
259//   GetArgvs()         - returns the command line as a vector of strings.
260//
261// Environment variable utilities:
262//   GetEnv()             - gets the value of an environment variable.
263//   BoolFromGTestEnv()   - parses a bool environment variable.
264//   Int32FromGTestEnv()  - parses an Int32 environment variable.
265//   StringFromGTestEnv() - parses a string environment variable.
266
267#include <stddef.h>  // For ptrdiff_t
268#include <stdlib.h>
269#include <stdio.h>
270#include <string.h>
271#ifndef _WIN32_WCE
272#include <sys/stat.h>
273#endif  // !_WIN32_WCE
274
275#include <iostream>  // NOLINT
276#include <sstream>  // NOLINT
277#include <string>  // NOLINT
278
279#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
280#define GTEST_FLAG_PREFIX_ "gtest_"
281#define GTEST_FLAG_PREFIX_DASH_ "gtest-"
282#define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
283#define GTEST_NAME_ "Google Test"
284#define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
285
286// Determines the version of gcc that is used to compile this.
287#ifdef __GNUC__
288// 40302 means version 4.3.2.
289#define GTEST_GCC_VER_ \
290    (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
291#endif  // __GNUC__
292
293// Determines the platform on which Google Test is compiled.
294#ifdef __CYGWIN__
295#define GTEST_OS_CYGWIN 1
296#elif defined __SYMBIAN32__
297#define GTEST_OS_SYMBIAN 1
298#elif defined _WIN32
299#define GTEST_OS_WINDOWS 1
300#ifdef _WIN32_WCE
301#define GTEST_OS_WINDOWS_MOBILE 1
302#elif defined(__MINGW__) || defined(__MINGW32__)
303#define GTEST_OS_WINDOWS_MINGW 1
304#else
305#define GTEST_OS_WINDOWS_DESKTOP 1
306#endif  // _WIN32_WCE
307#elif defined __APPLE__
308#define GTEST_OS_MAC 1
309#elif defined __linux__
310#define GTEST_OS_LINUX 1
311#elif defined __MVS__
312#define GTEST_OS_ZOS 1
313#elif defined(__sun) && defined(__SVR4)
314#define GTEST_OS_SOLARIS 1
315#elif defined(_AIX)
316#define GTEST_OS_AIX 1
317#endif  // __CYGWIN__
318
319#if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_SYMBIAN || \
320    GTEST_OS_SOLARIS || GTEST_OS_AIX
321
322// On some platforms, <regex.h> needs someone to define size_t, and
323// won't compile otherwise.  We can #include it here as we already
324// included <stdlib.h>, which is guaranteed to define size_t through
325// <stddef.h>.
326#include <regex.h>  // NOLINT
327#include <strings.h>  // NOLINT
328#include <sys/types.h>  // NOLINT
329#include <time.h>  // NOLINT
330#include <unistd.h>  // NOLINT
331
332#define GTEST_USES_POSIX_RE 1
333
334#elif GTEST_OS_WINDOWS
335
336#if !GTEST_OS_WINDOWS_MOBILE
337#include <direct.h>  // NOLINT
338#include <io.h>  // NOLINT
339#endif
340
341// <regex.h> is not available on Windows.  Use our own simple regex
342// implementation instead.
343#define GTEST_USES_SIMPLE_RE 1
344
345#else
346
347// <regex.h> may not be available on this platform.  Use our own
348// simple regex implementation instead.
349#define GTEST_USES_SIMPLE_RE 1
350
351#endif  // GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC ||
352        // GTEST_OS_SYMBIAN || GTEST_OS_SOLARIS || GTEST_OS_AIX
353
354#ifndef GTEST_HAS_EXCEPTIONS
355// The user didn't tell us whether exceptions are enabled, so we need
356// to figure it out.
357#if defined(_MSC_VER) || defined(__BORLANDC__)
358// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
359// macro to enable exceptions, so we'll do the same.
360// Assumes that exceptions are enabled by default.
361#ifndef _HAS_EXCEPTIONS
362#define _HAS_EXCEPTIONS 1
363#endif  // _HAS_EXCEPTIONS
364#define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
365#elif defined(__GNUC__) && __EXCEPTIONS
366// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
367#define GTEST_HAS_EXCEPTIONS 1
368#elif defined(__SUNPRO_CC)
369// Sun Pro CC supports exceptions.  However, there is no compile-time way of
370// detecting whether they are enabled or not.  Therefore, we assume that
371// they are enabled unless the user tells us otherwise.
372#define GTEST_HAS_EXCEPTIONS 1
373#elif defined(__IBMCPP__) && __EXCEPTIONS
374// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
375#define GTEST_HAS_EXCEPTIONS 1
376#else
377// For other compilers, we assume exceptions are disabled to be
378// conservative.
379#define GTEST_HAS_EXCEPTIONS 0
380#endif  // defined(_MSC_VER) || defined(__BORLANDC__)
381#endif  // GTEST_HAS_EXCEPTIONS
382
383#if !defined(GTEST_HAS_STD_STRING)
384// Even though we don't use this macro any longer, we keep it in case
385// some clients still depend on it.
386#define GTEST_HAS_STD_STRING 1
387#elif !GTEST_HAS_STD_STRING
388// The user told us that ::std::string isn't available.
389#error "Google Test cannot be used where ::std::string isn't available."
390#endif  // !defined(GTEST_HAS_STD_STRING)
391
392#ifndef GTEST_HAS_GLOBAL_STRING
393// The user didn't tell us whether ::string is available, so we need
394// to figure it out.
395
396#define GTEST_HAS_GLOBAL_STRING 0
397
398#endif  // GTEST_HAS_GLOBAL_STRING
399
400#ifndef GTEST_HAS_STD_WSTRING
401// The user didn't tell us whether ::std::wstring is available, so we need
402// to figure it out.
403// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
404//   is available.
405
406// Cygwin 1.5 and below doesn't support ::std::wstring.
407// Cygwin 1.7 might add wstring support; this should be updated when clear.
408// Solaris' libc++ doesn't support it either.
409#define GTEST_HAS_STD_WSTRING (!(GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
410
411#endif  // GTEST_HAS_STD_WSTRING
412
413#ifndef GTEST_HAS_GLOBAL_WSTRING
414// The user didn't tell us whether ::wstring is available, so we need
415// to figure it out.
416#define GTEST_HAS_GLOBAL_WSTRING \
417    (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
418#endif  // GTEST_HAS_GLOBAL_WSTRING
419
420// Determines whether RTTI is available.
421#ifndef GTEST_HAS_RTTI
422// The user didn't tell us whether RTTI is enabled, so we need to
423// figure it out.
424
425#ifdef _MSC_VER
426
427#ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.
428#define GTEST_HAS_RTTI 1
429#else
430#define GTEST_HAS_RTTI 0
431#endif
432
433// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
434#elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
435
436#ifdef __GXX_RTTI
437#define GTEST_HAS_RTTI 1
438#else
439#define GTEST_HAS_RTTI 0
440#endif  // __GXX_RTTI
441
442// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
443// both the typeid and dynamic_cast features are present.
444#elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
445
446#ifdef __RTTI_ALL__
447#define GTEST_HAS_RTTI 1
448#else
449#define GTEST_HAS_RTTI 0
450#endif
451
452#else
453
454// For all other compilers, we assume RTTI is enabled.
455#define GTEST_HAS_RTTI 1
456
457#endif  // _MSC_VER
458
459#endif  // GTEST_HAS_RTTI
460
461// It's this header's responsibility to #include <typeinfo> when RTTI
462// is enabled.
463#if GTEST_HAS_RTTI
464#include <typeinfo>
465#endif
466
467// Determines whether Google Test can use the pthreads library.
468#ifndef GTEST_HAS_PTHREAD
469// The user didn't tell us explicitly, so we assume pthreads support is
470// available on Linux and Mac.
471//
472// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
473// to your compiler flags.
474#define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC)
475#endif  // GTEST_HAS_PTHREAD
476
477// Determines whether Google Test can use tr1/tuple.  You can define
478// this macro to 0 to prevent Google Test from using tuple (any
479// feature depending on tuple with be disabled in this mode).
480#ifndef GTEST_HAS_TR1_TUPLE
481// The user didn't tell us not to do it, so we assume it's OK.
482#define GTEST_HAS_TR1_TUPLE 1
483#endif  // GTEST_HAS_TR1_TUPLE
484
485// Determines whether Google Test's own tr1 tuple implementation
486// should be used.
487#ifndef GTEST_USE_OWN_TR1_TUPLE
488// The user didn't tell us, so we need to figure it out.
489
490// We use our own TR1 tuple if we aren't sure the user has an
491// implementation of it already.  At this time, GCC 4.0.0+ and MSVC
492// 2010 are the only mainstream compilers that come with a TR1 tuple
493// implementation.  NVIDIA's CUDA NVCC compiler pretends to be GCC by
494// defining __GNUC__ and friends, but cannot compile GCC's tuple
495// implementation.  MSVC 2008 (9.0) provides TR1 tuple in a 323 MB
496// Feature Pack download, which we cannot assume the user has.
497#if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000)) \
498    || _MSC_VER >= 1600
499#define GTEST_USE_OWN_TR1_TUPLE 0
500#else
501#define GTEST_USE_OWN_TR1_TUPLE 1
502#endif
503
504#endif  // GTEST_USE_OWN_TR1_TUPLE
505
506// To avoid conditional compilation everywhere, we make it
507// gtest-port.h's responsibility to #include the header implementing
508// tr1/tuple.
509#if GTEST_HAS_TR1_TUPLE
510
511#if GTEST_USE_OWN_TR1_TUPLE
512// This file was GENERATED by a script.  DO NOT EDIT BY HAND!!!
513
514// Copyright 2009 Google Inc.
515// All Rights Reserved.
516//
517// Redistribution and use in source and binary forms, with or without
518// modification, are permitted provided that the following conditions are
519// met:
520//
521//     * Redistributions of source code must retain the above copyright
522// notice, this list of conditions and the following disclaimer.
523//     * Redistributions in binary form must reproduce the above
524// copyright notice, this list of conditions and the following disclaimer
525// in the documentation and/or other materials provided with the
526// distribution.
527//     * Neither the name of Google Inc. nor the names of its
528// contributors may be used to endorse or promote products derived from
529// this software without specific prior written permission.
530//
531// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
532// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
533// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
534// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
535// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
536// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
537// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
538// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
539// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
540// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
541// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
542//
543// Author: wan@google.com (Zhanyong Wan)
544
545// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
546
547#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
548#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
549
550#include <utility>  // For ::std::pair.
551
552// The compiler used in Symbian has a bug that prevents us from declaring the
553// tuple template as a friend (it complains that tuple is redefined).  This
554// hack bypasses the bug by declaring the members that should otherwise be
555// private as public.
556// Sun Studio versions < 12 also have the above bug.
557#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
558#define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
559#else
560#define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
561    template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
562   private:
563#endif
564
565// GTEST_n_TUPLE_(T) is the type of an n-tuple.
566#define GTEST_0_TUPLE_(T) tuple<>
567#define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
568    void, void, void>
569#define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
570    void, void, void>
571#define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
572    void, void, void>
573#define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
574    void, void, void>
575#define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
576    void, void, void>
577#define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
578    void, void, void>
579#define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
580    void, void, void>
581#define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
582    T##7, void, void>
583#define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
584    T##7, T##8, void>
585#define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
586    T##7, T##8, T##9>
587
588// GTEST_n_TYPENAMES_(T) declares a list of n typenames.
589#define GTEST_0_TYPENAMES_(T)
590#define GTEST_1_TYPENAMES_(T) typename T##0
591#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
592#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
593#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
594    typename T##3
595#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
596    typename T##3, typename T##4
597#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
598    typename T##3, typename T##4, typename T##5
599#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
600    typename T##3, typename T##4, typename T##5, typename T##6
601#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
602    typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
603#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
604    typename T##3, typename T##4, typename T##5, typename T##6, \
605    typename T##7, typename T##8
606#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
607    typename T##3, typename T##4, typename T##5, typename T##6, \
608    typename T##7, typename T##8, typename T##9
609
610// In theory, defining stuff in the ::std namespace is undefined
611// behavior.  We can do this as we are playing the role of a standard
612// library vendor.
613namespace std {
614namespace tr1 {
615
616template <typename T0 = void, typename T1 = void, typename T2 = void,
617    typename T3 = void, typename T4 = void, typename T5 = void,
618    typename T6 = void, typename T7 = void, typename T8 = void,
619    typename T9 = void>
620class tuple;
621
622// Anything in namespace gtest_internal is Google Test's INTERNAL
623// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
624namespace gtest_internal {
625
626// ByRef<T>::type is T if T is a reference; otherwise it's const T&.
627template <typename T>
628struct ByRef { typedef const T& type; };  // NOLINT
629template <typename T>
630struct ByRef<T&> { typedef T& type; };  // NOLINT
631
632// A handy wrapper for ByRef.
633#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
634
635// AddRef<T>::type is T if T is a reference; otherwise it's T&.  This
636// is the same as tr1::add_reference<T>::type.
637template <typename T>
638struct AddRef { typedef T& type; };  // NOLINT
639template <typename T>
640struct AddRef<T&> { typedef T& type; };  // NOLINT
641
642// A handy wrapper for AddRef.
643#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
644
645// A helper for implementing get<k>().
646template <int k> class Get;
647
648// A helper for implementing tuple_element<k, T>.  kIndexValid is true
649// iff k < the number of fields in tuple type T.
650template <bool kIndexValid, int kIndex, class Tuple>
651struct TupleElement;
652
653template <GTEST_10_TYPENAMES_(T)>
654struct TupleElement<true, 0, GTEST_10_TUPLE_(T)> { typedef T0 type; };
655
656template <GTEST_10_TYPENAMES_(T)>
657struct TupleElement<true, 1, GTEST_10_TUPLE_(T)> { typedef T1 type; };
658
659template <GTEST_10_TYPENAMES_(T)>
660struct TupleElement<true, 2, GTEST_10_TUPLE_(T)> { typedef T2 type; };
661
662template <GTEST_10_TYPENAMES_(T)>
663struct TupleElement<true, 3, GTEST_10_TUPLE_(T)> { typedef T3 type; };
664
665template <GTEST_10_TYPENAMES_(T)>
666struct TupleElement<true, 4, GTEST_10_TUPLE_(T)> { typedef T4 type; };
667
668template <GTEST_10_TYPENAMES_(T)>
669struct TupleElement<true, 5, GTEST_10_TUPLE_(T)> { typedef T5 type; };
670
671template <GTEST_10_TYPENAMES_(T)>
672struct TupleElement<true, 6, GTEST_10_TUPLE_(T)> { typedef T6 type; };
673
674template <GTEST_10_TYPENAMES_(T)>
675struct TupleElement<true, 7, GTEST_10_TUPLE_(T)> { typedef T7 type; };
676
677template <GTEST_10_TYPENAMES_(T)>
678struct TupleElement<true, 8, GTEST_10_TUPLE_(T)> { typedef T8 type; };
679
680template <GTEST_10_TYPENAMES_(T)>
681struct TupleElement<true, 9, GTEST_10_TUPLE_(T)> { typedef T9 type; };
682
683}  // namespace gtest_internal
684
685template <>
686class tuple<> {
687 public:
688  tuple() {}
689  tuple(const tuple& /* t */)  {}
690  tuple& operator=(const tuple& /* t */) { return *this; }
691};
692
693template <GTEST_1_TYPENAMES_(T)>
694class GTEST_1_TUPLE_(T) {
695 public:
696  template <int k> friend class gtest_internal::Get;
697
698  tuple() : f0_() {}
699
700  explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
701
702  tuple(const tuple& t) : f0_(t.f0_) {}
703
704  template <GTEST_1_TYPENAMES_(U)>
705  tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
706
707  tuple& operator=(const tuple& t) { return CopyFrom(t); }
708
709  template <GTEST_1_TYPENAMES_(U)>
710  tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
711    return CopyFrom(t);
712  }
713
714  GTEST_DECLARE_TUPLE_AS_FRIEND_
715
716  template <GTEST_1_TYPENAMES_(U)>
717  tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
718    f0_ = t.f0_;
719    return *this;
720  }
721
722  T0 f0_;
723};
724
725template <GTEST_2_TYPENAMES_(T)>
726class GTEST_2_TUPLE_(T) {
727 public:
728  template <int k> friend class gtest_internal::Get;
729
730  tuple() : f0_(), f1_() {}
731
732  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
733      f1_(f1) {}
734
735  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
736
737  template <GTEST_2_TYPENAMES_(U)>
738  tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
739  template <typename U0, typename U1>
740  tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
741
742  tuple& operator=(const tuple& t) { return CopyFrom(t); }
743
744  template <GTEST_2_TYPENAMES_(U)>
745  tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
746    return CopyFrom(t);
747  }
748  template <typename U0, typename U1>
749  tuple& operator=(const ::std::pair<U0, U1>& p) {
750    f0_ = p.first;
751    f1_ = p.second;
752    return *this;
753  }
754
755  GTEST_DECLARE_TUPLE_AS_FRIEND_
756
757  template <GTEST_2_TYPENAMES_(U)>
758  tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
759    f0_ = t.f0_;
760    f1_ = t.f1_;
761    return *this;
762  }
763
764  T0 f0_;
765  T1 f1_;
766};
767
768template <GTEST_3_TYPENAMES_(T)>
769class GTEST_3_TUPLE_(T) {
770 public:
771  template <int k> friend class gtest_internal::Get;
772
773  tuple() : f0_(), f1_(), f2_() {}
774
775  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
776      GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
777
778  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
779
780  template <GTEST_3_TYPENAMES_(U)>
781  tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
782
783  tuple& operator=(const tuple& t) { return CopyFrom(t); }
784
785  template <GTEST_3_TYPENAMES_(U)>
786  tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
787    return CopyFrom(t);
788  }
789
790  GTEST_DECLARE_TUPLE_AS_FRIEND_
791
792  template <GTEST_3_TYPENAMES_(U)>
793  tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
794    f0_ = t.f0_;
795    f1_ = t.f1_;
796    f2_ = t.f2_;
797    return *this;
798  }
799
800  T0 f0_;
801  T1 f1_;
802  T2 f2_;
803};
804
805template <GTEST_4_TYPENAMES_(T)>
806class GTEST_4_TUPLE_(T) {
807 public:
808  template <int k> friend class gtest_internal::Get;
809
810  tuple() : f0_(), f1_(), f2_(), f3_() {}
811
812  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
813      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
814      f3_(f3) {}
815
816  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
817
818  template <GTEST_4_TYPENAMES_(U)>
819  tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
820      f3_(t.f3_) {}
821
822  tuple& operator=(const tuple& t) { return CopyFrom(t); }
823
824  template <GTEST_4_TYPENAMES_(U)>
825  tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
826    return CopyFrom(t);
827  }
828
829  GTEST_DECLARE_TUPLE_AS_FRIEND_
830
831  template <GTEST_4_TYPENAMES_(U)>
832  tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
833    f0_ = t.f0_;
834    f1_ = t.f1_;
835    f2_ = t.f2_;
836    f3_ = t.f3_;
837    return *this;
838  }
839
840  T0 f0_;
841  T1 f1_;
842  T2 f2_;
843  T3 f3_;
844};
845
846template <GTEST_5_TYPENAMES_(T)>
847class GTEST_5_TUPLE_(T) {
848 public:
849  template <int k> friend class gtest_internal::Get;
850
851  tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
852
853  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
854      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
855      GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
856
857  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
858      f4_(t.f4_) {}
859
860  template <GTEST_5_TYPENAMES_(U)>
861  tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
862      f3_(t.f3_), f4_(t.f4_) {}
863
864  tuple& operator=(const tuple& t) { return CopyFrom(t); }
865
866  template <GTEST_5_TYPENAMES_(U)>
867  tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
868    return CopyFrom(t);
869  }
870
871  GTEST_DECLARE_TUPLE_AS_FRIEND_
872
873  template <GTEST_5_TYPENAMES_(U)>
874  tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
875    f0_ = t.f0_;
876    f1_ = t.f1_;
877    f2_ = t.f2_;
878    f3_ = t.f3_;
879    f4_ = t.f4_;
880    return *this;
881  }
882
883  T0 f0_;
884  T1 f1_;
885  T2 f2_;
886  T3 f3_;
887  T4 f4_;
888};
889
890template <GTEST_6_TYPENAMES_(T)>
891class GTEST_6_TUPLE_(T) {
892 public:
893  template <int k> friend class gtest_internal::Get;
894
895  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
896
897  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
898      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
899      GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
900      f5_(f5) {}
901
902  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
903      f4_(t.f4_), f5_(t.f5_) {}
904
905  template <GTEST_6_TYPENAMES_(U)>
906  tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
907      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
908
909  tuple& operator=(const tuple& t) { return CopyFrom(t); }
910
911  template <GTEST_6_TYPENAMES_(U)>
912  tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
913    return CopyFrom(t);
914  }
915
916  GTEST_DECLARE_TUPLE_AS_FRIEND_
917
918  template <GTEST_6_TYPENAMES_(U)>
919  tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
920    f0_ = t.f0_;
921    f1_ = t.f1_;
922    f2_ = t.f2_;
923    f3_ = t.f3_;
924    f4_ = t.f4_;
925    f5_ = t.f5_;
926    return *this;
927  }
928
929  T0 f0_;
930  T1 f1_;
931  T2 f2_;
932  T3 f3_;
933  T4 f4_;
934  T5 f5_;
935};
936
937template <GTEST_7_TYPENAMES_(T)>
938class GTEST_7_TUPLE_(T) {
939 public:
940  template <int k> friend class gtest_internal::Get;
941
942  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
943
944  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
945      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
946      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
947      f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
948
949  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
950      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
951
952  template <GTEST_7_TYPENAMES_(U)>
953  tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
954      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
955
956  tuple& operator=(const tuple& t) { return CopyFrom(t); }
957
958  template <GTEST_7_TYPENAMES_(U)>
959  tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
960    return CopyFrom(t);
961  }
962
963  GTEST_DECLARE_TUPLE_AS_FRIEND_
964
965  template <GTEST_7_TYPENAMES_(U)>
966  tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
967    f0_ = t.f0_;
968    f1_ = t.f1_;
969    f2_ = t.f2_;
970    f3_ = t.f3_;
971    f4_ = t.f4_;
972    f5_ = t.f5_;
973    f6_ = t.f6_;
974    return *this;
975  }
976
977  T0 f0_;
978  T1 f1_;
979  T2 f2_;
980  T3 f3_;
981  T4 f4_;
982  T5 f5_;
983  T6 f6_;
984};
985
986template <GTEST_8_TYPENAMES_(T)>
987class GTEST_8_TUPLE_(T) {
988 public:
989  template <int k> friend class gtest_internal::Get;
990
991  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
992
993  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
994      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
995      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
996      GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
997      f5_(f5), f6_(f6), f7_(f7) {}
998
999  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1000      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1001
1002  template <GTEST_8_TYPENAMES_(U)>
1003  tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1004      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1005
1006  tuple& operator=(const tuple& t) { return CopyFrom(t); }
1007
1008  template <GTEST_8_TYPENAMES_(U)>
1009  tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
1010    return CopyFrom(t);
1011  }
1012
1013  GTEST_DECLARE_TUPLE_AS_FRIEND_
1014
1015  template <GTEST_8_TYPENAMES_(U)>
1016  tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
1017    f0_ = t.f0_;
1018    f1_ = t.f1_;
1019    f2_ = t.f2_;
1020    f3_ = t.f3_;
1021    f4_ = t.f4_;
1022    f5_ = t.f5_;
1023    f6_ = t.f6_;
1024    f7_ = t.f7_;
1025    return *this;
1026  }
1027
1028  T0 f0_;
1029  T1 f1_;
1030  T2 f2_;
1031  T3 f3_;
1032  T4 f4_;
1033  T5 f5_;
1034  T6 f6_;
1035  T7 f7_;
1036};
1037
1038template <GTEST_9_TYPENAMES_(T)>
1039class GTEST_9_TUPLE_(T) {
1040 public:
1041  template <int k> friend class gtest_internal::Get;
1042
1043  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
1044
1045  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1046      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1047      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1048      GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1049      f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
1050
1051  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1052      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1053
1054  template <GTEST_9_TYPENAMES_(U)>
1055  tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1056      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1057
1058  tuple& operator=(const tuple& t) { return CopyFrom(t); }
1059
1060  template <GTEST_9_TYPENAMES_(U)>
1061  tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
1062    return CopyFrom(t);
1063  }
1064
1065  GTEST_DECLARE_TUPLE_AS_FRIEND_
1066
1067  template <GTEST_9_TYPENAMES_(U)>
1068  tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
1069    f0_ = t.f0_;
1070    f1_ = t.f1_;
1071    f2_ = t.f2_;
1072    f3_ = t.f3_;
1073    f4_ = t.f4_;
1074    f5_ = t.f5_;
1075    f6_ = t.f6_;
1076    f7_ = t.f7_;
1077    f8_ = t.f8_;
1078    return *this;
1079  }
1080
1081  T0 f0_;
1082  T1 f1_;
1083  T2 f2_;
1084  T3 f3_;
1085  T4 f4_;
1086  T5 f5_;
1087  T6 f6_;
1088  T7 f7_;
1089  T8 f8_;
1090};
1091
1092template <GTEST_10_TYPENAMES_(T)>
1093class tuple {
1094 public:
1095  template <int k> friend class gtest_internal::Get;
1096
1097  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
1098      f9_() {}
1099
1100  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1101      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1102      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1103      GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
1104      f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
1105
1106  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1107      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
1108
1109  template <GTEST_10_TYPENAMES_(U)>
1110  tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1111      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
1112      f9_(t.f9_) {}
1113
1114  tuple& operator=(const tuple& t) { return CopyFrom(t); }
1115
1116  template <GTEST_10_TYPENAMES_(U)>
1117  tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
1118    return CopyFrom(t);
1119  }
1120
1121  GTEST_DECLARE_TUPLE_AS_FRIEND_
1122
1123  template <GTEST_10_TYPENAMES_(U)>
1124  tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
1125    f0_ = t.f0_;
1126    f1_ = t.f1_;
1127    f2_ = t.f2_;
1128    f3_ = t.f3_;
1129    f4_ = t.f4_;
1130    f5_ = t.f5_;
1131    f6_ = t.f6_;
1132    f7_ = t.f7_;
1133    f8_ = t.f8_;
1134    f9_ = t.f9_;
1135    return *this;
1136  }
1137
1138  T0 f0_;
1139  T1 f1_;
1140  T2 f2_;
1141  T3 f3_;
1142  T4 f4_;
1143  T5 f5_;
1144  T6 f6_;
1145  T7 f7_;
1146  T8 f8_;
1147  T9 f9_;
1148};
1149
1150// 6.1.3.2 Tuple creation functions.
1151
1152// Known limitations: we don't support passing an
1153// std::tr1::reference_wrapper<T> to make_tuple().  And we don't
1154// implement tie().
1155
1156inline tuple<> make_tuple() { return tuple<>(); }
1157
1158template <GTEST_1_TYPENAMES_(T)>
1159inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
1160  return GTEST_1_TUPLE_(T)(f0);
1161}
1162
1163template <GTEST_2_TYPENAMES_(T)>
1164inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
1165  return GTEST_2_TUPLE_(T)(f0, f1);
1166}
1167
1168template <GTEST_3_TYPENAMES_(T)>
1169inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
1170  return GTEST_3_TUPLE_(T)(f0, f1, f2);
1171}
1172
1173template <GTEST_4_TYPENAMES_(T)>
1174inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1175    const T3& f3) {
1176  return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
1177}
1178
1179template <GTEST_5_TYPENAMES_(T)>
1180inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1181    const T3& f3, const T4& f4) {
1182  return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
1183}
1184
1185template <GTEST_6_TYPENAMES_(T)>
1186inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1187    const T3& f3, const T4& f4, const T5& f5) {
1188  return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
1189}
1190
1191template <GTEST_7_TYPENAMES_(T)>
1192inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1193    const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
1194  return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
1195}
1196
1197template <GTEST_8_TYPENAMES_(T)>
1198inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1199    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
1200  return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
1201}
1202
1203template <GTEST_9_TYPENAMES_(T)>
1204inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1205    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1206    const T8& f8) {
1207  return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
1208}
1209
1210template <GTEST_10_TYPENAMES_(T)>
1211inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1212    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1213    const T8& f8, const T9& f9) {
1214  return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
1215}
1216
1217// 6.1.3.3 Tuple helper classes.
1218
1219template <typename Tuple> struct tuple_size;
1220
1221template <GTEST_0_TYPENAMES_(T)>
1222struct tuple_size<GTEST_0_TUPLE_(T)> { static const int value = 0; };
1223
1224template <GTEST_1_TYPENAMES_(T)>
1225struct tuple_size<GTEST_1_TUPLE_(T)> { static const int value = 1; };
1226
1227template <GTEST_2_TYPENAMES_(T)>
1228struct tuple_size<GTEST_2_TUPLE_(T)> { static const int value = 2; };
1229
1230template <GTEST_3_TYPENAMES_(T)>
1231struct tuple_size<GTEST_3_TUPLE_(T)> { static const int value = 3; };
1232
1233template <GTEST_4_TYPENAMES_(T)>
1234struct tuple_size<GTEST_4_TUPLE_(T)> { static const int value = 4; };
1235
1236template <GTEST_5_TYPENAMES_(T)>
1237struct tuple_size<GTEST_5_TUPLE_(T)> { static const int value = 5; };
1238
1239template <GTEST_6_TYPENAMES_(T)>
1240struct tuple_size<GTEST_6_TUPLE_(T)> { static const int value = 6; };
1241
1242template <GTEST_7_TYPENAMES_(T)>
1243struct tuple_size<GTEST_7_TUPLE_(T)> { static const int value = 7; };
1244
1245template <GTEST_8_TYPENAMES_(T)>
1246struct tuple_size<GTEST_8_TUPLE_(T)> { static const int value = 8; };
1247
1248template <GTEST_9_TYPENAMES_(T)>
1249struct tuple_size<GTEST_9_TUPLE_(T)> { static const int value = 9; };
1250
1251template <GTEST_10_TYPENAMES_(T)>
1252struct tuple_size<GTEST_10_TUPLE_(T)> { static const int value = 10; };
1253
1254template <int k, class Tuple>
1255struct tuple_element {
1256  typedef typename gtest_internal::TupleElement<
1257      k < (tuple_size<Tuple>::value), k, Tuple>::type type;
1258};
1259
1260#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
1261
1262// 6.1.3.4 Element access.
1263
1264namespace gtest_internal {
1265
1266template <>
1267class Get<0> {
1268 public:
1269  template <class Tuple>
1270  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1271  Field(Tuple& t) { return t.f0_; }  // NOLINT
1272
1273  template <class Tuple>
1274  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1275  ConstField(const Tuple& t) { return t.f0_; }
1276};
1277
1278template <>
1279class Get<1> {
1280 public:
1281  template <class Tuple>
1282  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1283  Field(Tuple& t) { return t.f1_; }  // NOLINT
1284
1285  template <class Tuple>
1286  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1287  ConstField(const Tuple& t) { return t.f1_; }
1288};
1289
1290template <>
1291class Get<2> {
1292 public:
1293  template <class Tuple>
1294  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1295  Field(Tuple& t) { return t.f2_; }  // NOLINT
1296
1297  template <class Tuple>
1298  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1299  ConstField(const Tuple& t) { return t.f2_; }
1300};
1301
1302template <>
1303class Get<3> {
1304 public:
1305  template <class Tuple>
1306  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1307  Field(Tuple& t) { return t.f3_; }  // NOLINT
1308
1309  template <class Tuple>
1310  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1311  ConstField(const Tuple& t) { return t.f3_; }
1312};
1313
1314template <>
1315class Get<4> {
1316 public:
1317  template <class Tuple>
1318  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1319  Field(Tuple& t) { return t.f4_; }  // NOLINT
1320
1321  template <class Tuple>
1322  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1323  ConstField(const Tuple& t) { return t.f4_; }
1324};
1325
1326template <>
1327class Get<5> {
1328 public:
1329  template <class Tuple>
1330  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1331  Field(Tuple& t) { return t.f5_; }  // NOLINT
1332
1333  template <class Tuple>
1334  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1335  ConstField(const Tuple& t) { return t.f5_; }
1336};
1337
1338template <>
1339class Get<6> {
1340 public:
1341  template <class Tuple>
1342  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1343  Field(Tuple& t) { return t.f6_; }  // NOLINT
1344
1345  template <class Tuple>
1346  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1347  ConstField(const Tuple& t) { return t.f6_; }
1348};
1349
1350template <>
1351class Get<7> {
1352 public:
1353  template <class Tuple>
1354  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1355  Field(Tuple& t) { return t.f7_; }  // NOLINT
1356
1357  template <class Tuple>
1358  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1359  ConstField(const Tuple& t) { return t.f7_; }
1360};
1361
1362template <>
1363class Get<8> {
1364 public:
1365  template <class Tuple>
1366  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1367  Field(Tuple& t) { return t.f8_; }  // NOLINT
1368
1369  template <class Tuple>
1370  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1371  ConstField(const Tuple& t) { return t.f8_; }
1372};
1373
1374template <>
1375class Get<9> {
1376 public:
1377  template <class Tuple>
1378  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1379  Field(Tuple& t) { return t.f9_; }  // NOLINT
1380
1381  template <class Tuple>
1382  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1383  ConstField(const Tuple& t) { return t.f9_; }
1384};
1385
1386}  // namespace gtest_internal
1387
1388template <int k, GTEST_10_TYPENAMES_(T)>
1389GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1390get(GTEST_10_TUPLE_(T)& t) {
1391  return gtest_internal::Get<k>::Field(t);
1392}
1393
1394template <int k, GTEST_10_TYPENAMES_(T)>
1395GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))
1396get(const GTEST_10_TUPLE_(T)& t) {
1397  return gtest_internal::Get<k>::ConstField(t);
1398}
1399
1400// 6.1.3.5 Relational operators
1401
1402// We only implement == and !=, as we don't have a need for the rest yet.
1403
1404namespace gtest_internal {
1405
1406// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
1407// first k fields of t1 equals the first k fields of t2.
1408// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
1409// k1 != k2.
1410template <int kSize1, int kSize2>
1411struct SameSizeTuplePrefixComparator;
1412
1413template <>
1414struct SameSizeTuplePrefixComparator<0, 0> {
1415  template <class Tuple1, class Tuple2>
1416  static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
1417    return true;
1418  }
1419};
1420
1421template <int k>
1422struct SameSizeTuplePrefixComparator<k, k> {
1423  template <class Tuple1, class Tuple2>
1424  static bool Eq(const Tuple1& t1, const Tuple2& t2) {
1425    return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
1426        ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
1427  }
1428};
1429
1430}  // namespace gtest_internal
1431
1432template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1433inline bool operator==(const GTEST_10_TUPLE_(T)& t,
1434                       const GTEST_10_TUPLE_(U)& u) {
1435  return gtest_internal::SameSizeTuplePrefixComparator<
1436      tuple_size<GTEST_10_TUPLE_(T)>::value,
1437      tuple_size<GTEST_10_TUPLE_(U)>::value>::Eq(t, u);
1438}
1439
1440template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1441inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
1442                       const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
1443
1444// 6.1.4 Pairs.
1445// Unimplemented.
1446
1447}  // namespace tr1
1448}  // namespace std
1449
1450#undef GTEST_0_TUPLE_
1451#undef GTEST_1_TUPLE_
1452#undef GTEST_2_TUPLE_
1453#undef GTEST_3_TUPLE_
1454#undef GTEST_4_TUPLE_
1455#undef GTEST_5_TUPLE_
1456#undef GTEST_6_TUPLE_
1457#undef GTEST_7_TUPLE_
1458#undef GTEST_8_TUPLE_
1459#undef GTEST_9_TUPLE_
1460#undef GTEST_10_TUPLE_
1461
1462#undef GTEST_0_TYPENAMES_
1463#undef GTEST_1_TYPENAMES_
1464#undef GTEST_2_TYPENAMES_
1465#undef GTEST_3_TYPENAMES_
1466#undef GTEST_4_TYPENAMES_
1467#undef GTEST_5_TYPENAMES_
1468#undef GTEST_6_TYPENAMES_
1469#undef GTEST_7_TYPENAMES_
1470#undef GTEST_8_TYPENAMES_
1471#undef GTEST_9_TYPENAMES_
1472#undef GTEST_10_TYPENAMES_
1473
1474#undef GTEST_DECLARE_TUPLE_AS_FRIEND_
1475#undef GTEST_BY_REF_
1476#undef GTEST_ADD_REF_
1477#undef GTEST_TUPLE_ELEMENT_
1478
1479#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1480#elif GTEST_OS_SYMBIAN
1481
1482// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
1483// use STLport's tuple implementation, which unfortunately doesn't
1484// work as the copy of STLport distributed with Symbian is incomplete.
1485// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
1486// use its own tuple implementation.
1487#ifdef BOOST_HAS_TR1_TUPLE
1488#undef BOOST_HAS_TR1_TUPLE
1489#endif  // BOOST_HAS_TR1_TUPLE
1490
1491// This prevents <boost/tr1/detail/config.hpp>, which defines
1492// BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
1493#define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
1494#include <tuple>
1495
1496#elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
1497// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does
1498// not conform to the TR1 spec, which requires the header to be <tuple>.
1499
1500#if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1501// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
1502// which is #included by <tr1/tuple>, to not compile when RTTI is
1503// disabled.  _TR1_FUNCTIONAL is the header guard for
1504// <tr1/functional>.  Hence the following #define is a hack to prevent
1505// <tr1/functional> from being included.
1506#define _TR1_FUNCTIONAL 1
1507#include <tr1/tuple>
1508#undef _TR1_FUNCTIONAL  // Allows the user to #include
1509                        // <tr1/functional> if he chooses to.
1510#else
1511#include <tr1/tuple>  // NOLINT
1512#endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1513
1514#else
1515// If the compiler is not GCC 4.0+, we assume the user is using a
1516// spec-conforming TR1 implementation.
1517#include <tuple>  // NOLINT
1518#endif  // GTEST_USE_OWN_TR1_TUPLE
1519
1520#endif  // GTEST_HAS_TR1_TUPLE
1521
1522// Determines whether clone(2) is supported.
1523// Usually it will only be available on Linux, excluding
1524// Linux on the Itanium architecture.
1525// Also see http://linux.die.net/man/2/clone.
1526#ifndef GTEST_HAS_CLONE
1527// The user didn't tell us, so we need to figure it out.
1528
1529#if GTEST_OS_LINUX && !defined(__ia64__)
1530#define GTEST_HAS_CLONE 1
1531#else
1532#define GTEST_HAS_CLONE 0
1533#endif  // GTEST_OS_LINUX && !defined(__ia64__)
1534
1535#endif  // GTEST_HAS_CLONE
1536
1537// Determines whether to support stream redirection. This is used to test
1538// output correctness and to implement death tests.
1539#if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
1540#define GTEST_HAS_STREAM_REDIRECTION_ 1
1541#endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
1542
1543// Determines whether to support death tests.
1544// Google Test does not support death tests for VC 7.1 and earlier as
1545// abort() in a VC 7.1 application compiled as GUI in debug config
1546// pops up a dialog window that cannot be suppressed programmatically.
1547#if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
1548     (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
1549     GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX)
1550#define GTEST_HAS_DEATH_TEST 1
1551#include <vector>  // NOLINT
1552#endif
1553
1554// We don't support MSVC 7.1 with exceptions disabled now.  Therefore
1555// all the compilers we care about are adequate for supporting
1556// value-parameterized tests.
1557#define GTEST_HAS_PARAM_TEST 1
1558
1559// Determines whether to support type-driven tests.
1560
1561// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
1562// Sun Pro CC, and IBM Visual Age support.
1563#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
1564    defined(__IBMCPP__)
1565#define GTEST_HAS_TYPED_TEST 1
1566#define GTEST_HAS_TYPED_TEST_P 1
1567#endif
1568
1569// Determines whether to support Combine(). This only makes sense when
1570// value-parameterized tests are enabled.  The implementation doesn't
1571// work on Sun Studio since it doesn't understand templated conversion
1572// operators.
1573#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
1574#define GTEST_HAS_COMBINE 1
1575#endif
1576
1577// Determines whether the system compiler uses UTF-16 for encoding wide strings.
1578#define GTEST_WIDE_STRING_USES_UTF16_ \
1579    (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
1580
1581// Defines some utility macros.
1582
1583// The GNU compiler emits a warning if nested "if" statements are followed by
1584// an "else" statement and braces are not used to explicitly disambiguate the
1585// "else" binding.  This leads to problems with code like:
1586//
1587//   if (gate)
1588//     ASSERT_*(condition) << "Some message";
1589//
1590// The "switch (0) case 0:" idiom is used to suppress this.
1591#ifdef __INTEL_COMPILER
1592#define GTEST_AMBIGUOUS_ELSE_BLOCKER_
1593#else
1594#define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0:  // NOLINT
1595#endif
1596
1597// Use this annotation at the end of a struct/class definition to
1598// prevent the compiler from optimizing away instances that are never
1599// used.  This is useful when all interesting logic happens inside the
1600// c'tor and / or d'tor.  Example:
1601//
1602//   struct Foo {
1603//     Foo() { ... }
1604//   } GTEST_ATTRIBUTE_UNUSED_;
1605//
1606// Also use it after a variable or parameter declaration to tell the
1607// compiler the variable/parameter does not have to be used.
1608#if defined(__GNUC__) && !defined(COMPILER_ICC)
1609#define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
1610#else
1611#define GTEST_ATTRIBUTE_UNUSED_
1612#endif
1613
1614// A macro to disallow operator=
1615// This should be used in the private: declarations for a class.
1616#define GTEST_DISALLOW_ASSIGN_(type)\
1617  void operator=(type const &)
1618
1619// A macro to disallow copy constructor and operator=
1620// This should be used in the private: declarations for a class.
1621#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
1622  type(type const &);\
1623  GTEST_DISALLOW_ASSIGN_(type)
1624
1625// Tell the compiler to warn about unused return values for functions declared
1626// with this macro.  The macro should be used on function declarations
1627// following the argument list:
1628//
1629//   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
1630#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
1631#define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
1632#else
1633#define GTEST_MUST_USE_RESULT_
1634#endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
1635
1636// Determine whether the compiler supports Microsoft's Structured Exception
1637// Handling.  This is supported by several Windows compilers but generally
1638// does not exist on any other system.
1639#ifndef GTEST_HAS_SEH
1640// The user didn't tell us, so we need to figure it out.
1641
1642#if defined(_MSC_VER) || defined(__BORLANDC__)
1643// These two compilers are known to support SEH.
1644#define GTEST_HAS_SEH 1
1645#else
1646// Assume no SEH.
1647#define GTEST_HAS_SEH 0
1648#endif
1649
1650#endif  // GTEST_HAS_SEH
1651
1652#ifdef _MSC_VER
1653
1654#if GTEST_LINKED_AS_SHARED_LIBRARY
1655#define GTEST_API_ __declspec(dllimport)
1656#elif GTEST_CREATE_SHARED_LIBRARY
1657#define GTEST_API_ __declspec(dllexport)
1658#endif
1659
1660#endif  // _MSC_VER
1661
1662#ifndef GTEST_API_
1663#define GTEST_API_
1664#endif
1665
1666namespace testing {
1667
1668class Message;
1669
1670namespace internal {
1671
1672class String;
1673
1674typedef ::std::stringstream StrStream;
1675
1676// A helper for suppressing warnings on constant condition.  It just
1677// returns 'condition'.
1678GTEST_API_ bool IsTrue(bool condition);
1679
1680// Defines scoped_ptr.
1681
1682// This implementation of scoped_ptr is PARTIAL - it only contains
1683// enough stuff to satisfy Google Test's need.
1684template <typename T>
1685class scoped_ptr {
1686 public:
1687  typedef T element_type;
1688
1689  explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
1690  ~scoped_ptr() { reset(); }
1691
1692  T& operator*() const { return *ptr_; }
1693  T* operator->() const { return ptr_; }
1694  T* get() const { return ptr_; }
1695
1696  T* release() {
1697    T* const ptr = ptr_;
1698    ptr_ = NULL;
1699    return ptr;
1700  }
1701
1702  void reset(T* p = NULL) {
1703    if (p != ptr_) {
1704      if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.
1705        delete ptr_;
1706      }
1707      ptr_ = p;
1708    }
1709  }
1710 private:
1711  T* ptr_;
1712
1713  GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
1714};
1715
1716// Defines RE.
1717
1718// A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended
1719// Regular Expression syntax.
1720class GTEST_API_ RE {
1721 public:
1722  // A copy constructor is required by the Standard to initialize object
1723  // references from r-values.
1724  RE(const RE& other) { Init(other.pattern()); }
1725
1726  // Constructs an RE from a string.
1727  RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT
1728
1729#if GTEST_HAS_GLOBAL_STRING
1730  RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT
1731#endif  // GTEST_HAS_GLOBAL_STRING
1732
1733  RE(const char* regex) { Init(regex); }  // NOLINT
1734  ~RE();
1735
1736  // Returns the string representation of the regex.
1737  const char* pattern() const { return pattern_; }
1738
1739  // FullMatch(str, re) returns true iff regular expression re matches
1740  // the entire str.
1741  // PartialMatch(str, re) returns true iff regular expression re
1742  // matches a substring of str (including str itself).
1743  //
1744  // TODO(wan@google.com): make FullMatch() and PartialMatch() work
1745  // when str contains NUL characters.
1746  static bool FullMatch(const ::std::string& str, const RE& re) {
1747    return FullMatch(str.c_str(), re);
1748  }
1749  static bool PartialMatch(const ::std::string& str, const RE& re) {
1750    return PartialMatch(str.c_str(), re);
1751  }
1752
1753#if GTEST_HAS_GLOBAL_STRING
1754  static bool FullMatch(const ::string& str, const RE& re) {
1755    return FullMatch(str.c_str(), re);
1756  }
1757  static bool PartialMatch(const ::string& str, const RE& re) {
1758    return PartialMatch(str.c_str(), re);
1759  }
1760#endif  // GTEST_HAS_GLOBAL_STRING
1761
1762  static bool FullMatch(const char* str, const RE& re);
1763  static bool PartialMatch(const char* str, const RE& re);
1764
1765 private:
1766  void Init(const char* regex);
1767
1768  // We use a const char* instead of a string, as Google Test may be used
1769  // where string is not available.  We also do not use Google Test's own
1770  // String type here, in order to simplify dependencies between the
1771  // files.
1772  const char* pattern_;
1773  bool is_valid_;
1774#if GTEST_USES_POSIX_RE
1775  regex_t full_regex_;     // For FullMatch().
1776  regex_t partial_regex_;  // For PartialMatch().
1777#else  // GTEST_USES_SIMPLE_RE
1778  const char* full_pattern_;  // For FullMatch();
1779#endif
1780
1781  GTEST_DISALLOW_ASSIGN_(RE);
1782};
1783
1784// Defines logging utilities:
1785//   GTEST_LOG_(severity) - logs messages at the specified severity level. The
1786//                          message itself is streamed into the macro.
1787//   LogToStderr()  - directs all log messages to stderr.
1788//   FlushInfoLog() - flushes informational log messages.
1789
1790enum GTestLogSeverity {
1791  GTEST_INFO,
1792  GTEST_WARNING,
1793  GTEST_ERROR,
1794  GTEST_FATAL
1795};
1796
1797// Formats log entry severity, provides a stream object for streaming the
1798// log message, and terminates the message with a newline when going out of
1799// scope.
1800class GTEST_API_ GTestLog {
1801 public:
1802  GTestLog(GTestLogSeverity severity, const char* file, int line);
1803
1804  // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
1805  ~GTestLog();
1806
1807  ::std::ostream& GetStream() { return ::std::cerr; }
1808
1809 private:
1810  const GTestLogSeverity severity_;
1811
1812  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
1813};
1814
1815#define GTEST_LOG_(severity) \
1816    ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
1817                                  __FILE__, __LINE__).GetStream()
1818
1819inline void LogToStderr() {}
1820inline void FlushInfoLog() { fflush(NULL); }
1821
1822// INTERNAL IMPLEMENTATION - DO NOT USE.
1823//
1824// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
1825// is not satisfied.
1826//  Synopsys:
1827//    GTEST_CHECK_(boolean_condition);
1828//     or
1829//    GTEST_CHECK_(boolean_condition) << "Additional message";
1830//
1831//    This checks the condition and if the condition is not satisfied
1832//    it prints message about the condition violation, including the
1833//    condition itself, plus additional message streamed into it, if any,
1834//    and then it aborts the program. It aborts the program irrespective of
1835//    whether it is built in the debug mode or not.
1836#define GTEST_CHECK_(condition) \
1837    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
1838    if (::testing::internal::IsTrue(condition)) \
1839      ; \
1840    else \
1841      GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
1842
1843// An all-mode assert to verify that the given POSIX-style function
1844// call returns 0 (indicating success).  Known limitation: this
1845// doesn't expand to a balanced 'if' statement, so enclose the macro
1846// in {} if you need to use it as the only statement in an 'if'
1847// branch.
1848#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
1849  if (const int gtest_error = (posix_call)) \
1850    GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
1851                      << gtest_error
1852
1853// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
1854//
1855// Downcasts the pointer of type Base to Derived.
1856// Derived must be a subclass of Base. The parameter MUST
1857// point to a class of type Derived, not any subclass of it.
1858// When RTTI is available, the function performs a runtime
1859// check to enforce this.
1860template <class Derived, class Base>
1861Derived* CheckedDowncastToActualType(Base* base) {
1862#if GTEST_HAS_RTTI
1863  GTEST_CHECK_(typeid(*base) == typeid(Derived));
1864  return dynamic_cast<Derived*>(base);  // NOLINT
1865#else
1866  return static_cast<Derived*>(base);  // Poor man's downcast.
1867#endif
1868}
1869
1870#if GTEST_HAS_STREAM_REDIRECTION_
1871
1872// Defines the stderr capturer:
1873//   CaptureStdout     - starts capturing stdout.
1874//   GetCapturedStdout - stops capturing stdout and returns the captured string.
1875//   CaptureStderr     - starts capturing stderr.
1876//   GetCapturedStderr - stops capturing stderr and returns the captured string.
1877//
1878GTEST_API_ void CaptureStdout();
1879GTEST_API_ String GetCapturedStdout();
1880GTEST_API_ void CaptureStderr();
1881GTEST_API_ String GetCapturedStderr();
1882
1883#endif  // GTEST_HAS_STREAM_REDIRECTION_
1884
1885
1886#if GTEST_HAS_DEATH_TEST
1887
1888// A copy of all command line arguments.  Set by InitGoogleTest().
1889extern ::std::vector<String> g_argvs;
1890
1891// GTEST_HAS_DEATH_TEST implies we have ::std::string.
1892const ::std::vector<String>& GetArgvs();
1893
1894#endif  // GTEST_HAS_DEATH_TEST
1895
1896// Defines synchronization primitives.
1897
1898#if GTEST_HAS_PTHREAD
1899
1900// Sleeps for (roughly) n milli-seconds.  This function is only for
1901// testing Google Test's own constructs.  Don't use it in user tests,
1902// either directly or indirectly.
1903inline void SleepMilliseconds(int n) {
1904  const timespec time = {
1905    0,                  // 0 seconds.
1906    n * 1000L * 1000L,  // And n ms.
1907  };
1908  nanosleep(&time, NULL);
1909}
1910
1911// Allows a controller thread to pause execution of newly created
1912// threads until notified.  Instances of this class must be created
1913// and destroyed in the controller thread.
1914//
1915// This class is only for testing Google Test's own constructs. Do not
1916// use it in user tests, either directly or indirectly.
1917class Notification {
1918 public:
1919  Notification() : notified_(false) {}
1920
1921  // Notifies all threads created with this notification to start. Must
1922  // be called from the controller thread.
1923  void Notify() { notified_ = true; }
1924
1925  // Blocks until the controller thread notifies. Must be called from a test
1926  // thread.
1927  void WaitForNotification() {
1928    while(!notified_) {
1929      SleepMilliseconds(10);
1930    }
1931  }
1932
1933 private:
1934  volatile bool notified_;
1935
1936  GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
1937};
1938
1939// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
1940// Consequently, it cannot select a correct instantiation of ThreadWithParam
1941// in order to call its Run(). Introducing ThreadWithParamBase as a
1942// non-templated base class for ThreadWithParam allows us to bypass this
1943// problem.
1944class ThreadWithParamBase {
1945 public:
1946  virtual ~ThreadWithParamBase() {}
1947  virtual void Run() = 0;
1948};
1949
1950// pthread_create() accepts a pointer to a function type with the C linkage.
1951// According to the Standard (7.5/1), function types with different linkages
1952// are different even if they are otherwise identical.  Some compilers (for
1953// example, SunStudio) treat them as different types.  Since class methods
1954// cannot be defined with C-linkage we need to define a free C-function to
1955// pass into pthread_create().
1956extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
1957  static_cast<ThreadWithParamBase*>(thread)->Run();
1958  return NULL;
1959}
1960
1961// Helper class for testing Google Test's multi-threading constructs.
1962// To use it, write:
1963//
1964//   void ThreadFunc(int param) { /* Do things with param */ }
1965//   Notification thread_can_start;
1966//   ...
1967//   // The thread_can_start parameter is optional; you can supply NULL.
1968//   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
1969//   thread_can_start.Notify();
1970//
1971// These classes are only for testing Google Test's own constructs. Do
1972// not use them in user tests, either directly or indirectly.
1973template <typename T>
1974class ThreadWithParam : public ThreadWithParamBase {
1975 public:
1976  typedef void (*UserThreadFunc)(T);
1977
1978  ThreadWithParam(
1979      UserThreadFunc func, T param, Notification* thread_can_start)
1980      : func_(func),
1981        param_(param),
1982        thread_can_start_(thread_can_start),
1983        finished_(false) {
1984    ThreadWithParamBase* const base = this;
1985    // The thread can be created only after all fields except thread_
1986    // have been initialized.
1987    GTEST_CHECK_POSIX_SUCCESS_(
1988        pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
1989  }
1990  ~ThreadWithParam() { Join(); }
1991
1992  void Join() {
1993    if (!finished_) {
1994      GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
1995      finished_ = true;
1996    }
1997  }
1998
1999  virtual void Run() {
2000    if (thread_can_start_ != NULL)
2001      thread_can_start_->WaitForNotification();
2002    func_(param_);
2003  }
2004
2005 private:
2006  const UserThreadFunc func_;  // User-supplied thread function.
2007  const T param_;  // User-supplied parameter to the thread function.
2008  // When non-NULL, used to block execution until the controller thread
2009  // notifies.
2010  Notification* const thread_can_start_;
2011  bool finished_;  // true iff we know that the thread function has finished.
2012  pthread_t thread_;  // The native thread object.
2013
2014  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
2015};
2016
2017// gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
2018// true.
2019#include <pthread.h>
2020
2021// MutexBase and Mutex implement mutex on pthreads-based platforms. They
2022// are used in conjunction with class MutexLock:
2023//
2024//   Mutex mutex;
2025//   ...
2026//   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the end
2027//                            // of the current scope.
2028//
2029// MutexBase implements behavior for both statically and dynamically
2030// allocated mutexes.  Do not use MutexBase directly.  Instead, write
2031// the following to define a static mutex:
2032//
2033//   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
2034//
2035// You can forward declare a static mutex like this:
2036//
2037//   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
2038//
2039// To create a dynamic mutex, just define an object of type Mutex.
2040class MutexBase {
2041 public:
2042  // Acquires this mutex.
2043  void Lock() {
2044    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
2045    owner_ = pthread_self();
2046  }
2047
2048  // Releases this mutex.
2049  void Unlock() {
2050    // We don't protect writing to owner_ here, as it's the caller's
2051    // responsibility to ensure that the current thread holds the
2052    // mutex when this is called.
2053    owner_ = 0;
2054    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
2055  }
2056
2057  // Does nothing if the current thread holds the mutex. Otherwise, crashes
2058  // with high probability.
2059  void AssertHeld() const {
2060    GTEST_CHECK_(owner_ == pthread_self())
2061        << "The current thread is not holding the mutex @" << this;
2062  }
2063
2064  // A static mutex may be used before main() is entered.  It may even
2065  // be used before the dynamic initialization stage.  Therefore we
2066  // must be able to initialize a static mutex object at link time.
2067  // This means MutexBase has to be a POD and its member variables
2068  // have to be public.
2069 public:
2070  pthread_mutex_t mutex_;  // The underlying pthread mutex.
2071  pthread_t owner_;  // The thread holding the mutex; 0 means no one holds it.
2072};
2073
2074// Forward-declares a static mutex.
2075#define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2076    extern ::testing::internal::MutexBase mutex
2077
2078// Defines and statically (i.e. at link time) initializes a static mutex.
2079#define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
2080    ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, 0 }
2081
2082// The Mutex class can only be used for mutexes created at runtime. It
2083// shares its API with MutexBase otherwise.
2084class Mutex : public MutexBase {
2085 public:
2086  Mutex() {
2087    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2088    owner_ = 0;
2089  }
2090  ~Mutex() {
2091    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
2092  }
2093
2094 private:
2095  GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
2096};
2097
2098// We cannot name this class MutexLock as the ctor declaration would
2099// conflict with a macro named MutexLock, which is defined on some
2100// platforms.  Hence the typedef trick below.
2101class GTestMutexLock {
2102 public:
2103  explicit GTestMutexLock(MutexBase* mutex)
2104      : mutex_(mutex) { mutex_->Lock(); }
2105
2106  ~GTestMutexLock() { mutex_->Unlock(); }
2107
2108 private:
2109  MutexBase* const mutex_;
2110
2111  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
2112};
2113
2114typedef GTestMutexLock MutexLock;
2115
2116// Helpers for ThreadLocal.
2117
2118// pthread_key_create() requires DeleteThreadLocalValue() to have
2119// C-linkage.  Therefore it cannot be templatized to access
2120// ThreadLocal<T>.  Hence the need for class
2121// ThreadLocalValueHolderBase.
2122class ThreadLocalValueHolderBase {
2123 public:
2124  virtual ~ThreadLocalValueHolderBase() {}
2125};
2126
2127// Called by pthread to delete thread-local data stored by
2128// pthread_setspecific().
2129extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
2130  delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
2131}
2132
2133// Implements thread-local storage on pthreads-based systems.
2134//
2135//   // Thread 1
2136//   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.
2137//
2138//   // Thread 2
2139//   tl.set(150);  // Changes the value for thread 2 only.
2140//   EXPECT_EQ(150, tl.get());
2141//
2142//   // Thread 1
2143//   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.
2144//   tl.set(200);
2145//   EXPECT_EQ(200, tl.get());
2146//
2147// The template type argument T must have a public copy constructor.
2148// In addition, the default ThreadLocal constructor requires T to have
2149// a public default constructor.
2150//
2151// An object managed for a thread by a ThreadLocal instance is deleted
2152// when the thread exits.  Or, if the ThreadLocal instance dies in
2153// that thread, when the ThreadLocal dies.  It's the user's
2154// responsibility to ensure that all other threads using a ThreadLocal
2155// have exited when it dies, or the per-thread objects for those
2156// threads will not be deleted.
2157//
2158// Google Test only uses global ThreadLocal objects.  That means they
2159// will die after main() has returned.  Therefore, no per-thread
2160// object managed by Google Test will be leaked as long as all threads
2161// using Google Test have exited when main() returns.
2162template <typename T>
2163class ThreadLocal {
2164 public:
2165  ThreadLocal() : key_(CreateKey()),
2166                  default_() {}
2167  explicit ThreadLocal(const T& value) : key_(CreateKey()),
2168                                         default_(value) {}
2169
2170  ~ThreadLocal() {
2171    // Destroys the managed object for the current thread, if any.
2172    DeleteThreadLocalValue(pthread_getspecific(key_));
2173
2174    // Releases resources associated with the key.  This will *not*
2175    // delete managed objects for other threads.
2176    GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
2177  }
2178
2179  T* pointer() { return GetOrCreateValue(); }
2180  const T* pointer() const { return GetOrCreateValue(); }
2181  const T& get() const { return *pointer(); }
2182  void set(const T& value) { *pointer() = value; }
2183
2184 private:
2185  // Holds a value of type T.
2186  class ValueHolder : public ThreadLocalValueHolderBase {
2187   public:
2188    explicit ValueHolder(const T& value) : value_(value) {}
2189
2190    T* pointer() { return &value_; }
2191
2192   private:
2193    T value_;
2194    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
2195  };
2196
2197  static pthread_key_t CreateKey() {
2198    pthread_key_t key;
2199    // When a thread exits, DeleteThreadLocalValue() will be called on
2200    // the object managed for that thread.
2201    GTEST_CHECK_POSIX_SUCCESS_(
2202        pthread_key_create(&key, &DeleteThreadLocalValue));
2203    return key;
2204  }
2205
2206  T* GetOrCreateValue() const {
2207    ThreadLocalValueHolderBase* const holder =
2208        static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
2209    if (holder != NULL) {
2210      return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
2211    }
2212
2213    ValueHolder* const new_holder = new ValueHolder(default_);
2214    ThreadLocalValueHolderBase* const holder_base = new_holder;
2215    GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
2216    return new_holder->pointer();
2217  }
2218
2219  // A key pthreads uses for looking up per-thread values.
2220  const pthread_key_t key_;
2221  const T default_;  // The default value for each thread.
2222
2223  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
2224};
2225
2226#define GTEST_IS_THREADSAFE 1
2227
2228#else  // GTEST_HAS_PTHREAD
2229
2230// A dummy implementation of synchronization primitives (mutex, lock,
2231// and thread-local variable).  Necessary for compiling Google Test where
2232// mutex is not supported - using Google Test in multiple threads is not
2233// supported on such platforms.
2234
2235class Mutex {
2236 public:
2237  Mutex() {}
2238  void AssertHeld() const {}
2239};
2240
2241#define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2242  extern ::testing::internal::Mutex mutex
2243
2244#define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
2245
2246class GTestMutexLock {
2247 public:
2248  explicit GTestMutexLock(Mutex*) {}  // NOLINT
2249};
2250
2251typedef GTestMutexLock MutexLock;
2252
2253template <typename T>
2254class ThreadLocal {
2255 public:
2256  ThreadLocal() : value_() {}
2257  explicit ThreadLocal(const T& value) : value_(value) {}
2258  T* pointer() { return &value_; }
2259  const T* pointer() const { return &value_; }
2260  const T& get() const { return value_; }
2261  void set(const T& value) { value_ = value; }
2262 private:
2263  T value_;
2264};
2265
2266// The above synchronization primitives have dummy implementations.
2267// Therefore Google Test is not thread-safe.
2268#define GTEST_IS_THREADSAFE 0
2269
2270#endif  // GTEST_HAS_PTHREAD
2271
2272// Returns the number of threads running in the process, or 0 to indicate that
2273// we cannot detect it.
2274GTEST_API_ size_t GetThreadCount();
2275
2276// Passing non-POD classes through ellipsis (...) crashes the ARM
2277// compiler and generates a warning in Sun Studio.  The Nokia Symbian
2278// and the IBM XL C/C++ compiler try to instantiate a copy constructor
2279// for objects passed through ellipsis (...), failing for uncopyable
2280// objects.  We define this to ensure that only POD is passed through
2281// ellipsis on these systems.
2282#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
2283// We lose support for NULL detection where the compiler doesn't like
2284// passing non-POD classes through ellipsis (...).
2285#define GTEST_ELLIPSIS_NEEDS_POD_ 1
2286#else
2287#define GTEST_CAN_COMPARE_NULL 1
2288#endif
2289
2290// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
2291// const T& and const T* in a function template.  These compilers
2292// _can_ decide between class template specializations for T and T*,
2293// so a tr1::type_traits-like is_pointer works.
2294#if defined(__SYMBIAN32__) || defined(__IBMCPP__)
2295#define GTEST_NEEDS_IS_POINTER_ 1
2296#endif
2297
2298template <bool bool_value>
2299struct bool_constant {
2300  typedef bool_constant<bool_value> type;
2301  static const bool value = bool_value;
2302};
2303template <bool bool_value> const bool bool_constant<bool_value>::value;
2304
2305typedef bool_constant<false> false_type;
2306typedef bool_constant<true> true_type;
2307
2308template <typename T>
2309struct is_pointer : public false_type {};
2310
2311template <typename T>
2312struct is_pointer<T*> : public true_type {};
2313
2314#if GTEST_OS_WINDOWS
2315#define GTEST_PATH_SEP_ "\\"
2316#define GTEST_HAS_ALT_PATH_SEP_ 1
2317// The biggest signed integer type the compiler supports.
2318typedef __int64 BiggestInt;
2319#else
2320#define GTEST_PATH_SEP_ "/"
2321#define GTEST_HAS_ALT_PATH_SEP_ 0
2322typedef long long BiggestInt;  // NOLINT
2323#endif  // GTEST_OS_WINDOWS
2324
2325// The testing::internal::posix namespace holds wrappers for common
2326// POSIX functions.  These wrappers hide the differences between
2327// Windows/MSVC and POSIX systems.  Since some compilers define these
2328// standard functions as macros, the wrapper cannot have the same name
2329// as the wrapped function.
2330
2331namespace posix {
2332
2333// Functions with a different name on Windows.
2334
2335#if GTEST_OS_WINDOWS
2336
2337typedef struct _stat StatStruct;
2338
2339#ifdef __BORLANDC__
2340inline int IsATTY(int fd) { return isatty(fd); }
2341inline int StrCaseCmp(const char* s1, const char* s2) {
2342  return stricmp(s1, s2);
2343}
2344inline char* StrDup(const char* src) { return strdup(src); }
2345#else  // !__BORLANDC__
2346#if GTEST_OS_WINDOWS_MOBILE
2347inline int IsATTY(int /* fd */) { return 0; }
2348#else
2349inline int IsATTY(int fd) { return _isatty(fd); }
2350#endif  // GTEST_OS_WINDOWS_MOBILE
2351inline int StrCaseCmp(const char* s1, const char* s2) {
2352  return _stricmp(s1, s2);
2353}
2354inline char* StrDup(const char* src) { return _strdup(src); }
2355#endif  // __BORLANDC__
2356
2357#if GTEST_OS_WINDOWS_MOBILE
2358inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
2359// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
2360// time and thus not defined there.
2361#else
2362inline int FileNo(FILE* file) { return _fileno(file); }
2363inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
2364inline int RmDir(const char* dir) { return _rmdir(dir); }
2365inline bool IsDir(const StatStruct& st) {
2366  return (_S_IFDIR & st.st_mode) != 0;
2367}
2368#endif  // GTEST_OS_WINDOWS_MOBILE
2369
2370#else
2371
2372typedef struct stat StatStruct;
2373
2374inline int FileNo(FILE* file) { return fileno(file); }
2375inline int IsATTY(int fd) { return isatty(fd); }
2376inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
2377inline int StrCaseCmp(const char* s1, const char* s2) {
2378  return strcasecmp(s1, s2);
2379}
2380inline char* StrDup(const char* src) { return strdup(src); }
2381inline int RmDir(const char* dir) { return rmdir(dir); }
2382inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
2383
2384#endif  // GTEST_OS_WINDOWS
2385
2386// Functions deprecated by MSVC 8.0.
2387
2388#ifdef _MSC_VER
2389// Temporarily disable warning 4996 (deprecated function).
2390#pragma warning(push)
2391#pragma warning(disable:4996)
2392#endif
2393
2394inline const char* StrNCpy(char* dest, const char* src, size_t n) {
2395  return strncpy(dest, src, n);
2396}
2397
2398// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
2399// StrError() aren't needed on Windows CE at this time and thus not
2400// defined there.
2401
2402#if !GTEST_OS_WINDOWS_MOBILE
2403inline int ChDir(const char* dir) { return chdir(dir); }
2404#endif
2405inline FILE* FOpen(const char* path, const char* mode) {
2406  return fopen(path, mode);
2407}
2408#if !GTEST_OS_WINDOWS_MOBILE
2409inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
2410  return freopen(path, mode, stream);
2411}
2412inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
2413#endif
2414inline int FClose(FILE* fp) { return fclose(fp); }
2415#if !GTEST_OS_WINDOWS_MOBILE
2416inline int Read(int fd, void* buf, unsigned int count) {
2417  return static_cast<int>(read(fd, buf, count));
2418}
2419inline int Write(int fd, const void* buf, unsigned int count) {
2420  return static_cast<int>(write(fd, buf, count));
2421}
2422inline int Close(int fd) { return close(fd); }
2423inline const char* StrError(int errnum) { return strerror(errnum); }
2424#endif
2425inline const char* GetEnv(const char* name) {
2426#if GTEST_OS_WINDOWS_MOBILE
2427  // We are on Windows CE, which has no environment variables.
2428  return NULL;
2429#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
2430  // Environment variables which we programmatically clear will be set to the
2431  // empty string rather than unset (NULL).  Handle that case.
2432  const char* const env = getenv(name);
2433  return (env != NULL && env[0] != '\0') ? env : NULL;
2434#else
2435  return getenv(name);
2436#endif
2437}
2438
2439#ifdef _MSC_VER
2440#pragma warning(pop)  // Restores the warning state.
2441#endif
2442
2443#if GTEST_OS_WINDOWS_MOBILE
2444// Windows CE has no C library. The abort() function is used in
2445// several places in Google Test. This implementation provides a reasonable
2446// imitation of standard behaviour.
2447void Abort();
2448#else
2449inline void Abort() { abort(); }
2450#endif  // GTEST_OS_WINDOWS_MOBILE
2451
2452}  // namespace posix
2453
2454// The maximum number a BiggestInt can represent.  This definition
2455// works no matter BiggestInt is represented in one's complement or
2456// two's complement.
2457//
2458// We cannot rely on numeric_limits in STL, as __int64 and long long
2459// are not part of standard C++ and numeric_limits doesn't need to be
2460// defined for them.
2461const BiggestInt kMaxBiggestInt =
2462    ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
2463
2464// This template class serves as a compile-time function from size to
2465// type.  It maps a size in bytes to a primitive type with that
2466// size. e.g.
2467//
2468//   TypeWithSize<4>::UInt
2469//
2470// is typedef-ed to be unsigned int (unsigned integer made up of 4
2471// bytes).
2472//
2473// Such functionality should belong to STL, but I cannot find it
2474// there.
2475//
2476// Google Test uses this class in the implementation of floating-point
2477// comparison.
2478//
2479// For now it only handles UInt (unsigned int) as that's all Google Test
2480// needs.  Other types can be easily added in the future if need
2481// arises.
2482template <size_t size>
2483class TypeWithSize {
2484 public:
2485  // This prevents the user from using TypeWithSize<N> with incorrect
2486  // values of N.
2487  typedef void UInt;
2488};
2489
2490// The specialization for size 4.
2491template <>
2492class TypeWithSize<4> {
2493 public:
2494  // unsigned int has size 4 in both gcc and MSVC.
2495  //
2496  // As base/basictypes.h doesn't compile on Windows, we cannot use
2497  // uint32, uint64, and etc here.
2498  typedef int Int;
2499  typedef unsigned int UInt;
2500};
2501
2502// The specialization for size 8.
2503template <>
2504class TypeWithSize<8> {
2505 public:
2506#if GTEST_OS_WINDOWS
2507  typedef __int64 Int;
2508  typedef unsigned __int64 UInt;
2509#else
2510  typedef long long Int;  // NOLINT
2511  typedef unsigned long long UInt;  // NOLINT
2512#endif  // GTEST_OS_WINDOWS
2513};
2514
2515// Integer types of known sizes.
2516typedef TypeWithSize<4>::Int Int32;
2517typedef TypeWithSize<4>::UInt UInt32;
2518typedef TypeWithSize<8>::Int Int64;
2519typedef TypeWithSize<8>::UInt UInt64;
2520typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
2521
2522// Utilities for command line flags and environment variables.
2523
2524// Macro for referencing flags.
2525#define GTEST_FLAG(name) FLAGS_gtest_##name
2526
2527// Macros for declaring flags.
2528#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
2529#define GTEST_DECLARE_int32_(name) \
2530    GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
2531#define GTEST_DECLARE_string_(name) \
2532    GTEST_API_ extern ::testing::internal::String GTEST_FLAG(name)
2533
2534// Macros for defining flags.
2535#define GTEST_DEFINE_bool_(name, default_val, doc) \
2536    GTEST_API_ bool GTEST_FLAG(name) = (default_val)
2537#define GTEST_DEFINE_int32_(name, default_val, doc) \
2538    GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
2539#define GTEST_DEFINE_string_(name, default_val, doc) \
2540    GTEST_API_ ::testing::internal::String GTEST_FLAG(name) = (default_val)
2541
2542// Parses 'str' for a 32-bit signed integer.  If successful, writes the result
2543// to *value and returns true; otherwise leaves *value unchanged and returns
2544// false.
2545// TODO(chandlerc): Find a better way to refactor flag and environment parsing
2546// out of both gtest-port.cc and gtest.cc to avoid exporting this utility
2547// function.
2548bool ParseInt32(const Message& src_text, const char* str, Int32* value);
2549
2550// Parses a bool/Int32/string from the environment variable
2551// corresponding to the given Google Test flag.
2552bool BoolFromGTestEnv(const char* flag, bool default_val);
2553GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
2554const char* StringFromGTestEnv(const char* flag, const char* default_val);
2555
2556}  // namespace internal
2557}  // namespace testing
2558
2559#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
2560
2561#if GTEST_OS_LINUX
2562#include <stdlib.h>
2563#include <sys/types.h>
2564#include <sys/wait.h>
2565#include <unistd.h>
2566#endif  // GTEST_OS_LINUX
2567
2568#include <ctype.h>
2569#include <string.h>
2570#include <iomanip>
2571#include <limits>
2572#include <set>
2573
2574// Copyright 2005, Google Inc.
2575// All rights reserved.
2576//
2577// Redistribution and use in source and binary forms, with or without
2578// modification, are permitted provided that the following conditions are
2579// met:
2580//
2581//     * Redistributions of source code must retain the above copyright
2582// notice, this list of conditions and the following disclaimer.
2583//     * Redistributions in binary form must reproduce the above
2584// copyright notice, this list of conditions and the following disclaimer
2585// in the documentation and/or other materials provided with the
2586// distribution.
2587//     * Neither the name of Google Inc. nor the names of its
2588// contributors may be used to endorse or promote products derived from
2589// this software without specific prior written permission.
2590//
2591// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2592// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2593// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2594// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2595// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2596// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2597// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2598// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2599// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2600// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2601// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2602//
2603// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
2604//
2605// The Google C++ Testing Framework (Google Test)
2606//
2607// This header file declares the String class and functions used internally by
2608// Google Test.  They are subject to change without notice. They should not used
2609// by code external to Google Test.
2610//
2611// This header file is #included by <gtest/internal/gtest-internal.h>.
2612// It should not be #included by other files.
2613
2614#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
2615#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
2616
2617#ifdef __BORLANDC__
2618// string.h is not guaranteed to provide strcpy on C++ Builder.
2619#include <mem.h>
2620#endif
2621
2622#include <string.h>
2623
2624#include <string>
2625
2626namespace testing {
2627namespace internal {
2628
2629// String - a UTF-8 string class.
2630//
2631// For historic reasons, we don't use std::string.
2632//
2633// TODO(wan@google.com): replace this class with std::string or
2634// implement it in terms of the latter.
2635//
2636// Note that String can represent both NULL and the empty string,
2637// while std::string cannot represent NULL.
2638//
2639// NULL and the empty string are considered different.  NULL is less
2640// than anything (including the empty string) except itself.
2641//
2642// This class only provides minimum functionality necessary for
2643// implementing Google Test.  We do not intend to implement a full-fledged
2644// string class here.
2645//
2646// Since the purpose of this class is to provide a substitute for
2647// std::string on platforms where it cannot be used, we define a copy
2648// constructor and assignment operators such that we don't need
2649// conditional compilation in a lot of places.
2650//
2651// In order to make the representation efficient, the d'tor of String
2652// is not virtual.  Therefore DO NOT INHERIT FROM String.
2653class GTEST_API_ String {
2654 public:
2655  // Static utility methods
2656
2657  // Returns the input enclosed in double quotes if it's not NULL;
2658  // otherwise returns "(null)".  For example, "\"Hello\"" is returned
2659  // for input "Hello".
2660  //
2661  // This is useful for printing a C string in the syntax of a literal.
2662  //
2663  // Known issue: escape sequences are not handled yet.
2664  static String ShowCStringQuoted(const char* c_str);
2665
2666  // Clones a 0-terminated C string, allocating memory using new.  The
2667  // caller is responsible for deleting the return value using
2668  // delete[].  Returns the cloned string, or NULL if the input is
2669  // NULL.
2670  //
2671  // This is different from strdup() in string.h, which allocates
2672  // memory using malloc().
2673  static const char* CloneCString(const char* c_str);
2674
2675#if GTEST_OS_WINDOWS_MOBILE
2676  // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
2677  // able to pass strings to Win32 APIs on CE we need to convert them
2678  // to 'Unicode', UTF-16.
2679
2680  // Creates a UTF-16 wide string from the given ANSI string, allocating
2681  // memory using new. The caller is responsible for deleting the return
2682  // value using delete[]. Returns the wide string, or NULL if the
2683  // input is NULL.
2684  //
2685  // The wide string is created using the ANSI codepage (CP_ACP) to
2686  // match the behaviour of the ANSI versions of Win32 calls and the
2687  // C runtime.
2688  static LPCWSTR AnsiToUtf16(const char* c_str);
2689
2690  // Creates an ANSI string from the given wide string, allocating
2691  // memory using new. The caller is responsible for deleting the return
2692  // value using delete[]. Returns the ANSI string, or NULL if the
2693  // input is NULL.
2694  //
2695  // The returned string is created using the ANSI codepage (CP_ACP) to
2696  // match the behaviour of the ANSI versions of Win32 calls and the
2697  // C runtime.
2698  static const char* Utf16ToAnsi(LPCWSTR utf16_str);
2699#endif
2700
2701  // Compares two C strings.  Returns true iff they have the same content.
2702  //
2703  // Unlike strcmp(), this function can handle NULL argument(s).  A
2704  // NULL C string is considered different to any non-NULL C string,
2705  // including the empty string.
2706  static bool CStringEquals(const char* lhs, const char* rhs);
2707
2708  // Converts a wide C string to a String using the UTF-8 encoding.
2709  // NULL will be converted to "(null)".  If an error occurred during
2710  // the conversion, "(failed to convert from wide string)" is
2711  // returned.
2712  static String ShowWideCString(const wchar_t* wide_c_str);
2713
2714  // Similar to ShowWideCString(), except that this function encloses
2715  // the converted string in double quotes.
2716  static String ShowWideCStringQuoted(const wchar_t* wide_c_str);
2717
2718  // Compares two wide C strings.  Returns true iff they have the same
2719  // content.
2720  //
2721  // Unlike wcscmp(), this function can handle NULL argument(s).  A
2722  // NULL C string is considered different to any non-NULL C string,
2723  // including the empty string.
2724  static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
2725
2726  // Compares two C strings, ignoring case.  Returns true iff they
2727  // have the same content.
2728  //
2729  // Unlike strcasecmp(), this function can handle NULL argument(s).
2730  // A NULL C string is considered different to any non-NULL C string,
2731  // including the empty string.
2732  static bool CaseInsensitiveCStringEquals(const char* lhs,
2733                                           const char* rhs);
2734
2735  // Compares two wide C strings, ignoring case.  Returns true iff they
2736  // have the same content.
2737  //
2738  // Unlike wcscasecmp(), this function can handle NULL argument(s).
2739  // A NULL C string is considered different to any non-NULL wide C string,
2740  // including the empty string.
2741  // NB: The implementations on different platforms slightly differ.
2742  // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
2743  // environment variable. On GNU platform this method uses wcscasecmp
2744  // which compares according to LC_CTYPE category of the current locale.
2745  // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
2746  // current locale.
2747  static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
2748                                               const wchar_t* rhs);
2749
2750  // Formats a list of arguments to a String, using the same format
2751  // spec string as for printf.
2752  //
2753  // We do not use the StringPrintf class as it is not universally
2754  // available.
2755  //
2756  // The result is limited to 4096 characters (including the tailing
2757  // 0).  If 4096 characters are not enough to format the input,
2758  // "<buffer exceeded>" is returned.
2759  static String Format(const char* format, ...);
2760
2761  // C'tors
2762
2763  // The default c'tor constructs a NULL string.
2764  String() : c_str_(NULL), length_(0) {}
2765
2766  // Constructs a String by cloning a 0-terminated C string.
2767  String(const char* a_c_str) {  // NOLINT
2768    if (a_c_str == NULL) {
2769      c_str_ = NULL;
2770      length_ = 0;
2771    } else {
2772      ConstructNonNull(a_c_str, strlen(a_c_str));
2773    }
2774  }
2775
2776  // Constructs a String by copying a given number of chars from a
2777  // buffer.  E.g. String("hello", 3) creates the string "hel",
2778  // String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "",
2779  // and String(NULL, 1) results in access violation.
2780  String(const char* buffer, size_t a_length) {
2781    ConstructNonNull(buffer, a_length);
2782  }
2783
2784  // The copy c'tor creates a new copy of the string.  The two
2785  // String objects do not share content.
2786  String(const String& str) : c_str_(NULL), length_(0) { *this = str; }
2787
2788  // D'tor.  String is intended to be a final class, so the d'tor
2789  // doesn't need to be virtual.
2790  ~String() { delete[] c_str_; }
2791
2792  // Allows a String to be implicitly converted to an ::std::string or
2793  // ::string, and vice versa.  Converting a String containing a NULL
2794  // pointer to ::std::string or ::string is undefined behavior.
2795  // Converting a ::std::string or ::string containing an embedded NUL
2796  // character to a String will result in the prefix up to the first
2797  // NUL character.
2798  String(const ::std::string& str) {
2799    ConstructNonNull(str.c_str(), str.length());
2800  }
2801
2802  operator ::std::string() const { return ::std::string(c_str(), length()); }
2803
2804#if GTEST_HAS_GLOBAL_STRING
2805  String(const ::string& str) {
2806    ConstructNonNull(str.c_str(), str.length());
2807  }
2808
2809  operator ::string() const { return ::string(c_str(), length()); }
2810#endif  // GTEST_HAS_GLOBAL_STRING
2811
2812  // Returns true iff this is an empty string (i.e. "").
2813  bool empty() const { return (c_str() != NULL) && (length() == 0); }
2814
2815  // Compares this with another String.
2816  // Returns < 0 if this is less than rhs, 0 if this is equal to rhs, or > 0
2817  // if this is greater than rhs.
2818  int Compare(const String& rhs) const;
2819
2820  // Returns true iff this String equals the given C string.  A NULL
2821  // string and a non-NULL string are considered not equal.
2822  bool operator==(const char* a_c_str) const { return Compare(a_c_str) == 0; }
2823
2824  // Returns true iff this String is less than the given String.  A
2825  // NULL string is considered less than "".
2826  bool operator<(const String& rhs) const { return Compare(rhs) < 0; }
2827
2828  // Returns true iff this String doesn't equal the given C string.  A NULL
2829  // string and a non-NULL string are considered not equal.
2830  bool operator!=(const char* a_c_str) const { return !(*this == a_c_str); }
2831
2832  // Returns true iff this String ends with the given suffix.  *Any*
2833  // String is considered to end with a NULL or empty suffix.
2834  bool EndsWith(const char* suffix) const;
2835
2836  // Returns true iff this String ends with the given suffix, not considering
2837  // case. Any String is considered to end with a NULL or empty suffix.
2838  bool EndsWithCaseInsensitive(const char* suffix) const;
2839
2840  // Returns the length of the encapsulated string, or 0 if the
2841  // string is NULL.
2842  size_t length() const { return length_; }
2843
2844  // Gets the 0-terminated C string this String object represents.
2845  // The String object still owns the string.  Therefore the caller
2846  // should NOT delete the return value.
2847  const char* c_str() const { return c_str_; }
2848
2849  // Assigns a C string to this object.  Self-assignment works.
2850  const String& operator=(const char* a_c_str) {
2851    return *this = String(a_c_str);
2852  }
2853
2854  // Assigns a String object to this object.  Self-assignment works.
2855  const String& operator=(const String& rhs) {
2856    if (this != &rhs) {
2857      delete[] c_str_;
2858      if (rhs.c_str() == NULL) {
2859        c_str_ = NULL;
2860        length_ = 0;
2861      } else {
2862        ConstructNonNull(rhs.c_str(), rhs.length());
2863      }
2864    }
2865
2866    return *this;
2867  }
2868
2869 private:
2870  // Constructs a non-NULL String from the given content.  This
2871  // function can only be called when data_ has not been allocated.
2872  // ConstructNonNull(NULL, 0) results in an empty string ("").
2873  // ConstructNonNull(NULL, non_zero) is undefined behavior.
2874  void ConstructNonNull(const char* buffer, size_t a_length) {
2875    char* const str = new char[a_length + 1];
2876    memcpy(str, buffer, a_length);
2877    str[a_length] = '\0';
2878    c_str_ = str;
2879    length_ = a_length;
2880  }
2881
2882  const char* c_str_;
2883  size_t length_;
2884};  // class String
2885
2886// Streams a String to an ostream.  Each '\0' character in the String
2887// is replaced with "\\0".
2888inline ::std::ostream& operator<<(::std::ostream& os, const String& str) {
2889  if (str.c_str() == NULL) {
2890    os << "(null)";
2891  } else {
2892    const char* const c_str = str.c_str();
2893    for (size_t i = 0; i != str.length(); i++) {
2894      if (c_str[i] == '\0') {
2895        os << "\\0";
2896      } else {
2897        os << c_str[i];
2898      }
2899    }
2900  }
2901  return os;
2902}
2903
2904// Gets the content of the StrStream's buffer as a String.  Each '\0'
2905// character in the buffer is replaced with "\\0".
2906GTEST_API_ String StrStreamToString(StrStream* stream);
2907
2908// Converts a streamable value to a String.  A NULL pointer is
2909// converted to "(null)".  When the input value is a ::string,
2910// ::std::string, ::wstring, or ::std::wstring object, each NUL
2911// character in it is replaced with "\\0".
2912
2913// Declared here but defined in gtest.h, so that it has access
2914// to the definition of the Message class, required by the ARM
2915// compiler.
2916template <typename T>
2917String StreamableToString(const T& streamable);
2918
2919}  // namespace internal
2920}  // namespace testing
2921
2922#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
2923// Copyright 2008, Google Inc.
2924// All rights reserved.
2925//
2926// Redistribution and use in source and binary forms, with or without
2927// modification, are permitted provided that the following conditions are
2928// met:
2929//
2930//     * Redistributions of source code must retain the above copyright
2931// notice, this list of conditions and the following disclaimer.
2932//     * Redistributions in binary form must reproduce the above
2933// copyright notice, this list of conditions and the following disclaimer
2934// in the documentation and/or other materials provided with the
2935// distribution.
2936//     * Neither the name of Google Inc. nor the names of its
2937// contributors may be used to endorse or promote products derived from
2938// this software without specific prior written permission.
2939//
2940// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2941// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2942// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2943// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2944// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2945// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2946// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2947// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2948// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2949// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2950// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2951//
2952// Author: keith.ray@gmail.com (Keith Ray)
2953//
2954// Google Test filepath utilities
2955//
2956// This header file declares classes and functions used internally by
2957// Google Test.  They are subject to change without notice.
2958//
2959// This file is #included in <gtest/internal/gtest-internal.h>.
2960// Do not include this header file separately!
2961
2962#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
2963#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
2964
2965
2966namespace testing {
2967namespace internal {
2968
2969// FilePath - a class for file and directory pathname manipulation which
2970// handles platform-specific conventions (like the pathname separator).
2971// Used for helper functions for naming files in a directory for xml output.
2972// Except for Set methods, all methods are const or static, which provides an
2973// "immutable value object" -- useful for peace of mind.
2974// A FilePath with a value ending in a path separator ("like/this/") represents
2975// a directory, otherwise it is assumed to represent a file. In either case,
2976// it may or may not represent an actual file or directory in the file system.
2977// Names are NOT checked for syntax correctness -- no checking for illegal
2978// characters, malformed paths, etc.
2979
2980class GTEST_API_ FilePath {
2981 public:
2982  FilePath() : pathname_("") { }
2983  FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
2984
2985  explicit FilePath(const char* pathname) : pathname_(pathname) {
2986    Normalize();
2987  }
2988
2989  explicit FilePath(const String& pathname) : pathname_(pathname) {
2990    Normalize();
2991  }
2992
2993  FilePath& operator=(const FilePath& rhs) {
2994    Set(rhs);
2995    return *this;
2996  }
2997
2998  void Set(const FilePath& rhs) {
2999    pathname_ = rhs.pathname_;
3000  }
3001
3002  String ToString() const { return pathname_; }
3003  const char* c_str() const { return pathname_.c_str(); }
3004
3005  // Returns the current working directory, or "" if unsuccessful.
3006  static FilePath GetCurrentDir();
3007
3008  // Given directory = "dir", base_name = "test", number = 0,
3009  // extension = "xml", returns "dir/test.xml". If number is greater
3010  // than zero (e.g., 12), returns "dir/test_12.xml".
3011  // On Windows platform, uses \ as the separator rather than /.
3012  static FilePath MakeFileName(const FilePath& directory,
3013                               const FilePath& base_name,
3014                               int number,
3015                               const char* extension);
3016
3017  // Given directory = "dir", relative_path = "test.xml",
3018  // returns "dir/test.xml".
3019  // On Windows, uses \ as the separator rather than /.
3020  static FilePath ConcatPaths(const FilePath& directory,
3021                              const FilePath& relative_path);
3022
3023  // Returns a pathname for a file that does not currently exist. The pathname
3024  // will be directory/base_name.extension or
3025  // directory/base_name_<number>.extension if directory/base_name.extension
3026  // already exists. The number will be incremented until a pathname is found
3027  // that does not already exist.
3028  // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
3029  // There could be a race condition if two or more processes are calling this
3030  // function at the same time -- they could both pick the same filename.
3031  static FilePath GenerateUniqueFileName(const FilePath& directory,
3032                                         const FilePath& base_name,
3033                                         const char* extension);
3034
3035  // Returns true iff the path is NULL or "".
3036  bool IsEmpty() const { return c_str() == NULL || *c_str() == '\0'; }
3037
3038  // If input name has a trailing separator character, removes it and returns
3039  // the name, otherwise return the name string unmodified.
3040  // On Windows platform, uses \ as the separator, other platforms use /.
3041  FilePath RemoveTrailingPathSeparator() const;
3042
3043  // Returns a copy of the FilePath with the directory part removed.
3044  // Example: FilePath("path/to/file").RemoveDirectoryName() returns
3045  // FilePath("file"). If there is no directory part ("just_a_file"), it returns
3046  // the FilePath unmodified. If there is no file part ("just_a_dir/") it
3047  // returns an empty FilePath ("").
3048  // On Windows platform, '\' is the path separator, otherwise it is '/'.
3049  FilePath RemoveDirectoryName() const;
3050
3051  // RemoveFileName returns the directory path with the filename removed.
3052  // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
3053  // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
3054  // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
3055  // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
3056  // On Windows platform, '\' is the path separator, otherwise it is '/'.
3057  FilePath RemoveFileName() const;
3058
3059  // Returns a copy of the FilePath with the case-insensitive extension removed.
3060  // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
3061  // FilePath("dir/file"). If a case-insensitive extension is not
3062  // found, returns a copy of the original FilePath.
3063  FilePath RemoveExtension(const char* extension) const;
3064
3065  // Creates directories so that path exists. Returns true if successful or if
3066  // the directories already exist; returns false if unable to create
3067  // directories for any reason. Will also return false if the FilePath does
3068  // not represent a directory (that is, it doesn't end with a path separator).
3069  bool CreateDirectoriesRecursively() const;
3070
3071  // Create the directory so that path exists. Returns true if successful or
3072  // if the directory already exists; returns false if unable to create the
3073  // directory for any reason, including if the parent directory does not
3074  // exist. Not named "CreateDirectory" because that's a macro on Windows.
3075  bool CreateFolder() const;
3076
3077  // Returns true if FilePath describes something in the file-system,
3078  // either a file, directory, or whatever, and that something exists.
3079  bool FileOrDirectoryExists() const;
3080
3081  // Returns true if pathname describes a directory in the file-system
3082  // that exists.
3083  bool DirectoryExists() const;
3084
3085  // Returns true if FilePath ends with a path separator, which indicates that
3086  // it is intended to represent a directory. Returns false otherwise.
3087  // This does NOT check that a directory (or file) actually exists.
3088  bool IsDirectory() const;
3089
3090  // Returns true if pathname describes a root directory. (Windows has one
3091  // root directory per disk drive.)
3092  bool IsRootDirectory() const;
3093
3094  // Returns true if pathname describes an absolute path.
3095  bool IsAbsolutePath() const;
3096
3097 private:
3098  // Replaces multiple consecutive separators with a single separator.
3099  // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
3100  // redundancies that might be in a pathname involving "." or "..".
3101  //
3102  // A pathname with multiple consecutive separators may occur either through
3103  // user error or as a result of some scripts or APIs that generate a pathname
3104  // with a trailing separator. On other platforms the same API or script
3105  // may NOT generate a pathname with a trailing "/". Then elsewhere that
3106  // pathname may have another "/" and pathname components added to it,
3107  // without checking for the separator already being there.
3108  // The script language and operating system may allow paths like "foo//bar"
3109  // but some of the functions in FilePath will not handle that correctly. In
3110  // particular, RemoveTrailingPathSeparator() only removes one separator, and
3111  // it is called in CreateDirectoriesRecursively() assuming that it will change
3112  // a pathname from directory syntax (trailing separator) to filename syntax.
3113  //
3114  // On Windows this method also replaces the alternate path separator '/' with
3115  // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
3116  // "bar\\foo".
3117
3118  void Normalize();
3119
3120  // Returns a pointer to the last occurence of a valid path separator in
3121  // the FilePath. On Windows, for example, both '/' and '\' are valid path
3122  // separators. Returns NULL if no path separator was found.
3123  const char* FindLastPathSeparator() const;
3124
3125  String pathname_;
3126};  // class FilePath
3127
3128}  // namespace internal
3129}  // namespace testing
3130
3131#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3132// This file was GENERATED by command:
3133//     pump.py gtest-type-util.h.pump
3134// DO NOT EDIT BY HAND!!!
3135
3136// Copyright 2008 Google Inc.
3137// All Rights Reserved.
3138//
3139// Redistribution and use in source and binary forms, with or without
3140// modification, are permitted provided that the following conditions are
3141// met:
3142//
3143//     * Redistributions of source code must retain the above copyright
3144// notice, this list of conditions and the following disclaimer.
3145//     * Redistributions in binary form must reproduce the above
3146// copyright notice, this list of conditions and the following disclaimer
3147// in the documentation and/or other materials provided with the
3148// distribution.
3149//     * Neither the name of Google Inc. nor the names of its
3150// contributors may be used to endorse or promote products derived from
3151// this software without specific prior written permission.
3152//
3153// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3154// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3155// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3156// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3157// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3158// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3159// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3160// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3161// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3162// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3163// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3164//
3165// Author: wan@google.com (Zhanyong Wan)
3166
3167// Type utilities needed for implementing typed and type-parameterized
3168// tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
3169//
3170// Currently we support at most 50 types in a list, and at most 50
3171// type-parameterized tests in one type-parameterized test case.
3172// Please contact googletestframework@googlegroups.com if you need
3173// more.
3174
3175#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3176#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3177
3178
3179#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
3180
3181// #ifdef __GNUC__ is too general here.  It is possible to use gcc without using
3182// libstdc++ (which is where cxxabi.h comes from).
3183#ifdef __GLIBCXX__
3184#include <cxxabi.h>
3185#endif  // __GLIBCXX__
3186
3187namespace testing {
3188namespace internal {
3189
3190// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
3191// type.  This can be used as a compile-time assertion to ensure that
3192// two types are equal.
3193
3194template <typename T1, typename T2>
3195struct AssertTypeEq;
3196
3197template <typename T>
3198struct AssertTypeEq<T, T> {
3199  typedef bool type;
3200};
3201
3202// GetTypeName<T>() returns a human-readable name of type T.
3203template <typename T>
3204String GetTypeName() {
3205#if GTEST_HAS_RTTI
3206
3207  const char* const name = typeid(T).name();
3208#ifdef __GLIBCXX__
3209  int status = 0;
3210  // gcc's implementation of typeid(T).name() mangles the type name,
3211  // so we have to demangle it.
3212  char* const readable_name = abi::__cxa_demangle(name, 0, 0, &status);
3213  const String name_str(status == 0 ? readable_name : name);
3214  free(readable_name);
3215  return name_str;
3216#else
3217  return name;
3218#endif  // __GLIBCXX__
3219
3220#else
3221  return "<type>";
3222#endif  // GTEST_HAS_RTTI
3223}
3224
3225// A unique type used as the default value for the arguments of class
3226// template Types.  This allows us to simulate variadic templates
3227// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
3228// support directly.
3229struct None {};
3230
3231// The following family of struct and struct templates are used to
3232// represent type lists.  In particular, TypesN<T1, T2, ..., TN>
3233// represents a type list with N types (T1, T2, ..., and TN) in it.
3234// Except for Types0, every struct in the family has two member types:
3235// Head for the first type in the list, and Tail for the rest of the
3236// list.
3237
3238// The empty type list.
3239struct Types0 {};
3240
3241// Type lists of length 1, 2, 3, and so on.
3242
3243template <typename T1>
3244struct Types1 {
3245  typedef T1 Head;
3246  typedef Types0 Tail;
3247};
3248template <typename T1, typename T2>
3249struct Types2 {
3250  typedef T1 Head;
3251  typedef Types1<T2> Tail;
3252};
3253
3254template <typename T1, typename T2, typename T3>
3255struct Types3 {
3256  typedef T1 Head;
3257  typedef Types2<T2, T3> Tail;
3258};
3259
3260template <typename T1, typename T2, typename T3, typename T4>
3261struct Types4 {
3262  typedef T1 Head;
3263  typedef Types3<T2, T3, T4> Tail;
3264};
3265
3266template <typename T1, typename T2, typename T3, typename T4, typename T5>
3267struct Types5 {
3268  typedef T1 Head;
3269  typedef Types4<T2, T3, T4, T5> Tail;
3270};
3271
3272template <typename T1, typename T2, typename T3, typename T4, typename T5,
3273    typename T6>
3274struct Types6 {
3275  typedef T1 Head;
3276  typedef Types5<T2, T3, T4, T5, T6> Tail;
3277};
3278
3279template <typename T1, typename T2, typename T3, typename T4, typename T5,
3280    typename T6, typename T7>
3281struct Types7 {
3282  typedef T1 Head;
3283  typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
3284};
3285
3286template <typename T1, typename T2, typename T3, typename T4, typename T5,
3287    typename T6, typename T7, typename T8>
3288struct Types8 {
3289  typedef T1 Head;
3290  typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
3291};
3292
3293template <typename T1, typename T2, typename T3, typename T4, typename T5,
3294    typename T6, typename T7, typename T8, typename T9>
3295struct Types9 {
3296  typedef T1 Head;
3297  typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
3298};
3299
3300template <typename T1, typename T2, typename T3, typename T4, typename T5,
3301    typename T6, typename T7, typename T8, typename T9, typename T10>
3302struct Types10 {
3303  typedef T1 Head;
3304  typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
3305};
3306
3307template <typename T1, typename T2, typename T3, typename T4, typename T5,
3308    typename T6, typename T7, typename T8, typename T9, typename T10,
3309    typename T11>
3310struct Types11 {
3311  typedef T1 Head;
3312  typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
3313};
3314
3315template <typename T1, typename T2, typename T3, typename T4, typename T5,
3316    typename T6, typename T7, typename T8, typename T9, typename T10,
3317    typename T11, typename T12>
3318struct Types12 {
3319  typedef T1 Head;
3320  typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
3321};
3322
3323template <typename T1, typename T2, typename T3, typename T4, typename T5,
3324    typename T6, typename T7, typename T8, typename T9, typename T10,
3325    typename T11, typename T12, typename T13>
3326struct Types13 {
3327  typedef T1 Head;
3328  typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
3329};
3330
3331template <typename T1, typename T2, typename T3, typename T4, typename T5,
3332    typename T6, typename T7, typename T8, typename T9, typename T10,
3333    typename T11, typename T12, typename T13, typename T14>
3334struct Types14 {
3335  typedef T1 Head;
3336  typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
3337};
3338
3339template <typename T1, typename T2, typename T3, typename T4, typename T5,
3340    typename T6, typename T7, typename T8, typename T9, typename T10,
3341    typename T11, typename T12, typename T13, typename T14, typename T15>
3342struct Types15 {
3343  typedef T1 Head;
3344  typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
3345      T15> Tail;
3346};
3347
3348template <typename T1, typename T2, typename T3, typename T4, typename T5,
3349    typename T6, typename T7, typename T8, typename T9, typename T10,
3350    typename T11, typename T12, typename T13, typename T14, typename T15,
3351    typename T16>
3352struct Types16 {
3353  typedef T1 Head;
3354  typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3355      T16> Tail;
3356};
3357
3358template <typename T1, typename T2, typename T3, typename T4, typename T5,
3359    typename T6, typename T7, typename T8, typename T9, typename T10,
3360    typename T11, typename T12, typename T13, typename T14, typename T15,
3361    typename T16, typename T17>
3362struct Types17 {
3363  typedef T1 Head;
3364  typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3365      T16, T17> Tail;
3366};
3367
3368template <typename T1, typename T2, typename T3, typename T4, typename T5,
3369    typename T6, typename T7, typename T8, typename T9, typename T10,
3370    typename T11, typename T12, typename T13, typename T14, typename T15,
3371    typename T16, typename T17, typename T18>
3372struct Types18 {
3373  typedef T1 Head;
3374  typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3375      T16, T17, T18> Tail;
3376};
3377
3378template <typename T1, typename T2, typename T3, typename T4, typename T5,
3379    typename T6, typename T7, typename T8, typename T9, typename T10,
3380    typename T11, typename T12, typename T13, typename T14, typename T15,
3381    typename T16, typename T17, typename T18, typename T19>
3382struct Types19 {
3383  typedef T1 Head;
3384  typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3385      T16, T17, T18, T19> Tail;
3386};
3387
3388template <typename T1, typename T2, typename T3, typename T4, typename T5,
3389    typename T6, typename T7, typename T8, typename T9, typename T10,
3390    typename T11, typename T12, typename T13, typename T14, typename T15,
3391    typename T16, typename T17, typename T18, typename T19, typename T20>
3392struct Types20 {
3393  typedef T1 Head;
3394  typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3395      T16, T17, T18, T19, T20> Tail;
3396};
3397
3398template <typename T1, typename T2, typename T3, typename T4, typename T5,
3399    typename T6, typename T7, typename T8, typename T9, typename T10,
3400    typename T11, typename T12, typename T13, typename T14, typename T15,
3401    typename T16, typename T17, typename T18, typename T19, typename T20,
3402    typename T21>
3403struct Types21 {
3404  typedef T1 Head;
3405  typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3406      T16, T17, T18, T19, T20, T21> Tail;
3407};
3408
3409template <typename T1, typename T2, typename T3, typename T4, typename T5,
3410    typename T6, typename T7, typename T8, typename T9, typename T10,
3411    typename T11, typename T12, typename T13, typename T14, typename T15,
3412    typename T16, typename T17, typename T18, typename T19, typename T20,
3413    typename T21, typename T22>
3414struct Types22 {
3415  typedef T1 Head;
3416  typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3417      T16, T17, T18, T19, T20, T21, T22> Tail;
3418};
3419
3420template <typename T1, typename T2, typename T3, typename T4, typename T5,
3421    typename T6, typename T7, typename T8, typename T9, typename T10,
3422    typename T11, typename T12, typename T13, typename T14, typename T15,
3423    typename T16, typename T17, typename T18, typename T19, typename T20,
3424    typename T21, typename T22, typename T23>
3425struct Types23 {
3426  typedef T1 Head;
3427  typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3428      T16, T17, T18, T19, T20, T21, T22, T23> Tail;
3429};
3430
3431template <typename T1, typename T2, typename T3, typename T4, typename T5,
3432    typename T6, typename T7, typename T8, typename T9, typename T10,
3433    typename T11, typename T12, typename T13, typename T14, typename T15,
3434    typename T16, typename T17, typename T18, typename T19, typename T20,
3435    typename T21, typename T22, typename T23, typename T24>
3436struct Types24 {
3437  typedef T1 Head;
3438  typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3439      T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
3440};
3441
3442template <typename T1, typename T2, typename T3, typename T4, typename T5,
3443    typename T6, typename T7, typename T8, typename T9, typename T10,
3444    typename T11, typename T12, typename T13, typename T14, typename T15,
3445    typename T16, typename T17, typename T18, typename T19, typename T20,
3446    typename T21, typename T22, typename T23, typename T24, typename T25>
3447struct Types25 {
3448  typedef T1 Head;
3449  typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3450      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
3451};
3452
3453template <typename T1, typename T2, typename T3, typename T4, typename T5,
3454    typename T6, typename T7, typename T8, typename T9, typename T10,
3455    typename T11, typename T12, typename T13, typename T14, typename T15,
3456    typename T16, typename T17, typename T18, typename T19, typename T20,
3457    typename T21, typename T22, typename T23, typename T24, typename T25,
3458    typename T26>
3459struct Types26 {
3460  typedef T1 Head;
3461  typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3462      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
3463};
3464
3465template <typename T1, typename T2, typename T3, typename T4, typename T5,
3466    typename T6, typename T7, typename T8, typename T9, typename T10,
3467    typename T11, typename T12, typename T13, typename T14, typename T15,
3468    typename T16, typename T17, typename T18, typename T19, typename T20,
3469    typename T21, typename T22, typename T23, typename T24, typename T25,
3470    typename T26, typename T27>
3471struct Types27 {
3472  typedef T1 Head;
3473  typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3474      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
3475};
3476
3477template <typename T1, typename T2, typename T3, typename T4, typename T5,
3478    typename T6, typename T7, typename T8, typename T9, typename T10,
3479    typename T11, typename T12, typename T13, typename T14, typename T15,
3480    typename T16, typename T17, typename T18, typename T19, typename T20,
3481    typename T21, typename T22, typename T23, typename T24, typename T25,
3482    typename T26, typename T27, typename T28>
3483struct Types28 {
3484  typedef T1 Head;
3485  typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3486      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
3487};
3488
3489template <typename T1, typename T2, typename T3, typename T4, typename T5,
3490    typename T6, typename T7, typename T8, typename T9, typename T10,
3491    typename T11, typename T12, typename T13, typename T14, typename T15,
3492    typename T16, typename T17, typename T18, typename T19, typename T20,
3493    typename T21, typename T22, typename T23, typename T24, typename T25,
3494    typename T26, typename T27, typename T28, typename T29>
3495struct Types29 {
3496  typedef T1 Head;
3497  typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3498      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
3499      T29> Tail;
3500};
3501
3502template <typename T1, typename T2, typename T3, typename T4, typename T5,
3503    typename T6, typename T7, typename T8, typename T9, typename T10,
3504    typename T11, typename T12, typename T13, typename T14, typename T15,
3505    typename T16, typename T17, typename T18, typename T19, typename T20,
3506    typename T21, typename T22, typename T23, typename T24, typename T25,
3507    typename T26, typename T27, typename T28, typename T29, typename T30>
3508struct Types30 {
3509  typedef T1 Head;
3510  typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3511      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3512      T30> Tail;
3513};
3514
3515template <typename T1, typename T2, typename T3, typename T4, typename T5,
3516    typename T6, typename T7, typename T8, typename T9, typename T10,
3517    typename T11, typename T12, typename T13, typename T14, typename T15,
3518    typename T16, typename T17, typename T18, typename T19, typename T20,
3519    typename T21, typename T22, typename T23, typename T24, typename T25,
3520    typename T26, typename T27, typename T28, typename T29, typename T30,
3521    typename T31>
3522struct Types31 {
3523  typedef T1 Head;
3524  typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3525      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3526      T30, T31> Tail;
3527};
3528
3529template <typename T1, typename T2, typename T3, typename T4, typename T5,
3530    typename T6, typename T7, typename T8, typename T9, typename T10,
3531    typename T11, typename T12, typename T13, typename T14, typename T15,
3532    typename T16, typename T17, typename T18, typename T19, typename T20,
3533    typename T21, typename T22, typename T23, typename T24, typename T25,
3534    typename T26, typename T27, typename T28, typename T29, typename T30,
3535    typename T31, typename T32>
3536struct Types32 {
3537  typedef T1 Head;
3538  typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3539      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3540      T30, T31, T32> Tail;
3541};
3542
3543template <typename T1, typename T2, typename T3, typename T4, typename T5,
3544    typename T6, typename T7, typename T8, typename T9, typename T10,
3545    typename T11, typename T12, typename T13, typename T14, typename T15,
3546    typename T16, typename T17, typename T18, typename T19, typename T20,
3547    typename T21, typename T22, typename T23, typename T24, typename T25,
3548    typename T26, typename T27, typename T28, typename T29, typename T30,
3549    typename T31, typename T32, typename T33>
3550struct Types33 {
3551  typedef T1 Head;
3552  typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3553      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3554      T30, T31, T32, T33> Tail;
3555};
3556
3557template <typename T1, typename T2, typename T3, typename T4, typename T5,
3558    typename T6, typename T7, typename T8, typename T9, typename T10,
3559    typename T11, typename T12, typename T13, typename T14, typename T15,
3560    typename T16, typename T17, typename T18, typename T19, typename T20,
3561    typename T21, typename T22, typename T23, typename T24, typename T25,
3562    typename T26, typename T27, typename T28, typename T29, typename T30,
3563    typename T31, typename T32, typename T33, typename T34>
3564struct Types34 {
3565  typedef T1 Head;
3566  typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3567      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3568      T30, T31, T32, T33, T34> Tail;
3569};
3570
3571template <typename T1, typename T2, typename T3, typename T4, typename T5,
3572    typename T6, typename T7, typename T8, typename T9, typename T10,
3573    typename T11, typename T12, typename T13, typename T14, typename T15,
3574    typename T16, typename T17, typename T18, typename T19, typename T20,
3575    typename T21, typename T22, typename T23, typename T24, typename T25,
3576    typename T26, typename T27, typename T28, typename T29, typename T30,
3577    typename T31, typename T32, typename T33, typename T34, typename T35>
3578struct Types35 {
3579  typedef T1 Head;
3580  typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3581      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3582      T30, T31, T32, T33, T34, T35> Tail;
3583};
3584
3585template <typename T1, typename T2, typename T3, typename T4, typename T5,
3586    typename T6, typename T7, typename T8, typename T9, typename T10,
3587    typename T11, typename T12, typename T13, typename T14, typename T15,
3588    typename T16, typename T17, typename T18, typename T19, typename T20,
3589    typename T21, typename T22, typename T23, typename T24, typename T25,
3590    typename T26, typename T27, typename T28, typename T29, typename T30,
3591    typename T31, typename T32, typename T33, typename T34, typename T35,
3592    typename T36>
3593struct Types36 {
3594  typedef T1 Head;
3595  typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3596      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3597      T30, T31, T32, T33, T34, T35, T36> Tail;
3598};
3599
3600template <typename T1, typename T2, typename T3, typename T4, typename T5,
3601    typename T6, typename T7, typename T8, typename T9, typename T10,
3602    typename T11, typename T12, typename T13, typename T14, typename T15,
3603    typename T16, typename T17, typename T18, typename T19, typename T20,
3604    typename T21, typename T22, typename T23, typename T24, typename T25,
3605    typename T26, typename T27, typename T28, typename T29, typename T30,
3606    typename T31, typename T32, typename T33, typename T34, typename T35,
3607    typename T36, typename T37>
3608struct Types37 {
3609  typedef T1 Head;
3610  typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3611      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3612      T30, T31, T32, T33, T34, T35, T36, T37> Tail;
3613};
3614
3615template <typename T1, typename T2, typename T3, typename T4, typename T5,
3616    typename T6, typename T7, typename T8, typename T9, typename T10,
3617    typename T11, typename T12, typename T13, typename T14, typename T15,
3618    typename T16, typename T17, typename T18, typename T19, typename T20,
3619    typename T21, typename T22, typename T23, typename T24, typename T25,
3620    typename T26, typename T27, typename T28, typename T29, typename T30,
3621    typename T31, typename T32, typename T33, typename T34, typename T35,
3622    typename T36, typename T37, typename T38>
3623struct Types38 {
3624  typedef T1 Head;
3625  typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3626      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3627      T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
3628};
3629
3630template <typename T1, typename T2, typename T3, typename T4, typename T5,
3631    typename T6, typename T7, typename T8, typename T9, typename T10,
3632    typename T11, typename T12, typename T13, typename T14, typename T15,
3633    typename T16, typename T17, typename T18, typename T19, typename T20,
3634    typename T21, typename T22, typename T23, typename T24, typename T25,
3635    typename T26, typename T27, typename T28, typename T29, typename T30,
3636    typename T31, typename T32, typename T33, typename T34, typename T35,
3637    typename T36, typename T37, typename T38, typename T39>
3638struct Types39 {
3639  typedef T1 Head;
3640  typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3641      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3642      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
3643};
3644
3645template <typename T1, typename T2, typename T3, typename T4, typename T5,
3646    typename T6, typename T7, typename T8, typename T9, typename T10,
3647    typename T11, typename T12, typename T13, typename T14, typename T15,
3648    typename T16, typename T17, typename T18, typename T19, typename T20,
3649    typename T21, typename T22, typename T23, typename T24, typename T25,
3650    typename T26, typename T27, typename T28, typename T29, typename T30,
3651    typename T31, typename T32, typename T33, typename T34, typename T35,
3652    typename T36, typename T37, typename T38, typename T39, typename T40>
3653struct Types40 {
3654  typedef T1 Head;
3655  typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3656      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3657      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
3658};
3659
3660template <typename T1, typename T2, typename T3, typename T4, typename T5,
3661    typename T6, typename T7, typename T8, typename T9, typename T10,
3662    typename T11, typename T12, typename T13, typename T14, typename T15,
3663    typename T16, typename T17, typename T18, typename T19, typename T20,
3664    typename T21, typename T22, typename T23, typename T24, typename T25,
3665    typename T26, typename T27, typename T28, typename T29, typename T30,
3666    typename T31, typename T32, typename T33, typename T34, typename T35,
3667    typename T36, typename T37, typename T38, typename T39, typename T40,
3668    typename T41>
3669struct Types41 {
3670  typedef T1 Head;
3671  typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3672      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3673      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
3674};
3675
3676template <typename T1, typename T2, typename T3, typename T4, typename T5,
3677    typename T6, typename T7, typename T8, typename T9, typename T10,
3678    typename T11, typename T12, typename T13, typename T14, typename T15,
3679    typename T16, typename T17, typename T18, typename T19, typename T20,
3680    typename T21, typename T22, typename T23, typename T24, typename T25,
3681    typename T26, typename T27, typename T28, typename T29, typename T30,
3682    typename T31, typename T32, typename T33, typename T34, typename T35,
3683    typename T36, typename T37, typename T38, typename T39, typename T40,
3684    typename T41, typename T42>
3685struct Types42 {
3686  typedef T1 Head;
3687  typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3688      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3689      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
3690};
3691
3692template <typename T1, typename T2, typename T3, typename T4, typename T5,
3693    typename T6, typename T7, typename T8, typename T9, typename T10,
3694    typename T11, typename T12, typename T13, typename T14, typename T15,
3695    typename T16, typename T17, typename T18, typename T19, typename T20,
3696    typename T21, typename T22, typename T23, typename T24, typename T25,
3697    typename T26, typename T27, typename T28, typename T29, typename T30,
3698    typename T31, typename T32, typename T33, typename T34, typename T35,
3699    typename T36, typename T37, typename T38, typename T39, typename T40,
3700    typename T41, typename T42, typename T43>
3701struct Types43 {
3702  typedef T1 Head;
3703  typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3704      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3705      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
3706      T43> Tail;
3707};
3708
3709template <typename T1, typename T2, typename T3, typename T4, typename T5,
3710    typename T6, typename T7, typename T8, typename T9, typename T10,
3711    typename T11, typename T12, typename T13, typename T14, typename T15,
3712    typename T16, typename T17, typename T18, typename T19, typename T20,
3713    typename T21, typename T22, typename T23, typename T24, typename T25,
3714    typename T26, typename T27, typename T28, typename T29, typename T30,
3715    typename T31, typename T32, typename T33, typename T34, typename T35,
3716    typename T36, typename T37, typename T38, typename T39, typename T40,
3717    typename T41, typename T42, typename T43, typename T44>
3718struct Types44 {
3719  typedef T1 Head;
3720  typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3721      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3722      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
3723      T44> Tail;
3724};
3725
3726template <typename T1, typename T2, typename T3, typename T4, typename T5,
3727    typename T6, typename T7, typename T8, typename T9, typename T10,
3728    typename T11, typename T12, typename T13, typename T14, typename T15,
3729    typename T16, typename T17, typename T18, typename T19, typename T20,
3730    typename T21, typename T22, typename T23, typename T24, typename T25,
3731    typename T26, typename T27, typename T28, typename T29, typename T30,
3732    typename T31, typename T32, typename T33, typename T34, typename T35,
3733    typename T36, typename T37, typename T38, typename T39, typename T40,
3734    typename T41, typename T42, typename T43, typename T44, typename T45>
3735struct Types45 {
3736  typedef T1 Head;
3737  typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3738      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3739      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
3740      T44, T45> Tail;
3741};
3742
3743template <typename T1, typename T2, typename T3, typename T4, typename T5,
3744    typename T6, typename T7, typename T8, typename T9, typename T10,
3745    typename T11, typename T12, typename T13, typename T14, typename T15,
3746    typename T16, typename T17, typename T18, typename T19, typename T20,
3747    typename T21, typename T22, typename T23, typename T24, typename T25,
3748    typename T26, typename T27, typename T28, typename T29, typename T30,
3749    typename T31, typename T32, typename T33, typename T34, typename T35,
3750    typename T36, typename T37, typename T38, typename T39, typename T40,
3751    typename T41, typename T42, typename T43, typename T44, typename T45,
3752    typename T46>
3753struct Types46 {
3754  typedef T1 Head;
3755  typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3756      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3757      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
3758      T44, T45, T46> Tail;
3759};
3760
3761template <typename T1, typename T2, typename T3, typename T4, typename T5,
3762    typename T6, typename T7, typename T8, typename T9, typename T10,
3763    typename T11, typename T12, typename T13, typename T14, typename T15,
3764    typename T16, typename T17, typename T18, typename T19, typename T20,
3765    typename T21, typename T22, typename T23, typename T24, typename T25,
3766    typename T26, typename T27, typename T28, typename T29, typename T30,
3767    typename T31, typename T32, typename T33, typename T34, typename T35,
3768    typename T36, typename T37, typename T38, typename T39, typename T40,
3769    typename T41, typename T42, typename T43, typename T44, typename T45,
3770    typename T46, typename T47>
3771struct Types47 {
3772  typedef T1 Head;
3773  typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3774      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3775      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
3776      T44, T45, T46, T47> Tail;
3777};
3778
3779template <typename T1, typename T2, typename T3, typename T4, typename T5,
3780    typename T6, typename T7, typename T8, typename T9, typename T10,
3781    typename T11, typename T12, typename T13, typename T14, typename T15,
3782    typename T16, typename T17, typename T18, typename T19, typename T20,
3783    typename T21, typename T22, typename T23, typename T24, typename T25,
3784    typename T26, typename T27, typename T28, typename T29, typename T30,
3785    typename T31, typename T32, typename T33, typename T34, typename T35,
3786    typename T36, typename T37, typename T38, typename T39, typename T40,
3787    typename T41, typename T42, typename T43, typename T44, typename T45,
3788    typename T46, typename T47, typename T48>
3789struct Types48 {
3790  typedef T1 Head;
3791  typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3792      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3793      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
3794      T44, T45, T46, T47, T48> Tail;
3795};
3796
3797template <typename T1, typename T2, typename T3, typename T4, typename T5,
3798    typename T6, typename T7, typename T8, typename T9, typename T10,
3799    typename T11, typename T12, typename T13, typename T14, typename T15,
3800    typename T16, typename T17, typename T18, typename T19, typename T20,
3801    typename T21, typename T22, typename T23, typename T24, typename T25,
3802    typename T26, typename T27, typename T28, typename T29, typename T30,
3803    typename T31, typename T32, typename T33, typename T34, typename T35,
3804    typename T36, typename T37, typename T38, typename T39, typename T40,
3805    typename T41, typename T42, typename T43, typename T44, typename T45,
3806    typename T46, typename T47, typename T48, typename T49>
3807struct Types49 {
3808  typedef T1 Head;
3809  typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3810      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3811      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
3812      T44, T45, T46, T47, T48, T49> Tail;
3813};
3814
3815template <typename T1, typename T2, typename T3, typename T4, typename T5,
3816    typename T6, typename T7, typename T8, typename T9, typename T10,
3817    typename T11, typename T12, typename T13, typename T14, typename T15,
3818    typename T16, typename T17, typename T18, typename T19, typename T20,
3819    typename T21, typename T22, typename T23, typename T24, typename T25,
3820    typename T26, typename T27, typename T28, typename T29, typename T30,
3821    typename T31, typename T32, typename T33, typename T34, typename T35,
3822    typename T36, typename T37, typename T38, typename T39, typename T40,
3823    typename T41, typename T42, typename T43, typename T44, typename T45,
3824    typename T46, typename T47, typename T48, typename T49, typename T50>
3825struct Types50 {
3826  typedef T1 Head;
3827  typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3828      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3829      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
3830      T44, T45, T46, T47, T48, T49, T50> Tail;
3831};
3832
3833
3834}  // namespace internal
3835
3836// We don't want to require the users to write TypesN<...> directly,
3837// as that would require them to count the length.  Types<...> is much
3838// easier to write, but generates horrible messages when there is a
3839// compiler error, as gcc insists on printing out each template
3840// argument, even if it has the default value (this means Types<int>
3841// will appear as Types<int, None, None, ..., None> in the compiler
3842// errors).
3843//
3844// Our solution is to combine the best part of the two approaches: a
3845// user would write Types<T1, ..., TN>, and Google Test will translate
3846// that to TypesN<T1, ..., TN> internally to make error messages
3847// readable.  The translation is done by the 'type' member of the
3848// Types template.
3849template <typename T1 = internal::None, typename T2 = internal::None,
3850    typename T3 = internal::None, typename T4 = internal::None,
3851    typename T5 = internal::None, typename T6 = internal::None,
3852    typename T7 = internal::None, typename T8 = internal::None,
3853    typename T9 = internal::None, typename T10 = internal::None,
3854    typename T11 = internal::None, typename T12 = internal::None,
3855    typename T13 = internal::None, typename T14 = internal::None,
3856    typename T15 = internal::None, typename T16 = internal::None,
3857    typename T17 = internal::None, typename T18 = internal::None,
3858    typename T19 = internal::None, typename T20 = internal::None,
3859    typename T21 = internal::None, typename T22 = internal::None,
3860    typename T23 = internal::None, typename T24 = internal::None,
3861    typename T25 = internal::None, typename T26 = internal::None,
3862    typename T27 = internal::None, typename T28 = internal::None,
3863    typename T29 = internal::None, typename T30 = internal::None,
3864    typename T31 = internal::None, typename T32 = internal::None,
3865    typename T33 = internal::None, typename T34 = internal::None,
3866    typename T35 = internal::None, typename T36 = internal::None,
3867    typename T37 = internal::None, typename T38 = internal::None,
3868    typename T39 = internal::None, typename T40 = internal::None,
3869    typename T41 = internal::None, typename T42 = internal::None,
3870    typename T43 = internal::None, typename T44 = internal::None,
3871    typename T45 = internal::None, typename T46 = internal::None,
3872    typename T47 = internal::None, typename T48 = internal::None,
3873    typename T49 = internal::None, typename T50 = internal::None>
3874struct Types {
3875  typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
3876      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
3877      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
3878      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
3879};
3880
3881template <>
3882struct Types<internal::None, internal::None, internal::None, internal::None,
3883    internal::None, internal::None, internal::None, internal::None,
3884    internal::None, internal::None, internal::None, internal::None,
3885    internal::None, internal::None, internal::None, internal::None,
3886    internal::None, internal::None, internal::None, internal::None,
3887    internal::None, internal::None, internal::None, internal::None,
3888    internal::None, internal::None, internal::None, internal::None,
3889    internal::None, internal::None, internal::None, internal::None,
3890    internal::None, internal::None, internal::None, internal::None,
3891    internal::None, internal::None, internal::None, internal::None,
3892    internal::None, internal::None, internal::None, internal::None,
3893    internal::None, internal::None, internal::None, internal::None,
3894    internal::None, internal::None> {
3895  typedef internal::Types0 type;
3896};
3897template <typename T1>
3898struct Types<T1, internal::None, internal::None, internal::None,
3899    internal::None, internal::None, internal::None, internal::None,
3900    internal::None, internal::None, internal::None, internal::None,
3901    internal::None, internal::None, internal::None, internal::None,
3902    internal::None, internal::None, internal::None, internal::None,
3903    internal::None, internal::None, internal::None, internal::None,
3904    internal::None, internal::None, internal::None, internal::None,
3905    internal::None, internal::None, internal::None, internal::None,
3906    internal::None, internal::None, internal::None, internal::None,
3907    internal::None, internal::None, internal::None, internal::None,
3908    internal::None, internal::None, internal::None, internal::None,
3909    internal::None, internal::None, internal::None, internal::None,
3910    internal::None, internal::None> {
3911  typedef internal::Types1<T1> type;
3912};
3913template <typename T1, typename T2>
3914struct Types<T1, T2, internal::None, internal::None, internal::None,
3915    internal::None, internal::None, internal::None, internal::None,
3916    internal::None, internal::None, internal::None, internal::None,
3917    internal::None, internal::None, internal::None, internal::None,
3918    internal::None, internal::None, internal::None, internal::None,
3919    internal::None, internal::None, internal::None, internal::None,
3920    internal::None, internal::None, internal::None, internal::None,
3921    internal::None, internal::None, internal::None, internal::None,
3922    internal::None, internal::None, internal::None, internal::None,
3923    internal::None, internal::None, internal::None, internal::None,
3924    internal::None, internal::None, internal::None, internal::None,
3925    internal::None, internal::None, internal::None, internal::None,
3926    internal::None> {
3927  typedef internal::Types2<T1, T2> type;
3928};
3929template <typename T1, typename T2, typename T3>
3930struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
3931    internal::None, internal::None, internal::None, internal::None,
3932    internal::None, internal::None, internal::None, internal::None,
3933    internal::None, internal::None, internal::None, internal::None,
3934    internal::None, internal::None, internal::None, internal::None,
3935    internal::None, internal::None, internal::None, internal::None,
3936    internal::None, internal::None, internal::None, internal::None,
3937    internal::None, internal::None, internal::None, internal::None,
3938    internal::None, internal::None, internal::None, internal::None,
3939    internal::None, internal::None, internal::None, internal::None,
3940    internal::None, internal::None, internal::None, internal::None,
3941    internal::None, internal::None, internal::None, internal::None> {
3942  typedef internal::Types3<T1, T2, T3> type;
3943};
3944template <typename T1, typename T2, typename T3, typename T4>
3945struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
3946    internal::None, internal::None, internal::None, internal::None,
3947    internal::None, internal::None, internal::None, internal::None,
3948    internal::None, internal::None, internal::None, internal::None,
3949    internal::None, internal::None, internal::None, internal::None,
3950    internal::None, internal::None, internal::None, internal::None,
3951    internal::None, internal::None, internal::None, internal::None,
3952    internal::None, internal::None, internal::None, internal::None,
3953    internal::None, internal::None, internal::None, internal::None,
3954    internal::None, internal::None, internal::None, internal::None,
3955    internal::None, internal::None, internal::None, internal::None,
3956    internal::None, internal::None, internal::None> {
3957  typedef internal::Types4<T1, T2, T3, T4> type;
3958};
3959template <typename T1, typename T2, typename T3, typename T4, typename T5>
3960struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
3961    internal::None, internal::None, internal::None, internal::None,
3962    internal::None, internal::None, internal::None, internal::None,
3963    internal::None, internal::None, internal::None, internal::None,
3964    internal::None, internal::None, internal::None, internal::None,
3965    internal::None, internal::None, internal::None, internal::None,
3966    internal::None, internal::None, internal::None, internal::None,
3967    internal::None, internal::None, internal::None, internal::None,
3968    internal::None, internal::None, internal::None, internal::None,
3969    internal::None, internal::None, internal::None, internal::None,
3970    internal::None, internal::None, internal::None, internal::None,
3971    internal::None, internal::None, internal::None> {
3972  typedef internal::Types5<T1, T2, T3, T4, T5> type;
3973};
3974template <typename T1, typename T2, typename T3, typename T4, typename T5,
3975    typename T6>
3976struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
3977    internal::None, internal::None, internal::None, internal::None,
3978    internal::None, internal::None, internal::None, internal::None,
3979    internal::None, internal::None, internal::None, internal::None,
3980    internal::None, internal::None, internal::None, internal::None,
3981    internal::None, internal::None, internal::None, internal::None,
3982    internal::None, internal::None, internal::None, internal::None,
3983    internal::None, internal::None, internal::None, internal::None,
3984    internal::None, internal::None, internal::None, internal::None,
3985    internal::None, internal::None, internal::None, internal::None,
3986    internal::None, internal::None, internal::None, internal::None,
3987    internal::None, internal::None> {
3988  typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
3989};
3990template <typename T1, typename T2, typename T3, typename T4, typename T5,
3991    typename T6, typename T7>
3992struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
3993    internal::None, internal::None, internal::None, internal::None,
3994    internal::None, internal::None, internal::None, internal::None,
3995    internal::None, internal::None, internal::None, internal::None,
3996    internal::None, internal::None, internal::None, internal::None,
3997    internal::None, internal::None, internal::None, internal::None,
3998    internal::None, internal::None, internal::None, internal::None,
3999    internal::None, internal::None, internal::None, internal::None,
4000    internal::None, internal::None, internal::None, internal::None,
4001    internal::None, internal::None, internal::None, internal::None,
4002    internal::None, internal::None, internal::None, internal::None,
4003    internal::None> {
4004  typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
4005};
4006template <typename T1, typename T2, typename T3, typename T4, typename T5,
4007    typename T6, typename T7, typename T8>
4008struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
4009    internal::None, internal::None, internal::None, internal::None,
4010    internal::None, internal::None, internal::None, internal::None,
4011    internal::None, internal::None, internal::None, internal::None,
4012    internal::None, internal::None, internal::None, internal::None,
4013    internal::None, internal::None, internal::None, internal::None,
4014    internal::None, internal::None, internal::None, internal::None,
4015    internal::None, internal::None, internal::None, internal::None,
4016    internal::None, internal::None, internal::None, internal::None,
4017    internal::None, internal::None, internal::None, internal::None,
4018    internal::None, internal::None, internal::None, internal::None> {
4019  typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
4020};
4021template <typename T1, typename T2, typename T3, typename T4, typename T5,
4022    typename T6, typename T7, typename T8, typename T9>
4023struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
4024    internal::None, internal::None, internal::None, internal::None,
4025    internal::None, internal::None, internal::None, internal::None,
4026    internal::None, internal::None, internal::None, internal::None,
4027    internal::None, internal::None, internal::None, internal::None,
4028    internal::None, internal::None, internal::None, internal::None,
4029    internal::None, internal::None, internal::None, internal::None,
4030    internal::None, internal::None, internal::None, internal::None,
4031    internal::None, internal::None, internal::None, internal::None,
4032    internal::None, internal::None, internal::None, internal::None,
4033    internal::None, internal::None, internal::None, internal::None> {
4034  typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
4035};
4036template <typename T1, typename T2, typename T3, typename T4, typename T5,
4037    typename T6, typename T7, typename T8, typename T9, typename T10>
4038struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
4039    internal::None, internal::None, internal::None, internal::None,
4040    internal::None, internal::None, internal::None, internal::None,
4041    internal::None, internal::None, internal::None, internal::None,
4042    internal::None, internal::None, internal::None, internal::None,
4043    internal::None, internal::None, internal::None, internal::None,
4044    internal::None, internal::None, internal::None, internal::None,
4045    internal::None, internal::None, internal::None, internal::None,
4046    internal::None, internal::None, internal::None, internal::None,
4047    internal::None, internal::None, internal::None, internal::None,
4048    internal::None, internal::None, internal::None> {
4049  typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
4050};
4051template <typename T1, typename T2, typename T3, typename T4, typename T5,
4052    typename T6, typename T7, typename T8, typename T9, typename T10,
4053    typename T11>
4054struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
4055    internal::None, internal::None, internal::None, internal::None,
4056    internal::None, internal::None, internal::None, internal::None,
4057    internal::None, internal::None, internal::None, internal::None,
4058    internal::None, internal::None, internal::None, internal::None,
4059    internal::None, internal::None, internal::None, internal::None,
4060    internal::None, internal::None, internal::None, internal::None,
4061    internal::None, internal::None, internal::None, internal::None,
4062    internal::None, internal::None, internal::None, internal::None,
4063    internal::None, internal::None, internal::None, internal::None,
4064    internal::None, internal::None> {
4065  typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
4066};
4067template <typename T1, typename T2, typename T3, typename T4, typename T5,
4068    typename T6, typename T7, typename T8, typename T9, typename T10,
4069    typename T11, typename T12>
4070struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
4071    internal::None, internal::None, internal::None, internal::None,
4072    internal::None, internal::None, internal::None, internal::None,
4073    internal::None, internal::None, internal::None, internal::None,
4074    internal::None, internal::None, internal::None, internal::None,
4075    internal::None, internal::None, internal::None, internal::None,
4076    internal::None, internal::None, internal::None, internal::None,
4077    internal::None, internal::None, internal::None, internal::None,
4078    internal::None, internal::None, internal::None, internal::None,
4079    internal::None, internal::None, internal::None, internal::None,
4080    internal::None> {
4081  typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
4082      T12> type;
4083};
4084template <typename T1, typename T2, typename T3, typename T4, typename T5,
4085    typename T6, typename T7, typename T8, typename T9, typename T10,
4086    typename T11, typename T12, typename T13>
4087struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
4088    internal::None, internal::None, internal::None, internal::None,
4089    internal::None, internal::None, internal::None, internal::None,
4090    internal::None, internal::None, internal::None, internal::None,
4091    internal::None, internal::None, internal::None, internal::None,
4092    internal::None, internal::None, internal::None, internal::None,
4093    internal::None, internal::None, internal::None, internal::None,
4094    internal::None, internal::None, internal::None, internal::None,
4095    internal::None, internal::None, internal::None, internal::None,
4096    internal::None, internal::None, internal::None, internal::None,
4097    internal::None> {
4098  typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4099      T13> type;
4100};
4101template <typename T1, typename T2, typename T3, typename T4, typename T5,
4102    typename T6, typename T7, typename T8, typename T9, typename T10,
4103    typename T11, typename T12, typename T13, typename T14>
4104struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4105    internal::None, internal::None, internal::None, internal::None,
4106    internal::None, internal::None, internal::None, internal::None,
4107    internal::None, internal::None, internal::None, internal::None,
4108    internal::None, internal::None, internal::None, internal::None,
4109    internal::None, internal::None, internal::None, internal::None,
4110    internal::None, internal::None, internal::None, internal::None,
4111    internal::None, internal::None, internal::None, internal::None,
4112    internal::None, internal::None, internal::None, internal::None,
4113    internal::None, internal::None, internal::None, internal::None> {
4114  typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4115      T13, T14> type;
4116};
4117template <typename T1, typename T2, typename T3, typename T4, typename T5,
4118    typename T6, typename T7, typename T8, typename T9, typename T10,
4119    typename T11, typename T12, typename T13, typename T14, typename T15>
4120struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4121    internal::None, internal::None, internal::None, internal::None,
4122    internal::None, internal::None, internal::None, internal::None,
4123    internal::None, internal::None, internal::None, internal::None,
4124    internal::None, internal::None, internal::None, internal::None,
4125    internal::None, internal::None, internal::None, internal::None,
4126    internal::None, internal::None, internal::None, internal::None,
4127    internal::None, internal::None, internal::None, internal::None,
4128    internal::None, internal::None, internal::None, internal::None,
4129    internal::None, internal::None, internal::None> {
4130  typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4131      T13, T14, T15> type;
4132};
4133template <typename T1, typename T2, typename T3, typename T4, typename T5,
4134    typename T6, typename T7, typename T8, typename T9, typename T10,
4135    typename T11, typename T12, typename T13, typename T14, typename T15,
4136    typename T16>
4137struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4138    T16, internal::None, internal::None, internal::None, internal::None,
4139    internal::None, internal::None, internal::None, internal::None,
4140    internal::None, internal::None, internal::None, internal::None,
4141    internal::None, internal::None, internal::None, internal::None,
4142    internal::None, internal::None, internal::None, internal::None,
4143    internal::None, internal::None, internal::None, internal::None,
4144    internal::None, internal::None, internal::None, internal::None,
4145    internal::None, internal::None, internal::None, internal::None,
4146    internal::None, internal::None> {
4147  typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4148      T13, T14, T15, T16> type;
4149};
4150template <typename T1, typename T2, typename T3, typename T4, typename T5,
4151    typename T6, typename T7, typename T8, typename T9, typename T10,
4152    typename T11, typename T12, typename T13, typename T14, typename T15,
4153    typename T16, typename T17>
4154struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4155    T16, T17, internal::None, internal::None, internal::None, internal::None,
4156    internal::None, internal::None, internal::None, internal::None,
4157    internal::None, internal::None, internal::None, internal::None,
4158    internal::None, internal::None, internal::None, internal::None,
4159    internal::None, internal::None, internal::None, internal::None,
4160    internal::None, internal::None, internal::None, internal::None,
4161    internal::None, internal::None, internal::None, internal::None,
4162    internal::None, internal::None, internal::None, internal::None,
4163    internal::None> {
4164  typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4165      T13, T14, T15, T16, T17> type;
4166};
4167template <typename T1, typename T2, typename T3, typename T4, typename T5,
4168    typename T6, typename T7, typename T8, typename T9, typename T10,
4169    typename T11, typename T12, typename T13, typename T14, typename T15,
4170    typename T16, typename T17, typename T18>
4171struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4172    T16, T17, T18, internal::None, internal::None, internal::None,
4173    internal::None, internal::None, internal::None, internal::None,
4174    internal::None, internal::None, internal::None, internal::None,
4175    internal::None, internal::None, internal::None, internal::None,
4176    internal::None, internal::None, internal::None, internal::None,
4177    internal::None, internal::None, internal::None, internal::None,
4178    internal::None, internal::None, internal::None, internal::None,
4179    internal::None, internal::None, internal::None, internal::None,
4180    internal::None> {
4181  typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4182      T13, T14, T15, T16, T17, T18> type;
4183};
4184template <typename T1, typename T2, typename T3, typename T4, typename T5,
4185    typename T6, typename T7, typename T8, typename T9, typename T10,
4186    typename T11, typename T12, typename T13, typename T14, typename T15,
4187    typename T16, typename T17, typename T18, typename T19>
4188struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4189    T16, T17, T18, T19, internal::None, internal::None, internal::None,
4190    internal::None, internal::None, internal::None, internal::None,
4191    internal::None, internal::None, internal::None, internal::None,
4192    internal::None, internal::None, internal::None, internal::None,
4193    internal::None, internal::None, internal::None, internal::None,
4194    internal::None, internal::None, internal::None, internal::None,
4195    internal::None, internal::None, internal::None, internal::None,
4196    internal::None, internal::None, internal::None, internal::None> {
4197  typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4198      T13, T14, T15, T16, T17, T18, T19> type;
4199};
4200template <typename T1, typename T2, typename T3, typename T4, typename T5,
4201    typename T6, typename T7, typename T8, typename T9, typename T10,
4202    typename T11, typename T12, typename T13, typename T14, typename T15,
4203    typename T16, typename T17, typename T18, typename T19, typename T20>
4204struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4205    T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
4206    internal::None, internal::None, internal::None, internal::None,
4207    internal::None, internal::None, internal::None, internal::None,
4208    internal::None, internal::None, internal::None, internal::None,
4209    internal::None, internal::None, internal::None, internal::None,
4210    internal::None, internal::None, internal::None, internal::None,
4211    internal::None, internal::None, internal::None, internal::None,
4212    internal::None, internal::None, internal::None> {
4213  typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4214      T13, T14, T15, T16, T17, T18, T19, T20> type;
4215};
4216template <typename T1, typename T2, typename T3, typename T4, typename T5,
4217    typename T6, typename T7, typename T8, typename T9, typename T10,
4218    typename T11, typename T12, typename T13, typename T14, typename T15,
4219    typename T16, typename T17, typename T18, typename T19, typename T20,
4220    typename T21>
4221struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4222    T16, T17, T18, T19, T20, T21, internal::None, internal::None,
4223    internal::None, internal::None, internal::None, internal::None,
4224    internal::None, internal::None, internal::None, internal::None,
4225    internal::None, internal::None, internal::None, internal::None,
4226    internal::None, internal::None, internal::None, internal::None,
4227    internal::None, internal::None, internal::None, internal::None,
4228    internal::None, internal::None, internal::None, internal::None,
4229    internal::None, internal::None, internal::None> {
4230  typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4231      T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
4232};
4233template <typename T1, typename T2, typename T3, typename T4, typename T5,
4234    typename T6, typename T7, typename T8, typename T9, typename T10,
4235    typename T11, typename T12, typename T13, typename T14, typename T15,
4236    typename T16, typename T17, typename T18, typename T19, typename T20,
4237    typename T21, typename T22>
4238struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4239    T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
4240    internal::None, internal::None, internal::None, internal::None,
4241    internal::None, internal::None, internal::None, internal::None,
4242    internal::None, internal::None, internal::None, internal::None,
4243    internal::None, internal::None, internal::None, internal::None,
4244    internal::None, internal::None, internal::None, internal::None,
4245    internal::None, internal::None, internal::None, internal::None,
4246    internal::None, internal::None> {
4247  typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4248      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
4249};
4250template <typename T1, typename T2, typename T3, typename T4, typename T5,
4251    typename T6, typename T7, typename T8, typename T9, typename T10,
4252    typename T11, typename T12, typename T13, typename T14, typename T15,
4253    typename T16, typename T17, typename T18, typename T19, typename T20,
4254    typename T21, typename T22, typename T23>
4255struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4256    T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
4257    internal::None, internal::None, internal::None, internal::None,
4258    internal::None, internal::None, internal::None, internal::None,
4259    internal::None, internal::None, internal::None, internal::None,
4260    internal::None, internal::None, internal::None, internal::None,
4261    internal::None, internal::None, internal::None, internal::None,
4262    internal::None, internal::None, internal::None, internal::None,
4263    internal::None> {
4264  typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4265      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
4266};
4267template <typename T1, typename T2, typename T3, typename T4, typename T5,
4268    typename T6, typename T7, typename T8, typename T9, typename T10,
4269    typename T11, typename T12, typename T13, typename T14, typename T15,
4270    typename T16, typename T17, typename T18, typename T19, typename T20,
4271    typename T21, typename T22, typename T23, typename T24>
4272struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4273    T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
4274    internal::None, internal::None, internal::None, internal::None,
4275    internal::None, internal::None, internal::None, internal::None,
4276    internal::None, internal::None, internal::None, internal::None,
4277    internal::None, internal::None, internal::None, internal::None,
4278    internal::None, internal::None, internal::None, internal::None,
4279    internal::None, internal::None, internal::None, internal::None,
4280    internal::None> {
4281  typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4282      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
4283};
4284template <typename T1, typename T2, typename T3, typename T4, typename T5,
4285    typename T6, typename T7, typename T8, typename T9, typename T10,
4286    typename T11, typename T12, typename T13, typename T14, typename T15,
4287    typename T16, typename T17, typename T18, typename T19, typename T20,
4288    typename T21, typename T22, typename T23, typename T24, typename T25>
4289struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4290    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
4291    internal::None, internal::None, internal::None, internal::None,
4292    internal::None, internal::None, internal::None, internal::None,
4293    internal::None, internal::None, internal::None, internal::None,
4294    internal::None, internal::None, internal::None, internal::None,
4295    internal::None, internal::None, internal::None, internal::None,
4296    internal::None, internal::None, internal::None, internal::None> {
4297  typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4298      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
4299};
4300template <typename T1, typename T2, typename T3, typename T4, typename T5,
4301    typename T6, typename T7, typename T8, typename T9, typename T10,
4302    typename T11, typename T12, typename T13, typename T14, typename T15,
4303    typename T16, typename T17, typename T18, typename T19, typename T20,
4304    typename T21, typename T22, typename T23, typename T24, typename T25,
4305    typename T26>
4306struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4307    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
4308    internal::None, internal::None, internal::None, internal::None,
4309    internal::None, internal::None, internal::None, internal::None,
4310    internal::None, internal::None, internal::None, internal::None,
4311    internal::None, internal::None, internal::None, internal::None,
4312    internal::None, internal::None, internal::None, internal::None,
4313    internal::None, internal::None, internal::None> {
4314  typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4315      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
4316      T26> type;
4317};
4318template <typename T1, typename T2, typename T3, typename T4, typename T5,
4319    typename T6, typename T7, typename T8, typename T9, typename T10,
4320    typename T11, typename T12, typename T13, typename T14, typename T15,
4321    typename T16, typename T17, typename T18, typename T19, typename T20,
4322    typename T21, typename T22, typename T23, typename T24, typename T25,
4323    typename T26, typename T27>
4324struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4325    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
4326    internal::None, internal::None, internal::None, internal::None,
4327    internal::None, internal::None, internal::None, internal::None,
4328    internal::None, internal::None, internal::None, internal::None,
4329    internal::None, internal::None, internal::None, internal::None,
4330    internal::None, internal::None, internal::None, internal::None,
4331    internal::None, internal::None> {
4332  typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4333      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4334      T27> type;
4335};
4336template <typename T1, typename T2, typename T3, typename T4, typename T5,
4337    typename T6, typename T7, typename T8, typename T9, typename T10,
4338    typename T11, typename T12, typename T13, typename T14, typename T15,
4339    typename T16, typename T17, typename T18, typename T19, typename T20,
4340    typename T21, typename T22, typename T23, typename T24, typename T25,
4341    typename T26, typename T27, typename T28>
4342struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4343    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
4344    internal::None, internal::None, internal::None, internal::None,
4345    internal::None, internal::None, internal::None, internal::None,
4346    internal::None, internal::None, internal::None, internal::None,
4347    internal::None, internal::None, internal::None, internal::None,
4348    internal::None, internal::None, internal::None, internal::None,
4349    internal::None, internal::None> {
4350  typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4351      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4352      T27, T28> type;
4353};
4354template <typename T1, typename T2, typename T3, typename T4, typename T5,
4355    typename T6, typename T7, typename T8, typename T9, typename T10,
4356    typename T11, typename T12, typename T13, typename T14, typename T15,
4357    typename T16, typename T17, typename T18, typename T19, typename T20,
4358    typename T21, typename T22, typename T23, typename T24, typename T25,
4359    typename T26, typename T27, typename T28, typename T29>
4360struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4361    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4362    internal::None, internal::None, internal::None, internal::None,
4363    internal::None, internal::None, internal::None, internal::None,
4364    internal::None, internal::None, internal::None, internal::None,
4365    internal::None, internal::None, internal::None, internal::None,
4366    internal::None, internal::None, internal::None, internal::None,
4367    internal::None> {
4368  typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4369      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4370      T27, T28, T29> type;
4371};
4372template <typename T1, typename T2, typename T3, typename T4, typename T5,
4373    typename T6, typename T7, typename T8, typename T9, typename T10,
4374    typename T11, typename T12, typename T13, typename T14, typename T15,
4375    typename T16, typename T17, typename T18, typename T19, typename T20,
4376    typename T21, typename T22, typename T23, typename T24, typename T25,
4377    typename T26, typename T27, typename T28, typename T29, typename T30>
4378struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4379    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4380    internal::None, internal::None, internal::None, internal::None,
4381    internal::None, internal::None, internal::None, internal::None,
4382    internal::None, internal::None, internal::None, internal::None,
4383    internal::None, internal::None, internal::None, internal::None,
4384    internal::None, internal::None, internal::None, internal::None> {
4385  typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4386      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4387      T27, T28, T29, T30> type;
4388};
4389template <typename T1, typename T2, typename T3, typename T4, typename T5,
4390    typename T6, typename T7, typename T8, typename T9, typename T10,
4391    typename T11, typename T12, typename T13, typename T14, typename T15,
4392    typename T16, typename T17, typename T18, typename T19, typename T20,
4393    typename T21, typename T22, typename T23, typename T24, typename T25,
4394    typename T26, typename T27, typename T28, typename T29, typename T30,
4395    typename T31>
4396struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4397    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4398    T31, internal::None, internal::None, internal::None, internal::None,
4399    internal::None, internal::None, internal::None, internal::None,
4400    internal::None, internal::None, internal::None, internal::None,
4401    internal::None, internal::None, internal::None, internal::None,
4402    internal::None, internal::None, internal::None> {
4403  typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4404      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4405      T27, T28, T29, T30, T31> type;
4406};
4407template <typename T1, typename T2, typename T3, typename T4, typename T5,
4408    typename T6, typename T7, typename T8, typename T9, typename T10,
4409    typename T11, typename T12, typename T13, typename T14, typename T15,
4410    typename T16, typename T17, typename T18, typename T19, typename T20,
4411    typename T21, typename T22, typename T23, typename T24, typename T25,
4412    typename T26, typename T27, typename T28, typename T29, typename T30,
4413    typename T31, typename T32>
4414struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4415    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4416    T31, T32, internal::None, internal::None, internal::None, internal::None,
4417    internal::None, internal::None, internal::None, internal::None,
4418    internal::None, internal::None, internal::None, internal::None,
4419    internal::None, internal::None, internal::None, internal::None,
4420    internal::None, internal::None> {
4421  typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4422      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4423      T27, T28, T29, T30, T31, T32> type;
4424};
4425template <typename T1, typename T2, typename T3, typename T4, typename T5,
4426    typename T6, typename T7, typename T8, typename T9, typename T10,
4427    typename T11, typename T12, typename T13, typename T14, typename T15,
4428    typename T16, typename T17, typename T18, typename T19, typename T20,
4429    typename T21, typename T22, typename T23, typename T24, typename T25,
4430    typename T26, typename T27, typename T28, typename T29, typename T30,
4431    typename T31, typename T32, typename T33>
4432struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4433    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4434    T31, T32, T33, internal::None, internal::None, internal::None,
4435    internal::None, internal::None, internal::None, internal::None,
4436    internal::None, internal::None, internal::None, internal::None,
4437    internal::None, internal::None, internal::None, internal::None,
4438    internal::None, internal::None> {
4439  typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4440      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4441      T27, T28, T29, T30, T31, T32, T33> type;
4442};
4443template <typename T1, typename T2, typename T3, typename T4, typename T5,
4444    typename T6, typename T7, typename T8, typename T9, typename T10,
4445    typename T11, typename T12, typename T13, typename T14, typename T15,
4446    typename T16, typename T17, typename T18, typename T19, typename T20,
4447    typename T21, typename T22, typename T23, typename T24, typename T25,
4448    typename T26, typename T27, typename T28, typename T29, typename T30,
4449    typename T31, typename T32, typename T33, typename T34>
4450struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4451    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4452    T31, T32, T33, T34, internal::None, internal::None, internal::None,
4453    internal::None, internal::None, internal::None, internal::None,
4454    internal::None, internal::None, internal::None, internal::None,
4455    internal::None, internal::None, internal::None, internal::None,
4456    internal::None> {
4457  typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4458      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4459      T27, T28, T29, T30, T31, T32, T33, T34> type;
4460};
4461template <typename T1, typename T2, typename T3, typename T4, typename T5,
4462    typename T6, typename T7, typename T8, typename T9, typename T10,
4463    typename T11, typename T12, typename T13, typename T14, typename T15,
4464    typename T16, typename T17, typename T18, typename T19, typename T20,
4465    typename T21, typename T22, typename T23, typename T24, typename T25,
4466    typename T26, typename T27, typename T28, typename T29, typename T30,
4467    typename T31, typename T32, typename T33, typename T34, typename T35>
4468struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4469    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4470    T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
4471    internal::None, internal::None, internal::None, internal::None,
4472    internal::None, internal::None, internal::None, internal::None,
4473    internal::None, internal::None, internal::None, internal::None> {
4474  typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4475      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4476      T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
4477};
4478template <typename T1, typename T2, typename T3, typename T4, typename T5,
4479    typename T6, typename T7, typename T8, typename T9, typename T10,
4480    typename T11, typename T12, typename T13, typename T14, typename T15,
4481    typename T16, typename T17, typename T18, typename T19, typename T20,
4482    typename T21, typename T22, typename T23, typename T24, typename T25,
4483    typename T26, typename T27, typename T28, typename T29, typename T30,
4484    typename T31, typename T32, typename T33, typename T34, typename T35,
4485    typename T36>
4486struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4487    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4488    T31, T32, T33, T34, T35, T36, internal::None, internal::None,
4489    internal::None, internal::None, internal::None, internal::None,
4490    internal::None, internal::None, internal::None, internal::None,
4491    internal::None, internal::None, internal::None, internal::None> {
4492  typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4493      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4494      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
4495};
4496template <typename T1, typename T2, typename T3, typename T4, typename T5,
4497    typename T6, typename T7, typename T8, typename T9, typename T10,
4498    typename T11, typename T12, typename T13, typename T14, typename T15,
4499    typename T16, typename T17, typename T18, typename T19, typename T20,
4500    typename T21, typename T22, typename T23, typename T24, typename T25,
4501    typename T26, typename T27, typename T28, typename T29, typename T30,
4502    typename T31, typename T32, typename T33, typename T34, typename T35,
4503    typename T36, typename T37>
4504struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4505    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4506    T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
4507    internal::None, internal::None, internal::None, internal::None,
4508    internal::None, internal::None, internal::None, internal::None,
4509    internal::None, internal::None, internal::None> {
4510  typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4511      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4512      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
4513};
4514template <typename T1, typename T2, typename T3, typename T4, typename T5,
4515    typename T6, typename T7, typename T8, typename T9, typename T10,
4516    typename T11, typename T12, typename T13, typename T14, typename T15,
4517    typename T16, typename T17, typename T18, typename T19, typename T20,
4518    typename T21, typename T22, typename T23, typename T24, typename T25,
4519    typename T26, typename T27, typename T28, typename T29, typename T30,
4520    typename T31, typename T32, typename T33, typename T34, typename T35,
4521    typename T36, typename T37, typename T38>
4522struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4523    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4524    T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
4525    internal::None, internal::None, internal::None, internal::None,
4526    internal::None, internal::None, internal::None, internal::None,
4527    internal::None, internal::None> {
4528  typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4529      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4530      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
4531};
4532template <typename T1, typename T2, typename T3, typename T4, typename T5,
4533    typename T6, typename T7, typename T8, typename T9, typename T10,
4534    typename T11, typename T12, typename T13, typename T14, typename T15,
4535    typename T16, typename T17, typename T18, typename T19, typename T20,
4536    typename T21, typename T22, typename T23, typename T24, typename T25,
4537    typename T26, typename T27, typename T28, typename T29, typename T30,
4538    typename T31, typename T32, typename T33, typename T34, typename T35,
4539    typename T36, typename T37, typename T38, typename T39>
4540struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4541    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4542    T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
4543    internal::None, internal::None, internal::None, internal::None,
4544    internal::None, internal::None, internal::None, internal::None,
4545    internal::None, internal::None> {
4546  typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4547      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4548      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
4549};
4550template <typename T1, typename T2, typename T3, typename T4, typename T5,
4551    typename T6, typename T7, typename T8, typename T9, typename T10,
4552    typename T11, typename T12, typename T13, typename T14, typename T15,
4553    typename T16, typename T17, typename T18, typename T19, typename T20,
4554    typename T21, typename T22, typename T23, typename T24, typename T25,
4555    typename T26, typename T27, typename T28, typename T29, typename T30,
4556    typename T31, typename T32, typename T33, typename T34, typename T35,
4557    typename T36, typename T37, typename T38, typename T39, typename T40>
4558struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4559    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4560    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
4561    internal::None, internal::None, internal::None, internal::None,
4562    internal::None, internal::None, internal::None, internal::None,
4563    internal::None> {
4564  typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4565      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4566      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
4567      T40> type;
4568};
4569template <typename T1, typename T2, typename T3, typename T4, typename T5,
4570    typename T6, typename T7, typename T8, typename T9, typename T10,
4571    typename T11, typename T12, typename T13, typename T14, typename T15,
4572    typename T16, typename T17, typename T18, typename T19, typename T20,
4573    typename T21, typename T22, typename T23, typename T24, typename T25,
4574    typename T26, typename T27, typename T28, typename T29, typename T30,
4575    typename T31, typename T32, typename T33, typename T34, typename T35,
4576    typename T36, typename T37, typename T38, typename T39, typename T40,
4577    typename T41>
4578struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4579    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4580    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
4581    internal::None, internal::None, internal::None, internal::None,
4582    internal::None, internal::None, internal::None, internal::None> {
4583  typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4584      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4585      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4586      T41> type;
4587};
4588template <typename T1, typename T2, typename T3, typename T4, typename T5,
4589    typename T6, typename T7, typename T8, typename T9, typename T10,
4590    typename T11, typename T12, typename T13, typename T14, typename T15,
4591    typename T16, typename T17, typename T18, typename T19, typename T20,
4592    typename T21, typename T22, typename T23, typename T24, typename T25,
4593    typename T26, typename T27, typename T28, typename T29, typename T30,
4594    typename T31, typename T32, typename T33, typename T34, typename T35,
4595    typename T36, typename T37, typename T38, typename T39, typename T40,
4596    typename T41, typename T42>
4597struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4598    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4599    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
4600    internal::None, internal::None, internal::None, internal::None,
4601    internal::None, internal::None, internal::None> {
4602  typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4603      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4604      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4605      T41, T42> type;
4606};
4607template <typename T1, typename T2, typename T3, typename T4, typename T5,
4608    typename T6, typename T7, typename T8, typename T9, typename T10,
4609    typename T11, typename T12, typename T13, typename T14, typename T15,
4610    typename T16, typename T17, typename T18, typename T19, typename T20,
4611    typename T21, typename T22, typename T23, typename T24, typename T25,
4612    typename T26, typename T27, typename T28, typename T29, typename T30,
4613    typename T31, typename T32, typename T33, typename T34, typename T35,
4614    typename T36, typename T37, typename T38, typename T39, typename T40,
4615    typename T41, typename T42, typename T43>
4616struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4617    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4618    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4619    internal::None, internal::None, internal::None, internal::None,
4620    internal::None, internal::None, internal::None> {
4621  typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4622      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4623      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4624      T41, T42, T43> type;
4625};
4626template <typename T1, typename T2, typename T3, typename T4, typename T5,
4627    typename T6, typename T7, typename T8, typename T9, typename T10,
4628    typename T11, typename T12, typename T13, typename T14, typename T15,
4629    typename T16, typename T17, typename T18, typename T19, typename T20,
4630    typename T21, typename T22, typename T23, typename T24, typename T25,
4631    typename T26, typename T27, typename T28, typename T29, typename T30,
4632    typename T31, typename T32, typename T33, typename T34, typename T35,
4633    typename T36, typename T37, typename T38, typename T39, typename T40,
4634    typename T41, typename T42, typename T43, typename T44>
4635struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4636    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4637    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
4638    internal::None, internal::None, internal::None, internal::None,
4639    internal::None, internal::None> {
4640  typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4641      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4642      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4643      T41, T42, T43, T44> type;
4644};
4645template <typename T1, typename T2, typename T3, typename T4, typename T5,
4646    typename T6, typename T7, typename T8, typename T9, typename T10,
4647    typename T11, typename T12, typename T13, typename T14, typename T15,
4648    typename T16, typename T17, typename T18, typename T19, typename T20,
4649    typename T21, typename T22, typename T23, typename T24, typename T25,
4650    typename T26, typename T27, typename T28, typename T29, typename T30,
4651    typename T31, typename T32, typename T33, typename T34, typename T35,
4652    typename T36, typename T37, typename T38, typename T39, typename T40,
4653    typename T41, typename T42, typename T43, typename T44, typename T45>
4654struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4655    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4656    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
4657    internal::None, internal::None, internal::None, internal::None,
4658    internal::None> {
4659  typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4660      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4661      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4662      T41, T42, T43, T44, T45> type;
4663};
4664template <typename T1, typename T2, typename T3, typename T4, typename T5,
4665    typename T6, typename T7, typename T8, typename T9, typename T10,
4666    typename T11, typename T12, typename T13, typename T14, typename T15,
4667    typename T16, typename T17, typename T18, typename T19, typename T20,
4668    typename T21, typename T22, typename T23, typename T24, typename T25,
4669    typename T26, typename T27, typename T28, typename T29, typename T30,
4670    typename T31, typename T32, typename T33, typename T34, typename T35,
4671    typename T36, typename T37, typename T38, typename T39, typename T40,
4672    typename T41, typename T42, typename T43, typename T44, typename T45,
4673    typename T46>
4674struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4675    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4676    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
4677    T46, internal::None, internal::None, internal::None, internal::None> {
4678  typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4679      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4680      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4681      T41, T42, T43, T44, T45, T46> type;
4682};
4683template <typename T1, typename T2, typename T3, typename T4, typename T5,
4684    typename T6, typename T7, typename T8, typename T9, typename T10,
4685    typename T11, typename T12, typename T13, typename T14, typename T15,
4686    typename T16, typename T17, typename T18, typename T19, typename T20,
4687    typename T21, typename T22, typename T23, typename T24, typename T25,
4688    typename T26, typename T27, typename T28, typename T29, typename T30,
4689    typename T31, typename T32, typename T33, typename T34, typename T35,
4690    typename T36, typename T37, typename T38, typename T39, typename T40,
4691    typename T41, typename T42, typename T43, typename T44, typename T45,
4692    typename T46, typename T47>
4693struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4694    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4695    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
4696    T46, T47, internal::None, internal::None, internal::None> {
4697  typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4698      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4699      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4700      T41, T42, T43, T44, T45, T46, T47> type;
4701};
4702template <typename T1, typename T2, typename T3, typename T4, typename T5,
4703    typename T6, typename T7, typename T8, typename T9, typename T10,
4704    typename T11, typename T12, typename T13, typename T14, typename T15,
4705    typename T16, typename T17, typename T18, typename T19, typename T20,
4706    typename T21, typename T22, typename T23, typename T24, typename T25,
4707    typename T26, typename T27, typename T28, typename T29, typename T30,
4708    typename T31, typename T32, typename T33, typename T34, typename T35,
4709    typename T36, typename T37, typename T38, typename T39, typename T40,
4710    typename T41, typename T42, typename T43, typename T44, typename T45,
4711    typename T46, typename T47, typename T48>
4712struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4713    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4714    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
4715    T46, T47, T48, internal::None, internal::None> {
4716  typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4717      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4718      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4719      T41, T42, T43, T44, T45, T46, T47, T48> type;
4720};
4721template <typename T1, typename T2, typename T3, typename T4, typename T5,
4722    typename T6, typename T7, typename T8, typename T9, typename T10,
4723    typename T11, typename T12, typename T13, typename T14, typename T15,
4724    typename T16, typename T17, typename T18, typename T19, typename T20,
4725    typename T21, typename T22, typename T23, typename T24, typename T25,
4726    typename T26, typename T27, typename T28, typename T29, typename T30,
4727    typename T31, typename T32, typename T33, typename T34, typename T35,
4728    typename T36, typename T37, typename T38, typename T39, typename T40,
4729    typename T41, typename T42, typename T43, typename T44, typename T45,
4730    typename T46, typename T47, typename T48, typename T49>
4731struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4732    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4733    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
4734    T46, T47, T48, T49, internal::None> {
4735  typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4736      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4737      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4738      T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
4739};
4740
4741namespace internal {
4742
4743#define GTEST_TEMPLATE_ template <typename T> class
4744
4745// The template "selector" struct TemplateSel<Tmpl> is used to
4746// represent Tmpl, which must be a class template with one type
4747// parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined
4748// as the type Tmpl<T>.  This allows us to actually instantiate the
4749// template "selected" by TemplateSel<Tmpl>.
4750//
4751// This trick is necessary for simulating typedef for class templates,
4752// which C++ doesn't support directly.
4753template <GTEST_TEMPLATE_ Tmpl>
4754struct TemplateSel {
4755  template <typename T>
4756  struct Bind {
4757    typedef Tmpl<T> type;
4758  };
4759};
4760
4761#define GTEST_BIND_(TmplSel, T) \
4762  TmplSel::template Bind<T>::type
4763
4764// A unique struct template used as the default value for the
4765// arguments of class template Templates.  This allows us to simulate
4766// variadic templates (e.g. Templates<int>, Templates<int, double>,
4767// and etc), which C++ doesn't support directly.
4768template <typename T>
4769struct NoneT {};
4770
4771// The following family of struct and struct templates are used to
4772// represent template lists.  In particular, TemplatesN<T1, T2, ...,
4773// TN> represents a list of N templates (T1, T2, ..., and TN).  Except
4774// for Templates0, every struct in the family has two member types:
4775// Head for the selector of the first template in the list, and Tail
4776// for the rest of the list.
4777
4778// The empty template list.
4779struct Templates0 {};
4780
4781// Template lists of length 1, 2, 3, and so on.
4782
4783template <GTEST_TEMPLATE_ T1>
4784struct Templates1 {
4785  typedef TemplateSel<T1> Head;
4786  typedef Templates0 Tail;
4787};
4788template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
4789struct Templates2 {
4790  typedef TemplateSel<T1> Head;
4791  typedef Templates1<T2> Tail;
4792};
4793
4794template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
4795struct Templates3 {
4796  typedef TemplateSel<T1> Head;
4797  typedef Templates2<T2, T3> Tail;
4798};
4799
4800template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4801    GTEST_TEMPLATE_ T4>
4802struct Templates4 {
4803  typedef TemplateSel<T1> Head;
4804  typedef Templates3<T2, T3, T4> Tail;
4805};
4806
4807template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4808    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
4809struct Templates5 {
4810  typedef TemplateSel<T1> Head;
4811  typedef Templates4<T2, T3, T4, T5> Tail;
4812};
4813
4814template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4815    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
4816struct Templates6 {
4817  typedef TemplateSel<T1> Head;
4818  typedef Templates5<T2, T3, T4, T5, T6> Tail;
4819};
4820
4821template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4822    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4823    GTEST_TEMPLATE_ T7>
4824struct Templates7 {
4825  typedef TemplateSel<T1> Head;
4826  typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
4827};
4828
4829template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4830    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4831    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
4832struct Templates8 {
4833  typedef TemplateSel<T1> Head;
4834  typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
4835};
4836
4837template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4838    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4839    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
4840struct Templates9 {
4841  typedef TemplateSel<T1> Head;
4842  typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
4843};
4844
4845template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4846    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4847    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4848    GTEST_TEMPLATE_ T10>
4849struct Templates10 {
4850  typedef TemplateSel<T1> Head;
4851  typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
4852};
4853
4854template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4855    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4856    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4857    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
4858struct Templates11 {
4859  typedef TemplateSel<T1> Head;
4860  typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
4861};
4862
4863template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4864    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4865    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4866    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
4867struct Templates12 {
4868  typedef TemplateSel<T1> Head;
4869  typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
4870};
4871
4872template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4873    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4874    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4875    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
4876    GTEST_TEMPLATE_ T13>
4877struct Templates13 {
4878  typedef TemplateSel<T1> Head;
4879  typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
4880};
4881
4882template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4883    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4884    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4885    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
4886    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
4887struct Templates14 {
4888  typedef TemplateSel<T1> Head;
4889  typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
4890      T14> Tail;
4891};
4892
4893template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4894    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4895    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4896    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
4897    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
4898struct Templates15 {
4899  typedef TemplateSel<T1> Head;
4900  typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4901      T15> Tail;
4902};
4903
4904template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4905    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4906    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4907    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
4908    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
4909    GTEST_TEMPLATE_ T16>
4910struct Templates16 {
4911  typedef TemplateSel<T1> Head;
4912  typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4913      T15, T16> Tail;
4914};
4915
4916template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4917    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4918    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4919    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
4920    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
4921    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
4922struct Templates17 {
4923  typedef TemplateSel<T1> Head;
4924  typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4925      T15, T16, T17> Tail;
4926};
4927
4928template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4929    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4930    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4931    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
4932    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
4933    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
4934struct Templates18 {
4935  typedef TemplateSel<T1> Head;
4936  typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4937      T15, T16, T17, T18> Tail;
4938};
4939
4940template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4941    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4942    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4943    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
4944    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
4945    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
4946    GTEST_TEMPLATE_ T19>
4947struct Templates19 {
4948  typedef TemplateSel<T1> Head;
4949  typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4950      T15, T16, T17, T18, T19> Tail;
4951};
4952
4953template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4954    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4955    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4956    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
4957    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
4958    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
4959    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
4960struct Templates20 {
4961  typedef TemplateSel<T1> Head;
4962  typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4963      T15, T16, T17, T18, T19, T20> Tail;
4964};
4965
4966template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4967    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4968    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4969    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
4970    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
4971    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
4972    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
4973struct Templates21 {
4974  typedef TemplateSel<T1> Head;
4975  typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4976      T15, T16, T17, T18, T19, T20, T21> Tail;
4977};
4978
4979template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4980    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4981    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4982    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
4983    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
4984    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
4985    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
4986    GTEST_TEMPLATE_ T22>
4987struct Templates22 {
4988  typedef TemplateSel<T1> Head;
4989  typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4990      T15, T16, T17, T18, T19, T20, T21, T22> Tail;
4991};
4992
4993template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
4994    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
4995    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
4996    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
4997    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
4998    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
4999    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5000    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
5001struct Templates23 {
5002  typedef TemplateSel<T1> Head;
5003  typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5004      T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
5005};
5006
5007template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5008    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5009    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5010    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5011    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5012    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5013    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5014    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
5015struct Templates24 {
5016  typedef TemplateSel<T1> Head;
5017  typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5018      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
5019};
5020
5021template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5022    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5023    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5024    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5025    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5026    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5027    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5028    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5029    GTEST_TEMPLATE_ T25>
5030struct Templates25 {
5031  typedef TemplateSel<T1> Head;
5032  typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5033      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
5034};
5035
5036template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5037    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5038    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5039    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5040    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5041    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5042    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5043    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5044    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
5045struct Templates26 {
5046  typedef TemplateSel<T1> Head;
5047  typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5048      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
5049};
5050
5051template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5052    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5053    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5054    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5055    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5056    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5057    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5058    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5059    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
5060struct Templates27 {
5061  typedef TemplateSel<T1> Head;
5062  typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5063      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
5064};
5065
5066template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5067    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5068    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5069    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5070    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5071    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5072    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5073    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5074    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5075    GTEST_TEMPLATE_ T28>
5076struct Templates28 {
5077  typedef TemplateSel<T1> Head;
5078  typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5079      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5080      T28> Tail;
5081};
5082
5083template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5084    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5085    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5086    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5087    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5088    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5089    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5090    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5091    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5092    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
5093struct Templates29 {
5094  typedef TemplateSel<T1> Head;
5095  typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5096      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5097      T29> Tail;
5098};
5099
5100template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5101    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5102    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5103    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5104    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5105    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5106    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5107    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5108    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5109    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
5110struct Templates30 {
5111  typedef TemplateSel<T1> Head;
5112  typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5113      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5114      T29, T30> Tail;
5115};
5116
5117template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5118    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5119    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5120    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5121    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5122    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5123    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5124    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5125    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5126    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5127    GTEST_TEMPLATE_ T31>
5128struct Templates31 {
5129  typedef TemplateSel<T1> Head;
5130  typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5131      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5132      T29, T30, T31> Tail;
5133};
5134
5135template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5136    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5137    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5138    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5139    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5140    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5141    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5142    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5143    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5144    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5145    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
5146struct Templates32 {
5147  typedef TemplateSel<T1> Head;
5148  typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5149      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5150      T29, T30, T31, T32> Tail;
5151};
5152
5153template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5154    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5155    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5156    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5157    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5158    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5159    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5160    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5161    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5162    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5163    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
5164struct Templates33 {
5165  typedef TemplateSel<T1> Head;
5166  typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5167      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5168      T29, T30, T31, T32, T33> Tail;
5169};
5170
5171template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5172    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5173    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5174    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5175    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5176    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5177    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5178    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5179    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5180    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5181    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5182    GTEST_TEMPLATE_ T34>
5183struct Templates34 {
5184  typedef TemplateSel<T1> Head;
5185  typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5186      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5187      T29, T30, T31, T32, T33, T34> Tail;
5188};
5189
5190template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5191    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5192    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5193    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5194    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5195    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5196    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5197    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5198    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5199    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5200    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5201    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
5202struct Templates35 {
5203  typedef TemplateSel<T1> Head;
5204  typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5205      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5206      T29, T30, T31, T32, T33, T34, T35> Tail;
5207};
5208
5209template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5210    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5211    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5212    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5213    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5214    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5215    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5216    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5217    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5218    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5219    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5220    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
5221struct Templates36 {
5222  typedef TemplateSel<T1> Head;
5223  typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5224      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5225      T29, T30, T31, T32, T33, T34, T35, T36> Tail;
5226};
5227
5228template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5229    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5230    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5231    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5232    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5233    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5234    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5235    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5236    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5237    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5238    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5239    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5240    GTEST_TEMPLATE_ T37>
5241struct Templates37 {
5242  typedef TemplateSel<T1> Head;
5243  typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5244      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5245      T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
5246};
5247
5248template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5249    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5250    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5251    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5252    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5253    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5254    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5255    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5256    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5257    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5258    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5259    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5260    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
5261struct Templates38 {
5262  typedef TemplateSel<T1> Head;
5263  typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5264      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5265      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
5266};
5267
5268template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5269    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5270    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5271    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5272    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5273    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5274    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5275    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5276    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5277    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5278    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5279    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5280    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
5281struct Templates39 {
5282  typedef TemplateSel<T1> Head;
5283  typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5284      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5285      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
5286};
5287
5288template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5289    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5290    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5291    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5292    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5293    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5294    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5295    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5296    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5297    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5298    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5299    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5300    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5301    GTEST_TEMPLATE_ T40>
5302struct Templates40 {
5303  typedef TemplateSel<T1> Head;
5304  typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5305      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5306      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
5307};
5308
5309template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5310    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5311    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5312    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5313    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5314    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5315    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5316    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5317    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5318    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5319    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5320    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5321    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5322    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
5323struct Templates41 {
5324  typedef TemplateSel<T1> Head;
5325  typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5326      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5327      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
5328};
5329
5330template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5331    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5332    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5333    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5334    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5335    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5336    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5337    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5338    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5339    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5340    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5341    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5342    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5343    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
5344struct Templates42 {
5345  typedef TemplateSel<T1> Head;
5346  typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5347      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5348      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
5349      T42> Tail;
5350};
5351
5352template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5353    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5354    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5355    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5356    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5357    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5358    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5359    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5360    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5361    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5362    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5363    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5364    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5365    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5366    GTEST_TEMPLATE_ T43>
5367struct Templates43 {
5368  typedef TemplateSel<T1> Head;
5369  typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5370      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5371      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5372      T43> Tail;
5373};
5374
5375template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5376    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5377    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5378    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5379    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5380    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5381    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5382    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5383    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5384    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5385    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5386    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5387    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5388    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5389    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
5390struct Templates44 {
5391  typedef TemplateSel<T1> Head;
5392  typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5393      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5394      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5395      T43, T44> Tail;
5396};
5397
5398template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5399    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5400    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5401    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5402    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5403    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5404    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5405    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5406    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5407    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5408    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5409    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5410    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5411    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5412    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
5413struct Templates45 {
5414  typedef TemplateSel<T1> Head;
5415  typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5416      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5417      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5418      T43, T44, T45> Tail;
5419};
5420
5421template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5422    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5423    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5424    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5425    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5426    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5427    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5428    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5429    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5430    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5431    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5432    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5433    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5434    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5435    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5436    GTEST_TEMPLATE_ T46>
5437struct Templates46 {
5438  typedef TemplateSel<T1> Head;
5439  typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5440      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5441      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5442      T43, T44, T45, T46> Tail;
5443};
5444
5445template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5446    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5447    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5448    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5449    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5450    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5451    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5452    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5453    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5454    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5455    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5456    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5457    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5458    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5459    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5460    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
5461struct Templates47 {
5462  typedef TemplateSel<T1> Head;
5463  typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5464      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5465      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5466      T43, T44, T45, T46, T47> Tail;
5467};
5468
5469template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5470    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5471    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5472    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5473    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5474    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5475    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5476    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5477    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5478    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5479    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5480    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5481    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5482    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5483    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5484    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
5485struct Templates48 {
5486  typedef TemplateSel<T1> Head;
5487  typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5488      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5489      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5490      T43, T44, T45, T46, T47, T48> Tail;
5491};
5492
5493template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5494    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5495    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5496    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5497    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5498    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5499    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5500    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5501    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5502    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5503    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5504    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5505    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5506    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5507    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5508    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
5509    GTEST_TEMPLATE_ T49>
5510struct Templates49 {
5511  typedef TemplateSel<T1> Head;
5512  typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5513      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5514      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5515      T43, T44, T45, T46, T47, T48, T49> Tail;
5516};
5517
5518template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5519    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5520    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5521    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5522    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5523    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5524    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5525    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5526    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5527    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5528    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5529    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5530    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5531    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5532    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5533    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
5534    GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
5535struct Templates50 {
5536  typedef TemplateSel<T1> Head;
5537  typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5538      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5539      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5540      T43, T44, T45, T46, T47, T48, T49, T50> Tail;
5541};
5542
5543
5544// We don't want to require the users to write TemplatesN<...> directly,
5545// as that would require them to count the length.  Templates<...> is much
5546// easier to write, but generates horrible messages when there is a
5547// compiler error, as gcc insists on printing out each template
5548// argument, even if it has the default value (this means Templates<list>
5549// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
5550// errors).
5551//
5552// Our solution is to combine the best part of the two approaches: a
5553// user would write Templates<T1, ..., TN>, and Google Test will translate
5554// that to TemplatesN<T1, ..., TN> internally to make error messages
5555// readable.  The translation is done by the 'type' member of the
5556// Templates template.
5557template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
5558    GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
5559    GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
5560    GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
5561    GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
5562    GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
5563    GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
5564    GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
5565    GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
5566    GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
5567    GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
5568    GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
5569    GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
5570    GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
5571    GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
5572    GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
5573    GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
5574    GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
5575    GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
5576    GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
5577    GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
5578    GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
5579    GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
5580    GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
5581    GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
5582struct Templates {
5583  typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5584      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5585      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
5586      T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
5587};
5588
5589template <>
5590struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5591    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5592    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5593    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5594    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5595    NoneT> {
5596  typedef Templates0 type;
5597};
5598template <GTEST_TEMPLATE_ T1>
5599struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5600    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5601    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5602    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5603    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5604    NoneT> {
5605  typedef Templates1<T1> type;
5606};
5607template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
5608struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5609    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5610    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5611    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5612    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5613    NoneT> {
5614  typedef Templates2<T1, T2> type;
5615};
5616template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
5617struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5618    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5619    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5620    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5621    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5622  typedef Templates3<T1, T2, T3> type;
5623};
5624template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5625    GTEST_TEMPLATE_ T4>
5626struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5627    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5628    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5629    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5630    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5631  typedef Templates4<T1, T2, T3, T4> type;
5632};
5633template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5634    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
5635struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5636    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5637    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5638    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5639    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5640  typedef Templates5<T1, T2, T3, T4, T5> type;
5641};
5642template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5643    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
5644struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
5645    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5646    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5647    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5648    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5649  typedef Templates6<T1, T2, T3, T4, T5, T6> type;
5650};
5651template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5652    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5653    GTEST_TEMPLATE_ T7>
5654struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
5655    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5656    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5657    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5658    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5659  typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
5660};
5661template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5662    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5663    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
5664struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
5665    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5666    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5667    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5668    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5669  typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
5670};
5671template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5672    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5673    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
5674struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
5675    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5676    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5677    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5678    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5679  typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
5680};
5681template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5682    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5683    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5684    GTEST_TEMPLATE_ T10>
5685struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
5686    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5687    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5688    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5689    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5690  typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
5691};
5692template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5693    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5694    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5695    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
5696struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
5697    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5698    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5699    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5700    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5701  typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
5702};
5703template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5704    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5705    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5706    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
5707struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
5708    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5709    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5710    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5711    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5712  typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
5713};
5714template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5715    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5716    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5717    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5718    GTEST_TEMPLATE_ T13>
5719struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
5720    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5721    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5722    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5723    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5724  typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5725      T13> type;
5726};
5727template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5728    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5729    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5730    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5731    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
5732struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5733    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5734    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5735    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5736    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5737  typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5738      T14> type;
5739};
5740template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5741    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5742    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5743    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5744    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
5745struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5746    T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5747    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5748    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5749    NoneT, NoneT, NoneT, NoneT, NoneT> {
5750  typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5751      T14, T15> type;
5752};
5753template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5754    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5755    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5756    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5757    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5758    GTEST_TEMPLATE_ T16>
5759struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5760    T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5761    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5762    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5763    NoneT, NoneT, NoneT, NoneT, NoneT> {
5764  typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5765      T14, T15, T16> type;
5766};
5767template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5768    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5769    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5770    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5771    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5772    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
5773struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5774    T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5775    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5776    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5777    NoneT, NoneT, NoneT, NoneT, NoneT> {
5778  typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5779      T14, T15, T16, T17> type;
5780};
5781template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5782    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5783    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5784    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5785    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5786    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
5787struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5788    T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5789    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5790    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5791    NoneT, NoneT, NoneT, NoneT> {
5792  typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5793      T14, T15, T16, T17, T18> type;
5794};
5795template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5796    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5797    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5798    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5799    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5800    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5801    GTEST_TEMPLATE_ T19>
5802struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5803    T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5804    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5805    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5806    NoneT, NoneT, NoneT, NoneT> {
5807  typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5808      T14, T15, T16, T17, T18, T19> type;
5809};
5810template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5811    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5812    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5813    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5814    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5815    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5816    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
5817struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5818    T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5819    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5820    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5821    NoneT, NoneT, NoneT, NoneT> {
5822  typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5823      T14, T15, T16, T17, T18, T19, T20> type;
5824};
5825template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5826    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5827    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5828    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5829    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5830    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5831    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
5832struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5833    T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
5834    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5835    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5836    NoneT, NoneT, NoneT, NoneT> {
5837  typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5838      T14, T15, T16, T17, T18, T19, T20, T21> type;
5839};
5840template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5841    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5842    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5843    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5844    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5845    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5846    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5847    GTEST_TEMPLATE_ T22>
5848struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5849    T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
5850    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5851    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5852    NoneT, NoneT, NoneT> {
5853  typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5854      T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
5855};
5856template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5857    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5858    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5859    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5860    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5861    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5862    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5863    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
5864struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5865    T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
5866    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5867    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5868    NoneT, NoneT, NoneT> {
5869  typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5870      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
5871};
5872template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5873    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5874    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5875    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5876    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5877    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5878    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5879    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
5880struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5881    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
5882    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5883    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5884    NoneT, NoneT, NoneT> {
5885  typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5886      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
5887};
5888template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5889    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5890    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5891    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5892    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5893    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5894    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5895    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5896    GTEST_TEMPLATE_ T25>
5897struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5898    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
5899    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5900    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5901    NoneT, NoneT> {
5902  typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5903      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
5904};
5905template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5906    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5907    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5908    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5909    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5910    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5911    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5912    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5913    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
5914struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5915    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
5916    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5917    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5918    NoneT, NoneT> {
5919  typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5920      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
5921};
5922template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5923    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5924    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5925    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5926    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5927    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5928    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5929    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5930    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
5931struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5932    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
5933    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5934    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5935    NoneT, NoneT> {
5936  typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5937      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5938      T27> type;
5939};
5940template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5941    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5942    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5943    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5944    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5945    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5946    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5947    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5948    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5949    GTEST_TEMPLATE_ T28>
5950struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5951    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5952    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5953    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5954    NoneT, NoneT> {
5955  typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5956      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5957      T28> type;
5958};
5959template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5960    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5961    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5962    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5963    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5964    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5965    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5966    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5967    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5968    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
5969struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5970    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5971    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5972    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5973    NoneT> {
5974  typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5975      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5976      T28, T29> type;
5977};
5978template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5979    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5980    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5981    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5982    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5983    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5984    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5985    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5986    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5987    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
5988struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5989    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
5990    T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5991    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5992  typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5993      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5994      T28, T29, T30> type;
5995};
5996template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5997    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5998    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5999    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6000    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6001    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6002    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6003    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6004    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6005    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6006    GTEST_TEMPLATE_ T31>
6007struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6008    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6009    T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6010    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6011  typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6012      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6013      T28, T29, T30, T31> type;
6014};
6015template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6016    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6017    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6018    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6019    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6020    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6021    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6022    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6023    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6024    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6025    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
6026struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6027    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6028    T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6029    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6030  typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6031      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6032      T28, T29, T30, T31, T32> type;
6033};
6034template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6035    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6036    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6037    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6038    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6039    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6040    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6041    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6042    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6043    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6044    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
6045struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6046    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6047    T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6048    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6049  typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6050      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6051      T28, T29, T30, T31, T32, T33> type;
6052};
6053template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6054    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6055    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6056    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6057    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6058    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6059    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6060    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6061    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6062    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6063    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6064    GTEST_TEMPLATE_ T34>
6065struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6066    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6067    T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6068    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6069  typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6070      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6071      T28, T29, T30, T31, T32, T33, T34> type;
6072};
6073template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6074    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6075    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6076    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6077    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6078    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6079    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6080    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6081    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6082    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6083    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6084    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
6085struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6086    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6087    T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6088    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6089  typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6090      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6091      T28, T29, T30, T31, T32, T33, T34, T35> type;
6092};
6093template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6094    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6095    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6096    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6097    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6098    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6099    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6100    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6101    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6102    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6103    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6104    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
6105struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6106    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6107    T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
6108    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6109  typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6110      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6111      T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
6112};
6113template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6114    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6115    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6116    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6117    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6118    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6119    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6120    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6121    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6122    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6123    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6124    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6125    GTEST_TEMPLATE_ T37>
6126struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6127    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6128    T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
6129    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6130  typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6131      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6132      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
6133};
6134template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6135    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6136    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6137    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6138    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6139    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6140    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6141    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6142    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6143    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6144    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6145    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6146    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
6147struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6148    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6149    T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
6150    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6151  typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6152      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6153      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
6154};
6155template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6156    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6157    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6158    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6159    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6160    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6161    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6162    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6163    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6164    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6165    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6166    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6167    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
6168struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6169    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6170    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
6171    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6172  typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6173      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6174      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
6175};
6176template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6177    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6178    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6179    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6180    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6181    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6182    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6183    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6184    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6185    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6186    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6187    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6188    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6189    GTEST_TEMPLATE_ T40>
6190struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6191    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6192    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
6193    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6194  typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6195      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6196      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
6197};
6198template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6199    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6200    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6201    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6202    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6203    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6204    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6205    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6206    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6207    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6208    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6209    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6210    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6211    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
6212struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6213    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6214    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
6215    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6216  typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6217      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6218      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6219      T41> type;
6220};
6221template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6222    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6223    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6224    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6225    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6226    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6227    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6228    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6229    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6230    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6231    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6232    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6233    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6234    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
6235struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6236    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6237    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
6238    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6239  typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6240      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6241      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6242      T42> type;
6243};
6244template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6245    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6246    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6247    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6248    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6249    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6250    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6251    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6252    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6253    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6254    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6255    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6256    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6257    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6258    GTEST_TEMPLATE_ T43>
6259struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6260    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6261    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
6262    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6263  typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6264      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6265      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6266      T42, T43> type;
6267};
6268template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6269    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6270    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6271    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6272    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6273    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6274    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6275    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6276    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6277    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6278    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6279    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6280    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6281    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6282    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
6283struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6284    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6285    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6286    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6287  typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6288      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6289      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6290      T42, T43, T44> type;
6291};
6292template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6293    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6294    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6295    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6296    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6297    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6298    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6299    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6300    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6301    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6302    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6303    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6304    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6305    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6306    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
6307struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6308    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6309    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6310    T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
6311  typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6312      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6313      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6314      T42, T43, T44, T45> type;
6315};
6316template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6317    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6318    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6319    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6320    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6321    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6322    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6323    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6324    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6325    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6326    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6327    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6328    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6329    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6330    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6331    GTEST_TEMPLATE_ T46>
6332struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6333    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6334    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6335    T45, T46, NoneT, NoneT, NoneT, NoneT> {
6336  typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6337      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6338      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6339      T42, T43, T44, T45, T46> type;
6340};
6341template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6342    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6343    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6344    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6345    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6346    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6347    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6348    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6349    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6350    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6351    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6352    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6353    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6354    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6355    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6356    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6357struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6358    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6359    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6360    T45, T46, T47, NoneT, NoneT, NoneT> {
6361  typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6362      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6363      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6364      T42, T43, T44, T45, T46, T47> type;
6365};
6366template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6367    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6368    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6369    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6370    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6371    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6372    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6373    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6374    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6375    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6376    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6377    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6378    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6379    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6380    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6381    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
6382struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6383    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6384    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6385    T45, T46, T47, T48, NoneT, NoneT> {
6386  typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6387      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6388      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6389      T42, T43, T44, T45, T46, T47, T48> type;
6390};
6391template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6392    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6393    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6394    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6395    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6396    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6397    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6398    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6399    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6400    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6401    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6402    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6403    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6404    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6405    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6406    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6407    GTEST_TEMPLATE_ T49>
6408struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6409    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6410    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6411    T45, T46, T47, T48, T49, NoneT> {
6412  typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6413      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6414      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6415      T42, T43, T44, T45, T46, T47, T48, T49> type;
6416};
6417
6418// The TypeList template makes it possible to use either a single type
6419// or a Types<...> list in TYPED_TEST_CASE() and
6420// INSTANTIATE_TYPED_TEST_CASE_P().
6421
6422template <typename T>
6423struct TypeList { typedef Types1<T> type; };
6424
6425template <typename T1, typename T2, typename T3, typename T4, typename T5,
6426    typename T6, typename T7, typename T8, typename T9, typename T10,
6427    typename T11, typename T12, typename T13, typename T14, typename T15,
6428    typename T16, typename T17, typename T18, typename T19, typename T20,
6429    typename T21, typename T22, typename T23, typename T24, typename T25,
6430    typename T26, typename T27, typename T28, typename T29, typename T30,
6431    typename T31, typename T32, typename T33, typename T34, typename T35,
6432    typename T36, typename T37, typename T38, typename T39, typename T40,
6433    typename T41, typename T42, typename T43, typename T44, typename T45,
6434    typename T46, typename T47, typename T48, typename T49, typename T50>
6435struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6436    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6437    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
6438    T44, T45, T46, T47, T48, T49, T50> > {
6439  typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6440      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6441      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6442      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
6443};
6444
6445}  // namespace internal
6446}  // namespace testing
6447
6448#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
6449
6450#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
6451
6452// Due to C++ preprocessor weirdness, we need double indirection to
6453// concatenate two tokens when one of them is __LINE__.  Writing
6454//
6455//   foo ## __LINE__
6456//
6457// will result in the token foo__LINE__, instead of foo followed by
6458// the current line number.  For more details, see
6459// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
6460#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
6461#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
6462
6463// Google Test defines the testing::Message class to allow construction of
6464// test messages via the << operator.  The idea is that anything
6465// streamable to std::ostream can be streamed to a testing::Message.
6466// This allows a user to use his own types in Google Test assertions by
6467// overloading the << operator.
6468//
6469// util/gtl/stl_logging-inl.h overloads << for STL containers.  These
6470// overloads cannot be defined in the std namespace, as that will be
6471// undefined behavior.  Therefore, they are defined in the global
6472// namespace instead.
6473//
6474// C++'s symbol lookup rule (i.e. Koenig lookup) says that these
6475// overloads are visible in either the std namespace or the global
6476// namespace, but not other namespaces, including the testing
6477// namespace which Google Test's Message class is in.
6478//
6479// To allow STL containers (and other types that has a << operator
6480// defined in the global namespace) to be used in Google Test assertions,
6481// testing::Message must access the custom << operator from the global
6482// namespace.  Hence this helper function.
6483//
6484// Note: Jeffrey Yasskin suggested an alternative fix by "using
6485// ::operator<<;" in the definition of Message's operator<<.  That fix
6486// doesn't require a helper function, but unfortunately doesn't
6487// compile with MSVC.
6488template <typename T>
6489inline void GTestStreamToHelper(std::ostream* os, const T& val) {
6490  *os << val;
6491}
6492
6493namespace testing {
6494
6495// Forward declaration of classes.
6496
6497class AssertionResult;                 // Result of an assertion.
6498class Message;                         // Represents a failure message.
6499class Test;                            // Represents a test.
6500class TestInfo;                        // Information about a test.
6501class TestPartResult;                  // Result of a test part.
6502class UnitTest;                        // A collection of test cases.
6503
6504namespace internal {
6505
6506struct TraceInfo;                      // Information about a trace point.
6507class ScopedTrace;                     // Implements scoped trace.
6508class TestInfoImpl;                    // Opaque implementation of TestInfo
6509class UnitTestImpl;                    // Opaque implementation of UnitTest
6510
6511// How many times InitGoogleTest() has been called.
6512extern int g_init_gtest_count;
6513
6514// The text used in failure messages to indicate the start of the
6515// stack trace.
6516GTEST_API_ extern const char kStackTraceMarker[];
6517
6518// A secret type that Google Test users don't know about.  It has no
6519// definition on purpose.  Therefore it's impossible to create a
6520// Secret object, which is what we want.
6521class Secret;
6522
6523// Two overloaded helpers for checking at compile time whether an
6524// expression is a null pointer literal (i.e. NULL or any 0-valued
6525// compile-time integral constant).  Their return values have
6526// different sizes, so we can use sizeof() to test which version is
6527// picked by the compiler.  These helpers have no implementations, as
6528// we only need their signatures.
6529//
6530// Given IsNullLiteralHelper(x), the compiler will pick the first
6531// version if x can be implicitly converted to Secret*, and pick the
6532// second version otherwise.  Since Secret is a secret and incomplete
6533// type, the only expression a user can write that has type Secret* is
6534// a null pointer literal.  Therefore, we know that x is a null
6535// pointer literal if and only if the first version is picked by the
6536// compiler.
6537char IsNullLiteralHelper(Secret* p);
6538char (&IsNullLiteralHelper(...))[2];  // NOLINT
6539
6540// A compile-time bool constant that is true if and only if x is a
6541// null pointer literal (i.e. NULL or any 0-valued compile-time
6542// integral constant).
6543#ifdef GTEST_ELLIPSIS_NEEDS_POD_
6544// We lose support for NULL detection where the compiler doesn't like
6545// passing non-POD classes through ellipsis (...).
6546#define GTEST_IS_NULL_LITERAL_(x) false
6547#else
6548#define GTEST_IS_NULL_LITERAL_(x) \
6549    (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
6550#endif  // GTEST_ELLIPSIS_NEEDS_POD_
6551
6552// Appends the user-supplied message to the Google-Test-generated message.
6553GTEST_API_ String AppendUserMessage(const String& gtest_msg,
6554                                    const Message& user_msg);
6555
6556// A helper class for creating scoped traces in user programs.
6557class GTEST_API_ ScopedTrace {
6558 public:
6559  // The c'tor pushes the given source file location and message onto
6560  // a trace stack maintained by Google Test.
6561  ScopedTrace(const char* file, int line, const Message& message);
6562
6563  // The d'tor pops the info pushed by the c'tor.
6564  //
6565  // Note that the d'tor is not virtual in order to be efficient.
6566  // Don't inherit from ScopedTrace!
6567  ~ScopedTrace();
6568
6569 private:
6570  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
6571} GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its
6572                            // c'tor and d'tor.  Therefore it doesn't
6573                            // need to be used otherwise.
6574
6575// Converts a streamable value to a String.  A NULL pointer is
6576// converted to "(null)".  When the input value is a ::string,
6577// ::std::string, ::wstring, or ::std::wstring object, each NUL
6578// character in it is replaced with "\\0".
6579// Declared here but defined in gtest.h, so that it has access
6580// to the definition of the Message class, required by the ARM
6581// compiler.
6582template <typename T>
6583String StreamableToString(const T& streamable);
6584
6585// Formats a value to be used in a failure message.
6586
6587#ifdef GTEST_NEEDS_IS_POINTER_
6588
6589// These are needed as the Nokia Symbian and IBM XL C/C++ compilers
6590// cannot decide between const T& and const T* in a function template.
6591// These compilers _can_ decide between class template specializations
6592// for T and T*, so a tr1::type_traits-like is_pointer works, and we
6593// can overload on that.
6594
6595// This overload makes sure that all pointers (including
6596// those to char or wchar_t) are printed as raw pointers.
6597template <typename T>
6598inline String FormatValueForFailureMessage(internal::true_type /*dummy*/,
6599                                           T* pointer) {
6600  return StreamableToString(static_cast<const void*>(pointer));
6601}
6602
6603template <typename T>
6604inline String FormatValueForFailureMessage(internal::false_type /*dummy*/,
6605                                           const T& value) {
6606  return StreamableToString(value);
6607}
6608
6609template <typename T>
6610inline String FormatForFailureMessage(const T& value) {
6611  return FormatValueForFailureMessage(
6612      typename internal::is_pointer<T>::type(), value);
6613}
6614
6615#else
6616
6617// These are needed as the above solution using is_pointer has the
6618// limitation that T cannot be a type without external linkage, when
6619// compiled using MSVC.
6620
6621template <typename T>
6622inline String FormatForFailureMessage(const T& value) {
6623  return StreamableToString(value);
6624}
6625
6626// This overload makes sure that all pointers (including
6627// those to char or wchar_t) are printed as raw pointers.
6628template <typename T>
6629inline String FormatForFailureMessage(T* pointer) {
6630  return StreamableToString(static_cast<const void*>(pointer));
6631}
6632
6633#endif  // GTEST_NEEDS_IS_POINTER_
6634
6635// These overloaded versions handle narrow and wide characters.
6636GTEST_API_ String FormatForFailureMessage(char ch);
6637GTEST_API_ String FormatForFailureMessage(wchar_t wchar);
6638
6639// When this operand is a const char* or char*, and the other operand
6640// is a ::std::string or ::string, we print this operand as a C string
6641// rather than a pointer.  We do the same for wide strings.
6642
6643// This internal macro is used to avoid duplicated code.
6644#define GTEST_FORMAT_IMPL_(operand2_type, operand1_printer)\
6645inline String FormatForComparisonFailureMessage(\
6646    operand2_type::value_type* str, const operand2_type& /*operand2*/) {\
6647  return operand1_printer(str);\
6648}\
6649inline String FormatForComparisonFailureMessage(\
6650    const operand2_type::value_type* str, const operand2_type& /*operand2*/) {\
6651  return operand1_printer(str);\
6652}
6653
6654GTEST_FORMAT_IMPL_(::std::string, String::ShowCStringQuoted)
6655#if GTEST_HAS_STD_WSTRING
6656GTEST_FORMAT_IMPL_(::std::wstring, String::ShowWideCStringQuoted)
6657#endif  // GTEST_HAS_STD_WSTRING
6658
6659#if GTEST_HAS_GLOBAL_STRING
6660GTEST_FORMAT_IMPL_(::string, String::ShowCStringQuoted)
6661#endif  // GTEST_HAS_GLOBAL_STRING
6662#if GTEST_HAS_GLOBAL_WSTRING
6663GTEST_FORMAT_IMPL_(::wstring, String::ShowWideCStringQuoted)
6664#endif  // GTEST_HAS_GLOBAL_WSTRING
6665
6666#undef GTEST_FORMAT_IMPL_
6667
6668// Constructs and returns the message for an equality assertion
6669// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
6670//
6671// The first four parameters are the expressions used in the assertion
6672// and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
6673// where foo is 5 and bar is 6, we have:
6674//
6675//   expected_expression: "foo"
6676//   actual_expression:   "bar"
6677//   expected_value:      "5"
6678//   actual_value:        "6"
6679//
6680// The ignoring_case parameter is true iff the assertion is a
6681// *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will
6682// be inserted into the message.
6683GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
6684                                     const char* actual_expression,
6685                                     const String& expected_value,
6686                                     const String& actual_value,
6687                                     bool ignoring_case);
6688
6689// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
6690GTEST_API_ String GetBoolAssertionFailureMessage(
6691    const AssertionResult& assertion_result,
6692    const char* expression_text,
6693    const char* actual_predicate_value,
6694    const char* expected_predicate_value);
6695
6696// This template class represents an IEEE floating-point number
6697// (either single-precision or double-precision, depending on the
6698// template parameters).
6699//
6700// The purpose of this class is to do more sophisticated number
6701// comparison.  (Due to round-off error, etc, it's very unlikely that
6702// two floating-points will be equal exactly.  Hence a naive
6703// comparison by the == operation often doesn't work.)
6704//
6705// Format of IEEE floating-point:
6706//
6707//   The most-significant bit being the leftmost, an IEEE
6708//   floating-point looks like
6709//
6710//     sign_bit exponent_bits fraction_bits
6711//
6712//   Here, sign_bit is a single bit that designates the sign of the
6713//   number.
6714//
6715//   For float, there are 8 exponent bits and 23 fraction bits.
6716//
6717//   For double, there are 11 exponent bits and 52 fraction bits.
6718//
6719//   More details can be found at
6720//   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
6721//
6722// Template parameter:
6723//
6724//   RawType: the raw floating-point type (either float or double)
6725template <typename RawType>
6726class FloatingPoint {
6727 public:
6728  // Defines the unsigned integer type that has the same size as the
6729  // floating point number.
6730  typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
6731
6732  // Constants.
6733
6734  // # of bits in a number.
6735  static const size_t kBitCount = 8*sizeof(RawType);
6736
6737  // # of fraction bits in a number.
6738  static const size_t kFractionBitCount =
6739    std::numeric_limits<RawType>::digits - 1;
6740
6741  // # of exponent bits in a number.
6742  static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
6743
6744  // The mask for the sign bit.
6745  static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
6746
6747  // The mask for the fraction bits.
6748  static const Bits kFractionBitMask =
6749    ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
6750
6751  // The mask for the exponent bits.
6752  static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
6753
6754  // How many ULP's (Units in the Last Place) we want to tolerate when
6755  // comparing two numbers.  The larger the value, the more error we
6756  // allow.  A 0 value means that two numbers must be exactly the same
6757  // to be considered equal.
6758  //
6759  // The maximum error of a single floating-point operation is 0.5
6760  // units in the last place.  On Intel CPU's, all floating-point
6761  // calculations are done with 80-bit precision, while double has 64
6762  // bits.  Therefore, 4 should be enough for ordinary use.
6763  //
6764  // See the following article for more details on ULP:
6765  // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm.
6766  static const size_t kMaxUlps = 4;
6767
6768  // Constructs a FloatingPoint from a raw floating-point number.
6769  //
6770  // On an Intel CPU, passing a non-normalized NAN (Not a Number)
6771  // around may change its bits, although the new value is guaranteed
6772  // to be also a NAN.  Therefore, don't expect this constructor to
6773  // preserve the bits in x when x is a NAN.
6774  explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
6775
6776  // Static methods
6777
6778  // Reinterprets a bit pattern as a floating-point number.
6779  //
6780  // This function is needed to test the AlmostEquals() method.
6781  static RawType ReinterpretBits(const Bits bits) {
6782    FloatingPoint fp(0);
6783    fp.u_.bits_ = bits;
6784    return fp.u_.value_;
6785  }
6786
6787  // Returns the floating-point number that represent positive infinity.
6788  static RawType Infinity() {
6789    return ReinterpretBits(kExponentBitMask);
6790  }
6791
6792  // Non-static methods
6793
6794  // Returns the bits that represents this number.
6795  const Bits &bits() const { return u_.bits_; }
6796
6797  // Returns the exponent bits of this number.
6798  Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
6799
6800  // Returns the fraction bits of this number.
6801  Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
6802
6803  // Returns the sign bit of this number.
6804  Bits sign_bit() const { return kSignBitMask & u_.bits_; }
6805
6806  // Returns true iff this is NAN (not a number).
6807  bool is_nan() const {
6808    // It's a NAN if the exponent bits are all ones and the fraction
6809    // bits are not entirely zeros.
6810    return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
6811  }
6812
6813  // Returns true iff this number is at most kMaxUlps ULP's away from
6814  // rhs.  In particular, this function:
6815  //
6816  //   - returns false if either number is (or both are) NAN.
6817  //   - treats really large numbers as almost equal to infinity.
6818  //   - thinks +0.0 and -0.0 are 0 DLP's apart.
6819  bool AlmostEquals(const FloatingPoint& rhs) const {
6820    // The IEEE standard says that any comparison operation involving
6821    // a NAN must return false.
6822    if (is_nan() || rhs.is_nan()) return false;
6823
6824    return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
6825        <= kMaxUlps;
6826  }
6827
6828 private:
6829  // The data type used to store the actual floating-point number.
6830  union FloatingPointUnion {
6831    RawType value_;  // The raw floating-point number.
6832    Bits bits_;      // The bits that represent the number.
6833  };
6834
6835  // Converts an integer from the sign-and-magnitude representation to
6836  // the biased representation.  More precisely, let N be 2 to the
6837  // power of (kBitCount - 1), an integer x is represented by the
6838  // unsigned number x + N.
6839  //
6840  // For instance,
6841  //
6842  //   -N + 1 (the most negative number representable using
6843  //          sign-and-magnitude) is represented by 1;
6844  //   0      is represented by N; and
6845  //   N - 1  (the biggest number representable using
6846  //          sign-and-magnitude) is represented by 2N - 1.
6847  //
6848  // Read http://en.wikipedia.org/wiki/Signed_number_representations
6849  // for more details on signed number representations.
6850  static Bits SignAndMagnitudeToBiased(const Bits &sam) {
6851    if (kSignBitMask & sam) {
6852      // sam represents a negative number.
6853      return ~sam + 1;
6854    } else {
6855      // sam represents a positive number.
6856      return kSignBitMask | sam;
6857    }
6858  }
6859
6860  // Given two numbers in the sign-and-magnitude representation,
6861  // returns the distance between them as an unsigned number.
6862  static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
6863                                                     const Bits &sam2) {
6864    const Bits biased1 = SignAndMagnitudeToBiased(sam1);
6865    const Bits biased2 = SignAndMagnitudeToBiased(sam2);
6866    return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
6867  }
6868
6869  FloatingPointUnion u_;
6870};
6871
6872// Typedefs the instances of the FloatingPoint template class that we
6873// care to use.
6874typedef FloatingPoint<float> Float;
6875typedef FloatingPoint<double> Double;
6876
6877// In order to catch the mistake of putting tests that use different
6878// test fixture classes in the same test case, we need to assign
6879// unique IDs to fixture classes and compare them.  The TypeId type is
6880// used to hold such IDs.  The user should treat TypeId as an opaque
6881// type: the only operation allowed on TypeId values is to compare
6882// them for equality using the == operator.
6883typedef const void* TypeId;
6884
6885template <typename T>
6886class TypeIdHelper {
6887 public:
6888  // dummy_ must not have a const type.  Otherwise an overly eager
6889  // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
6890  // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
6891  static bool dummy_;
6892};
6893
6894template <typename T>
6895bool TypeIdHelper<T>::dummy_ = false;
6896
6897// GetTypeId<T>() returns the ID of type T.  Different values will be
6898// returned for different types.  Calling the function twice with the
6899// same type argument is guaranteed to return the same ID.
6900template <typename T>
6901TypeId GetTypeId() {
6902  // The compiler is required to allocate a different
6903  // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
6904  // the template.  Therefore, the address of dummy_ is guaranteed to
6905  // be unique.
6906  return &(TypeIdHelper<T>::dummy_);
6907}
6908
6909// Returns the type ID of ::testing::Test.  Always call this instead
6910// of GetTypeId< ::testing::Test>() to get the type ID of
6911// ::testing::Test, as the latter may give the wrong result due to a
6912// suspected linker bug when compiling Google Test as a Mac OS X
6913// framework.
6914GTEST_API_ TypeId GetTestTypeId();
6915
6916// Defines the abstract factory interface that creates instances
6917// of a Test object.
6918class TestFactoryBase {
6919 public:
6920  virtual ~TestFactoryBase() {}
6921
6922  // Creates a test instance to run. The instance is both created and destroyed
6923  // within TestInfoImpl::Run()
6924  virtual Test* CreateTest() = 0;
6925
6926 protected:
6927  TestFactoryBase() {}
6928
6929 private:
6930  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
6931};
6932
6933// This class provides implementation of TeastFactoryBase interface.
6934// It is used in TEST and TEST_F macros.
6935template <class TestClass>
6936class TestFactoryImpl : public TestFactoryBase {
6937 public:
6938  virtual Test* CreateTest() { return new TestClass; }
6939};
6940
6941#if GTEST_OS_WINDOWS
6942
6943// Predicate-formatters for implementing the HRESULT checking macros
6944// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
6945// We pass a long instead of HRESULT to avoid causing an
6946// include dependency for the HRESULT type.
6947GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
6948                                            long hr);  // NOLINT
6949GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
6950                                            long hr);  // NOLINT
6951
6952#endif  // GTEST_OS_WINDOWS
6953
6954// Formats a source file path and a line number as they would appear
6955// in a compiler error message.
6956inline String FormatFileLocation(const char* file, int line) {
6957  const char* const file_name = file == NULL ? "unknown file" : file;
6958  if (line < 0) {
6959    return String::Format("%s:", file_name);
6960  }
6961#ifdef _MSC_VER
6962  return String::Format("%s(%d):", file_name, line);
6963#else
6964  return String::Format("%s:%d:", file_name, line);
6965#endif  // _MSC_VER
6966}
6967
6968// Types of SetUpTestCase() and TearDownTestCase() functions.
6969typedef void (*SetUpTestCaseFunc)();
6970typedef void (*TearDownTestCaseFunc)();
6971
6972// Creates a new TestInfo object and registers it with Google Test;
6973// returns the created object.
6974//
6975// Arguments:
6976//
6977//   test_case_name:   name of the test case
6978//   name:             name of the test
6979//   test_case_comment: a comment on the test case that will be included in
6980//                      the test output
6981//   comment:          a comment on the test that will be included in the
6982//                     test output
6983//   fixture_class_id: ID of the test fixture class
6984//   set_up_tc:        pointer to the function that sets up the test case
6985//   tear_down_tc:     pointer to the function that tears down the test case
6986//   factory:          pointer to the factory that creates a test object.
6987//                     The newly created TestInfo instance will assume
6988//                     ownership of the factory object.
6989GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
6990    const char* test_case_name, const char* name,
6991    const char* test_case_comment, const char* comment,
6992    TypeId fixture_class_id,
6993    SetUpTestCaseFunc set_up_tc,
6994    TearDownTestCaseFunc tear_down_tc,
6995    TestFactoryBase* factory);
6996
6997// If *pstr starts with the given prefix, modifies *pstr to be right
6998// past the prefix and returns true; otherwise leaves *pstr unchanged
6999// and returns false.  None of pstr, *pstr, and prefix can be NULL.
7000bool SkipPrefix(const char* prefix, const char** pstr);
7001
7002#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7003
7004// State of the definition of a type-parameterized test case.
7005class GTEST_API_ TypedTestCasePState {
7006 public:
7007  TypedTestCasePState() : registered_(false) {}
7008
7009  // Adds the given test name to defined_test_names_ and return true
7010  // if the test case hasn't been registered; otherwise aborts the
7011  // program.
7012  bool AddTestName(const char* file, int line, const char* case_name,
7013                   const char* test_name) {
7014    if (registered_) {
7015      fprintf(stderr, "%s Test %s must be defined before "
7016              "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
7017              FormatFileLocation(file, line).c_str(), test_name, case_name);
7018      fflush(stderr);
7019      posix::Abort();
7020    }
7021    defined_test_names_.insert(test_name);
7022    return true;
7023  }
7024
7025  // Verifies that registered_tests match the test names in
7026  // defined_test_names_; returns registered_tests if successful, or
7027  // aborts the program otherwise.
7028  const char* VerifyRegisteredTestNames(
7029      const char* file, int line, const char* registered_tests);
7030
7031 private:
7032  bool registered_;
7033  ::std::set<const char*> defined_test_names_;
7034};
7035
7036// Skips to the first non-space char after the first comma in 'str';
7037// returns NULL if no comma is found in 'str'.
7038inline const char* SkipComma(const char* str) {
7039  const char* comma = strchr(str, ',');
7040  if (comma == NULL) {
7041    return NULL;
7042  }
7043  while (isspace(*(++comma))) {}
7044  return comma;
7045}
7046
7047// Returns the prefix of 'str' before the first comma in it; returns
7048// the entire string if it contains no comma.
7049inline String GetPrefixUntilComma(const char* str) {
7050  const char* comma = strchr(str, ',');
7051  return comma == NULL ? String(str) : String(str, comma - str);
7052}
7053
7054// TypeParameterizedTest<Fixture, TestSel, Types>::Register()
7055// registers a list of type-parameterized tests with Google Test.  The
7056// return value is insignificant - we just need to return something
7057// such that we can call this function in a namespace scope.
7058//
7059// Implementation note: The GTEST_TEMPLATE_ macro declares a template
7060// template parameter.  It's defined in gtest-type-util.h.
7061template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
7062class TypeParameterizedTest {
7063 public:
7064  // 'index' is the index of the test in the type list 'Types'
7065  // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
7066  // Types).  Valid values for 'index' are [0, N - 1] where N is the
7067  // length of Types.
7068  static bool Register(const char* prefix, const char* case_name,
7069                       const char* test_names, int index) {
7070    typedef typename Types::Head Type;
7071    typedef Fixture<Type> FixtureClass;
7072    typedef typename GTEST_BIND_(TestSel, Type) TestClass;
7073
7074    // First, registers the first type-parameterized test in the type
7075    // list.
7076    MakeAndRegisterTestInfo(
7077        String::Format("%s%s%s/%d", prefix, prefix[0] == '\0' ? "" : "/",
7078                       case_name, index).c_str(),
7079        GetPrefixUntilComma(test_names).c_str(),
7080        String::Format("TypeParam = %s", GetTypeName<Type>().c_str()).c_str(),
7081        "",
7082        GetTypeId<FixtureClass>(),
7083        TestClass::SetUpTestCase,
7084        TestClass::TearDownTestCase,
7085        new TestFactoryImpl<TestClass>);
7086
7087    // Next, recurses (at compile time) with the tail of the type list.
7088    return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
7089        ::Register(prefix, case_name, test_names, index + 1);
7090  }
7091};
7092
7093// The base case for the compile time recursion.
7094template <GTEST_TEMPLATE_ Fixture, class TestSel>
7095class TypeParameterizedTest<Fixture, TestSel, Types0> {
7096 public:
7097  static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7098                       const char* /*test_names*/, int /*index*/) {
7099    return true;
7100  }
7101};
7102
7103// TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
7104// registers *all combinations* of 'Tests' and 'Types' with Google
7105// Test.  The return value is insignificant - we just need to return
7106// something such that we can call this function in a namespace scope.
7107template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
7108class TypeParameterizedTestCase {
7109 public:
7110  static bool Register(const char* prefix, const char* case_name,
7111                       const char* test_names) {
7112    typedef typename Tests::Head Head;
7113
7114    // First, register the first test in 'Test' for each type in 'Types'.
7115    TypeParameterizedTest<Fixture, Head, Types>::Register(
7116        prefix, case_name, test_names, 0);
7117
7118    // Next, recurses (at compile time) with the tail of the test list.
7119    return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
7120        ::Register(prefix, case_name, SkipComma(test_names));
7121  }
7122};
7123
7124// The base case for the compile time recursion.
7125template <GTEST_TEMPLATE_ Fixture, typename Types>
7126class TypeParameterizedTestCase<Fixture, Templates0, Types> {
7127 public:
7128  static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7129                       const char* /*test_names*/) {
7130    return true;
7131  }
7132};
7133
7134#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7135
7136// Returns the current OS stack trace as a String.
7137//
7138// The maximum number of stack frames to be included is specified by
7139// the gtest_stack_trace_depth flag.  The skip_count parameter
7140// specifies the number of top frames to be skipped, which doesn't
7141// count against the number of frames to be included.
7142//
7143// For example, if Foo() calls Bar(), which in turn calls
7144// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
7145// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
7146GTEST_API_ String GetCurrentOsStackTraceExceptTop(UnitTest* unit_test,
7147                                                  int skip_count);
7148
7149// Helpers for suppressing warnings on unreachable code or constant
7150// condition.
7151
7152// Always returns true.
7153GTEST_API_ bool AlwaysTrue();
7154
7155// Always returns false.
7156inline bool AlwaysFalse() { return !AlwaysTrue(); }
7157
7158// A simple Linear Congruential Generator for generating random
7159// numbers with a uniform distribution.  Unlike rand() and srand(), it
7160// doesn't use global state (and therefore can't interfere with user
7161// code).  Unlike rand_r(), it's portable.  An LCG isn't very random,
7162// but it's good enough for our purposes.
7163class GTEST_API_ Random {
7164 public:
7165  static const UInt32 kMaxRange = 1u << 31;
7166
7167  explicit Random(UInt32 seed) : state_(seed) {}
7168
7169  void Reseed(UInt32 seed) { state_ = seed; }
7170
7171  // Generates a random number from [0, range).  Crashes if 'range' is
7172  // 0 or greater than kMaxRange.
7173  UInt32 Generate(UInt32 range);
7174
7175 private:
7176  UInt32 state_;
7177  GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
7178};
7179
7180}  // namespace internal
7181}  // namespace testing
7182
7183#define GTEST_MESSAGE_(message, result_type) \
7184  ::testing::internal::AssertHelper(result_type, __FILE__, __LINE__, message) \
7185    = ::testing::Message()
7186
7187#define GTEST_FATAL_FAILURE_(message) \
7188  return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
7189
7190#define GTEST_NONFATAL_FAILURE_(message) \
7191  GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
7192
7193#define GTEST_SUCCESS_(message) \
7194  GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
7195
7196// Suppresses MSVC warnings 4072 (unreachable code) for the code following
7197// statement if it returns or throws (or doesn't return or throw in some
7198// situations).
7199#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
7200  if (::testing::internal::AlwaysTrue()) { statement; }
7201
7202#define GTEST_TEST_THROW_(statement, expected_exception, fail) \
7203  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7204  if (const char* gtest_msg = "") { \
7205    bool gtest_caught_expected = false; \
7206    try { \
7207      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7208    } \
7209    catch (expected_exception const&) { \
7210      gtest_caught_expected = true; \
7211    } \
7212    catch (...) { \
7213      gtest_msg = "Expected: " #statement " throws an exception of type " \
7214                  #expected_exception ".\n  Actual: it throws a different " \
7215                  "type."; \
7216      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
7217    } \
7218    if (!gtest_caught_expected) { \
7219      gtest_msg = "Expected: " #statement " throws an exception of type " \
7220                  #expected_exception ".\n  Actual: it throws nothing."; \
7221      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
7222    } \
7223  } else \
7224    GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
7225      fail(gtest_msg)
7226
7227#define GTEST_TEST_NO_THROW_(statement, fail) \
7228  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7229  if (const char* gtest_msg = "") { \
7230    try { \
7231      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7232    } \
7233    catch (...) { \
7234      gtest_msg = "Expected: " #statement " doesn't throw an exception.\n" \
7235                  "  Actual: it throws."; \
7236      goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
7237    } \
7238  } else \
7239    GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
7240      fail(gtest_msg)
7241
7242#define GTEST_TEST_ANY_THROW_(statement, fail) \
7243  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7244  if (const char* gtest_msg = "") { \
7245    bool gtest_caught_any = false; \
7246    try { \
7247      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7248    } \
7249    catch (...) { \
7250      gtest_caught_any = true; \
7251    } \
7252    if (!gtest_caught_any) { \
7253      gtest_msg = "Expected: " #statement " throws an exception.\n" \
7254                  "  Actual: it doesn't."; \
7255      goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
7256    } \
7257  } else \
7258    GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
7259      fail(gtest_msg)
7260
7261
7262// Implements Boolean test assertions such as EXPECT_TRUE. expression can be
7263// either a boolean expression or an AssertionResult. text is a textual
7264// represenation of expression as it was passed into the EXPECT_TRUE.
7265#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
7266  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7267  if (const ::testing::AssertionResult gtest_ar_ = \
7268      ::testing::AssertionResult(expression)) \
7269    ; \
7270  else \
7271    fail(::testing::internal::GetBoolAssertionFailureMessage(\
7272        gtest_ar_, text, #actual, #expected).c_str())
7273
7274#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
7275  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7276  if (const char* gtest_msg = "") { \
7277    ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
7278    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7279    if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
7280      gtest_msg = "Expected: " #statement " doesn't generate new fatal " \
7281                  "failures in the current thread.\n" \
7282                  "  Actual: it does."; \
7283      goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
7284    } \
7285  } else \
7286    GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
7287      fail(gtest_msg)
7288
7289// Expands to the name of the class that implements the given test.
7290#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
7291  test_case_name##_##test_name##_Test
7292
7293// Helper macro for defining tests.
7294#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
7295class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
7296 public:\
7297  GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
7298 private:\
7299  virtual void TestBody();\
7300  static ::testing::TestInfo* const test_info_;\
7301  GTEST_DISALLOW_COPY_AND_ASSIGN_(\
7302      GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
7303};\
7304\
7305::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
7306  ::test_info_ =\
7307    ::testing::internal::MakeAndRegisterTestInfo(\
7308        #test_case_name, #test_name, "", "", \
7309        (parent_id), \
7310        parent_class::SetUpTestCase, \
7311        parent_class::TearDownTestCase, \
7312        new ::testing::internal::TestFactoryImpl<\
7313            GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
7314void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
7315
7316#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
7317// Copyright 2005, Google Inc.
7318// All rights reserved.
7319//
7320// Redistribution and use in source and binary forms, with or without
7321// modification, are permitted provided that the following conditions are
7322// met:
7323//
7324//     * Redistributions of source code must retain the above copyright
7325// notice, this list of conditions and the following disclaimer.
7326//     * Redistributions in binary form must reproduce the above
7327// copyright notice, this list of conditions and the following disclaimer
7328// in the documentation and/or other materials provided with the
7329// distribution.
7330//     * Neither the name of Google Inc. nor the names of its
7331// contributors may be used to endorse or promote products derived from
7332// this software without specific prior written permission.
7333//
7334// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7335// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7336// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7337// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7338// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
7339// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
7340// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7341// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
7342// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7343// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7344// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7345//
7346// Author: wan@google.com (Zhanyong Wan)
7347//
7348// The Google C++ Testing Framework (Google Test)
7349//
7350// This header file defines the public API for death tests.  It is
7351// #included by gtest.h so a user doesn't need to include this
7352// directly.
7353
7354#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
7355#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
7356
7357// Copyright 2005, Google Inc.
7358// All rights reserved.
7359//
7360// Redistribution and use in source and binary forms, with or without
7361// modification, are permitted provided that the following conditions are
7362// met:
7363//
7364//     * Redistributions of source code must retain the above copyright
7365// notice, this list of conditions and the following disclaimer.
7366//     * Redistributions in binary form must reproduce the above
7367// copyright notice, this list of conditions and the following disclaimer
7368// in the documentation and/or other materials provided with the
7369// distribution.
7370//     * Neither the name of Google Inc. nor the names of its
7371// contributors may be used to endorse or promote products derived from
7372// this software without specific prior written permission.
7373//
7374// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7375// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7376// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7377// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7378// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
7379// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
7380// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7381// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
7382// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7383// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7384// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7385//
7386// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
7387//
7388// The Google C++ Testing Framework (Google Test)
7389//
7390// This header file defines internal utilities needed for implementing
7391// death tests.  They are subject to change without notice.
7392
7393#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
7394#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
7395
7396
7397namespace testing {
7398namespace internal {
7399
7400GTEST_DECLARE_string_(internal_run_death_test);
7401
7402// Names of the flags (needed for parsing Google Test flags).
7403const char kDeathTestStyleFlag[] = "death_test_style";
7404const char kDeathTestUseFork[] = "death_test_use_fork";
7405const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
7406
7407#if GTEST_HAS_DEATH_TEST
7408
7409// DeathTest is a class that hides much of the complexity of the
7410// GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method
7411// returns a concrete class that depends on the prevailing death test
7412// style, as defined by the --gtest_death_test_style and/or
7413// --gtest_internal_run_death_test flags.
7414
7415// In describing the results of death tests, these terms are used with
7416// the corresponding definitions:
7417//
7418// exit status:  The integer exit information in the format specified
7419//               by wait(2)
7420// exit code:    The integer code passed to exit(3), _exit(2), or
7421//               returned from main()
7422class GTEST_API_ DeathTest {
7423 public:
7424  // Create returns false if there was an error determining the
7425  // appropriate action to take for the current death test; for example,
7426  // if the gtest_death_test_style flag is set to an invalid value.
7427  // The LastMessage method will return a more detailed message in that
7428  // case.  Otherwise, the DeathTest pointer pointed to by the "test"
7429  // argument is set.  If the death test should be skipped, the pointer
7430  // is set to NULL; otherwise, it is set to the address of a new concrete
7431  // DeathTest object that controls the execution of the current test.
7432  static bool Create(const char* statement, const RE* regex,
7433                     const char* file, int line, DeathTest** test);
7434  DeathTest();
7435  virtual ~DeathTest() { }
7436
7437  // A helper class that aborts a death test when it's deleted.
7438  class ReturnSentinel {
7439   public:
7440    explicit ReturnSentinel(DeathTest* test) : test_(test) { }
7441    ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
7442   private:
7443    DeathTest* const test_;
7444    GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
7445  } GTEST_ATTRIBUTE_UNUSED_;
7446
7447  // An enumeration of possible roles that may be taken when a death
7448  // test is encountered.  EXECUTE means that the death test logic should
7449  // be executed immediately.  OVERSEE means that the program should prepare
7450  // the appropriate environment for a child process to execute the death
7451  // test, then wait for it to complete.
7452  enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
7453
7454  // An enumeration of the two reasons that a test might be aborted.
7455  enum AbortReason { TEST_ENCOUNTERED_RETURN_STATEMENT, TEST_DID_NOT_DIE };
7456
7457  // Assumes one of the above roles.
7458  virtual TestRole AssumeRole() = 0;
7459
7460  // Waits for the death test to finish and returns its status.
7461  virtual int Wait() = 0;
7462
7463  // Returns true if the death test passed; that is, the test process
7464  // exited during the test, its exit status matches a user-supplied
7465  // predicate, and its stderr output matches a user-supplied regular
7466  // expression.
7467  // The user-supplied predicate may be a macro expression rather
7468  // than a function pointer or functor, or else Wait and Passed could
7469  // be combined.
7470  virtual bool Passed(bool exit_status_ok) = 0;
7471
7472  // Signals that the death test did not die as expected.
7473  virtual void Abort(AbortReason reason) = 0;
7474
7475  // Returns a human-readable outcome message regarding the outcome of
7476  // the last death test.
7477  static const char* LastMessage();
7478
7479  static void set_last_death_test_message(const String& message);
7480
7481 private:
7482  // A string containing a description of the outcome of the last death test.
7483  static String last_death_test_message_;
7484
7485  GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
7486};
7487
7488// Factory interface for death tests.  May be mocked out for testing.
7489class DeathTestFactory {
7490 public:
7491  virtual ~DeathTestFactory() { }
7492  virtual bool Create(const char* statement, const RE* regex,
7493                      const char* file, int line, DeathTest** test) = 0;
7494};
7495
7496// A concrete DeathTestFactory implementation for normal use.
7497class DefaultDeathTestFactory : public DeathTestFactory {
7498 public:
7499  virtual bool Create(const char* statement, const RE* regex,
7500                      const char* file, int line, DeathTest** test);
7501};
7502
7503// Returns true if exit_status describes a process that was terminated
7504// by a signal, or exited normally with a nonzero exit code.
7505GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
7506
7507// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
7508// ASSERT_EXIT*, and EXPECT_EXIT*.
7509#define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
7510  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7511  if (::testing::internal::AlwaysTrue()) { \
7512    const ::testing::internal::RE& gtest_regex = (regex); \
7513    ::testing::internal::DeathTest* gtest_dt; \
7514    if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
7515        __FILE__, __LINE__, &gtest_dt)) { \
7516      goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
7517    } \
7518    if (gtest_dt != NULL) { \
7519      ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
7520          gtest_dt_ptr(gtest_dt); \
7521      switch (gtest_dt->AssumeRole()) { \
7522        case ::testing::internal::DeathTest::OVERSEE_TEST: \
7523          if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
7524            goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
7525          } \
7526          break; \
7527        case ::testing::internal::DeathTest::EXECUTE_TEST: { \
7528          ::testing::internal::DeathTest::ReturnSentinel \
7529              gtest_sentinel(gtest_dt); \
7530          GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7531          gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
7532          break; \
7533        } \
7534      } \
7535    } \
7536  } else \
7537    GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
7538      fail(::testing::internal::DeathTest::LastMessage())
7539// The symbol "fail" here expands to something into which a message
7540// can be streamed.
7541
7542// A class representing the parsed contents of the
7543// --gtest_internal_run_death_test flag, as it existed when
7544// RUN_ALL_TESTS was called.
7545class InternalRunDeathTestFlag {
7546 public:
7547  InternalRunDeathTestFlag(const String& a_file,
7548                           int a_line,
7549                           int an_index,
7550                           int a_write_fd)
7551      : file_(a_file), line_(a_line), index_(an_index),
7552        write_fd_(a_write_fd) {}
7553
7554  ~InternalRunDeathTestFlag() {
7555    if (write_fd_ >= 0)
7556      posix::Close(write_fd_);
7557  }
7558
7559  String file() const { return file_; }
7560  int line() const { return line_; }
7561  int index() const { return index_; }
7562  int write_fd() const { return write_fd_; }
7563
7564 private:
7565  String file_;
7566  int line_;
7567  int index_;
7568  int write_fd_;
7569
7570  GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
7571};
7572
7573// Returns a newly created InternalRunDeathTestFlag object with fields
7574// initialized from the GTEST_FLAG(internal_run_death_test) flag if
7575// the flag is specified; otherwise returns NULL.
7576InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
7577
7578#else  // GTEST_HAS_DEATH_TEST
7579
7580// This macro is used for implementing macros such as
7581// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
7582// death tests are not supported. Those macros must compile on such systems
7583// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
7584// systems that support death tests. This allows one to write such a macro
7585// on a system that does not support death tests and be sure that it will
7586// compile on a death-test supporting system.
7587//
7588// Parameters:
7589//   statement -  A statement that a macro such as EXPECT_DEATH would test
7590//                for program termination. This macro has to make sure this
7591//                statement is compiled but not executed, to ensure that
7592//                EXPECT_DEATH_IF_SUPPORTED compiles with a certain
7593//                parameter iff EXPECT_DEATH compiles with it.
7594//   regex     -  A regex that a macro such as EXPECT_DEATH would use to test
7595//                the output of statement.  This parameter has to be
7596//                compiled but not evaluated by this macro, to ensure that
7597//                this macro only accepts expressions that a macro such as
7598//                EXPECT_DEATH would accept.
7599//   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
7600//                and a return statement for ASSERT_DEATH_IF_SUPPORTED.
7601//                This ensures that ASSERT_DEATH_IF_SUPPORTED will not
7602//                compile inside functions where ASSERT_DEATH doesn't
7603//                compile.
7604//
7605//  The branch that has an always false condition is used to ensure that
7606//  statement and regex are compiled (and thus syntactically correct) but
7607//  never executed. The unreachable code macro protects the terminator
7608//  statement from generating an 'unreachable code' warning in case
7609//  statement unconditionally returns or throws. The Message constructor at
7610//  the end allows the syntax of streaming additional messages into the
7611//  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
7612#define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
7613    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7614    if (::testing::internal::AlwaysTrue()) { \
7615      GTEST_LOG_(WARNING) \
7616          << "Death tests are not supported on this platform.\n" \
7617          << "Statement '" #statement "' cannot be verified."; \
7618    } else if (::testing::internal::AlwaysFalse()) { \
7619      ::testing::internal::RE::PartialMatch(".*", (regex)); \
7620      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7621      terminator; \
7622    } else \
7623      ::testing::Message()
7624
7625#endif  // GTEST_HAS_DEATH_TEST
7626
7627}  // namespace internal
7628}  // namespace testing
7629
7630#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
7631
7632namespace testing {
7633
7634// This flag controls the style of death tests.  Valid values are "threadsafe",
7635// meaning that the death test child process will re-execute the test binary
7636// from the start, running only a single death test, or "fast",
7637// meaning that the child process will execute the test logic immediately
7638// after forking.
7639GTEST_DECLARE_string_(death_test_style);
7640
7641#if GTEST_HAS_DEATH_TEST
7642
7643// The following macros are useful for writing death tests.
7644
7645// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
7646// executed:
7647//
7648//   1. It generates a warning if there is more than one active
7649//   thread.  This is because it's safe to fork() or clone() only
7650//   when there is a single thread.
7651//
7652//   2. The parent process clone()s a sub-process and runs the death
7653//   test in it; the sub-process exits with code 0 at the end of the
7654//   death test, if it hasn't exited already.
7655//
7656//   3. The parent process waits for the sub-process to terminate.
7657//
7658//   4. The parent process checks the exit code and error message of
7659//   the sub-process.
7660//
7661// Examples:
7662//
7663//   ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
7664//   for (int i = 0; i < 5; i++) {
7665//     EXPECT_DEATH(server.ProcessRequest(i),
7666//                  "Invalid request .* in ProcessRequest()")
7667//         << "Failed to die on request " << i);
7668//   }
7669//
7670//   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
7671//
7672//   bool KilledBySIGHUP(int exit_code) {
7673//     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
7674//   }
7675//
7676//   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
7677//
7678// On the regular expressions used in death tests:
7679//
7680//   On POSIX-compliant systems (*nix), we use the <regex.h> library,
7681//   which uses the POSIX extended regex syntax.
7682//
7683//   On other platforms (e.g. Windows), we only support a simple regex
7684//   syntax implemented as part of Google Test.  This limited
7685//   implementation should be enough most of the time when writing
7686//   death tests; though it lacks many features you can find in PCRE
7687//   or POSIX extended regex syntax.  For example, we don't support
7688//   union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
7689//   repetition count ("x{5,7}"), among others.
7690//
7691//   Below is the syntax that we do support.  We chose it to be a
7692//   subset of both PCRE and POSIX extended regex, so it's easy to
7693//   learn wherever you come from.  In the following: 'A' denotes a
7694//   literal character, period (.), or a single \\ escape sequence;
7695//   'x' and 'y' denote regular expressions; 'm' and 'n' are for
7696//   natural numbers.
7697//
7698//     c     matches any literal character c
7699//     \\d   matches any decimal digit
7700//     \\D   matches any character that's not a decimal digit
7701//     \\f   matches \f
7702//     \\n   matches \n
7703//     \\r   matches \r
7704//     \\s   matches any ASCII whitespace, including \n
7705//     \\S   matches any character that's not a whitespace
7706//     \\t   matches \t
7707//     \\v   matches \v
7708//     \\w   matches any letter, _, or decimal digit
7709//     \\W   matches any character that \\w doesn't match
7710//     \\c   matches any literal character c, which must be a punctuation
7711//     .     matches any single character except \n
7712//     A?    matches 0 or 1 occurrences of A
7713//     A*    matches 0 or many occurrences of A
7714//     A+    matches 1 or many occurrences of A
7715//     ^     matches the beginning of a string (not that of each line)
7716//     $     matches the end of a string (not that of each line)
7717//     xy    matches x followed by y
7718//
7719//   If you accidentally use PCRE or POSIX extended regex features
7720//   not implemented by us, you will get a run-time failure.  In that
7721//   case, please try to rewrite your regular expression within the
7722//   above syntax.
7723//
7724//   This implementation is *not* meant to be as highly tuned or robust
7725//   as a compiled regex library, but should perform well enough for a
7726//   death test, which already incurs significant overhead by launching
7727//   a child process.
7728//
7729// Known caveats:
7730//
7731//   A "threadsafe" style death test obtains the path to the test
7732//   program from argv[0] and re-executes it in the sub-process.  For
7733//   simplicity, the current implementation doesn't search the PATH
7734//   when launching the sub-process.  This means that the user must
7735//   invoke the test program via a path that contains at least one
7736//   path separator (e.g. path/to/foo_test and
7737//   /absolute/path/to/bar_test are fine, but foo_test is not).  This
7738//   is rarely a problem as people usually don't put the test binary
7739//   directory in PATH.
7740//
7741// TODO(wan@google.com): make thread-safe death tests search the PATH.
7742
7743// Asserts that a given statement causes the program to exit, with an
7744// integer exit status that satisfies predicate, and emitting error output
7745// that matches regex.
7746#define ASSERT_EXIT(statement, predicate, regex) \
7747  GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
7748
7749// Like ASSERT_EXIT, but continues on to successive tests in the
7750// test case, if any:
7751#define EXPECT_EXIT(statement, predicate, regex) \
7752  GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
7753
7754// Asserts that a given statement causes the program to exit, either by
7755// explicitly exiting with a nonzero exit code or being killed by a
7756// signal, and emitting error output that matches regex.
7757#define ASSERT_DEATH(statement, regex) \
7758  ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
7759
7760// Like ASSERT_DEATH, but continues on to successive tests in the
7761// test case, if any:
7762#define EXPECT_DEATH(statement, regex) \
7763  EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
7764
7765// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
7766
7767// Tests that an exit code describes a normal exit with a given exit code.
7768class GTEST_API_ ExitedWithCode {
7769 public:
7770  explicit ExitedWithCode(int exit_code);
7771  bool operator()(int exit_status) const;
7772 private:
7773  // No implementation - assignment is unsupported.
7774  void operator=(const ExitedWithCode& other);
7775
7776  const int exit_code_;
7777};
7778
7779#if !GTEST_OS_WINDOWS
7780// Tests that an exit code describes an exit due to termination by a
7781// given signal.
7782class GTEST_API_ KilledBySignal {
7783 public:
7784  explicit KilledBySignal(int signum);
7785  bool operator()(int exit_status) const;
7786 private:
7787  const int signum_;
7788};
7789#endif  // !GTEST_OS_WINDOWS
7790
7791// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
7792// The death testing framework causes this to have interesting semantics,
7793// since the sideeffects of the call are only visible in opt mode, and not
7794// in debug mode.
7795//
7796// In practice, this can be used to test functions that utilize the
7797// LOG(DFATAL) macro using the following style:
7798//
7799// int DieInDebugOr12(int* sideeffect) {
7800//   if (sideeffect) {
7801//     *sideeffect = 12;
7802//   }
7803//   LOG(DFATAL) << "death";
7804//   return 12;
7805// }
7806//
7807// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
7808//   int sideeffect = 0;
7809//   // Only asserts in dbg.
7810//   EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
7811//
7812// #ifdef NDEBUG
7813//   // opt-mode has sideeffect visible.
7814//   EXPECT_EQ(12, sideeffect);
7815// #else
7816//   // dbg-mode no visible sideeffect.
7817//   EXPECT_EQ(0, sideeffect);
7818// #endif
7819// }
7820//
7821// This will assert that DieInDebugReturn12InOpt() crashes in debug
7822// mode, usually due to a DCHECK or LOG(DFATAL), but returns the
7823// appropriate fallback value (12 in this case) in opt mode. If you
7824// need to test that a function has appropriate side-effects in opt
7825// mode, include assertions against the side-effects.  A general
7826// pattern for this is:
7827//
7828// EXPECT_DEBUG_DEATH({
7829//   // Side-effects here will have an effect after this statement in
7830//   // opt mode, but none in debug mode.
7831//   EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
7832// }, "death");
7833//
7834#ifdef NDEBUG
7835
7836#define EXPECT_DEBUG_DEATH(statement, regex) \
7837  do { statement; } while (::testing::internal::AlwaysFalse())
7838
7839#define ASSERT_DEBUG_DEATH(statement, regex) \
7840  do { statement; } while (::testing::internal::AlwaysFalse())
7841
7842#else
7843
7844#define EXPECT_DEBUG_DEATH(statement, regex) \
7845  EXPECT_DEATH(statement, regex)
7846
7847#define ASSERT_DEBUG_DEATH(statement, regex) \
7848  ASSERT_DEATH(statement, regex)
7849
7850#endif  // NDEBUG for EXPECT_DEBUG_DEATH
7851#endif  // GTEST_HAS_DEATH_TEST
7852
7853// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
7854// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
7855// death tests are supported; otherwise they just issue a warning.  This is
7856// useful when you are combining death test assertions with normal test
7857// assertions in one test.
7858#if GTEST_HAS_DEATH_TEST
7859#define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
7860    EXPECT_DEATH(statement, regex)
7861#define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
7862    ASSERT_DEATH(statement, regex)
7863#else
7864#define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
7865    GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
7866#define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
7867    GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
7868#endif
7869
7870}  // namespace testing
7871
7872#endif  // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
7873// Copyright 2005, Google Inc.
7874// All rights reserved.
7875//
7876// Redistribution and use in source and binary forms, with or without
7877// modification, are permitted provided that the following conditions are
7878// met:
7879//
7880//     * Redistributions of source code must retain the above copyright
7881// notice, this list of conditions and the following disclaimer.
7882//     * Redistributions in binary form must reproduce the above
7883// copyright notice, this list of conditions and the following disclaimer
7884// in the documentation and/or other materials provided with the
7885// distribution.
7886//     * Neither the name of Google Inc. nor the names of its
7887// contributors may be used to endorse or promote products derived from
7888// this software without specific prior written permission.
7889//
7890// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7891// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7892// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7893// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7894// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
7895// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
7896// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7897// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
7898// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7899// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7900// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7901//
7902// Author: wan@google.com (Zhanyong Wan)
7903//
7904// The Google C++ Testing Framework (Google Test)
7905//
7906// This header file defines the Message class.
7907//
7908// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
7909// leave some internal implementation details in this header file.
7910// They are clearly marked by comments like this:
7911//
7912//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
7913//
7914// Such code is NOT meant to be used by a user directly, and is subject
7915// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
7916// program!
7917
7918#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
7919#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
7920
7921#include <limits>
7922
7923
7924namespace testing {
7925
7926// The Message class works like an ostream repeater.
7927//
7928// Typical usage:
7929//
7930//   1. You stream a bunch of values to a Message object.
7931//      It will remember the text in a StrStream.
7932//   2. Then you stream the Message object to an ostream.
7933//      This causes the text in the Message to be streamed
7934//      to the ostream.
7935//
7936// For example;
7937//
7938//   testing::Message foo;
7939//   foo << 1 << " != " << 2;
7940//   std::cout << foo;
7941//
7942// will print "1 != 2".
7943//
7944// Message is not intended to be inherited from.  In particular, its
7945// destructor is not virtual.
7946//
7947// Note that StrStream behaves differently in gcc and in MSVC.  You
7948// can stream a NULL char pointer to it in the former, but not in the
7949// latter (it causes an access violation if you do).  The Message
7950// class hides this difference by treating a NULL char pointer as
7951// "(null)".
7952class GTEST_API_ Message {
7953 private:
7954  // The type of basic IO manipulators (endl, ends, and flush) for
7955  // narrow streams.
7956  typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
7957
7958 public:
7959  // Constructs an empty Message.
7960  // We allocate the StrStream separately because it otherwise each use of
7961  // ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
7962  // stack frame leading to huge stack frames in some cases; gcc does not reuse
7963  // the stack space.
7964  Message() : ss_(new internal::StrStream) {
7965    // By default, we want there to be enough precision when printing
7966    // a double to a Message.
7967    *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
7968  }
7969
7970  // Copy constructor.
7971  Message(const Message& msg) : ss_(new internal::StrStream) {  // NOLINT
7972    *ss_ << msg.GetString();
7973  }
7974
7975  // Constructs a Message from a C-string.
7976  explicit Message(const char* str) : ss_(new internal::StrStream) {
7977    *ss_ << str;
7978  }
7979
7980  ~Message() { delete ss_; }
7981#if GTEST_OS_SYMBIAN
7982  // Streams a value (either a pointer or not) to this object.
7983  template <typename T>
7984  inline Message& operator <<(const T& value) {
7985    StreamHelper(typename internal::is_pointer<T>::type(), value);
7986    return *this;
7987  }
7988#else
7989  // Streams a non-pointer value to this object.
7990  template <typename T>
7991  inline Message& operator <<(const T& val) {
7992    ::GTestStreamToHelper(ss_, val);
7993    return *this;
7994  }
7995
7996  // Streams a pointer value to this object.
7997  //
7998  // This function is an overload of the previous one.  When you
7999  // stream a pointer to a Message, this definition will be used as it
8000  // is more specialized.  (The C++ Standard, section
8001  // [temp.func.order].)  If you stream a non-pointer, then the
8002  // previous definition will be used.
8003  //
8004  // The reason for this overload is that streaming a NULL pointer to
8005  // ostream is undefined behavior.  Depending on the compiler, you
8006  // may get "0", "(nil)", "(null)", or an access violation.  To
8007  // ensure consistent result across compilers, we always treat NULL
8008  // as "(null)".
8009  template <typename T>
8010  inline Message& operator <<(T* const& pointer) {  // NOLINT
8011    if (pointer == NULL) {
8012      *ss_ << "(null)";
8013    } else {
8014      ::GTestStreamToHelper(ss_, pointer);
8015    }
8016    return *this;
8017  }
8018#endif  // GTEST_OS_SYMBIAN
8019
8020  // Since the basic IO manipulators are overloaded for both narrow
8021  // and wide streams, we have to provide this specialized definition
8022  // of operator <<, even though its body is the same as the
8023  // templatized version above.  Without this definition, streaming
8024  // endl or other basic IO manipulators to Message will confuse the
8025  // compiler.
8026  Message& operator <<(BasicNarrowIoManip val) {
8027    *ss_ << val;
8028    return *this;
8029  }
8030
8031  // Instead of 1/0, we want to see true/false for bool values.
8032  Message& operator <<(bool b) {
8033    return *this << (b ? "true" : "false");
8034  }
8035
8036  // These two overloads allow streaming a wide C string to a Message
8037  // using the UTF-8 encoding.
8038  Message& operator <<(const wchar_t* wide_c_str) {
8039    return *this << internal::String::ShowWideCString(wide_c_str);
8040  }
8041  Message& operator <<(wchar_t* wide_c_str) {
8042    return *this << internal::String::ShowWideCString(wide_c_str);
8043  }
8044
8045#if GTEST_HAS_STD_WSTRING
8046  // Converts the given wide string to a narrow string using the UTF-8
8047  // encoding, and streams the result to this Message object.
8048  Message& operator <<(const ::std::wstring& wstr);
8049#endif  // GTEST_HAS_STD_WSTRING
8050
8051#if GTEST_HAS_GLOBAL_WSTRING
8052  // Converts the given wide string to a narrow string using the UTF-8
8053  // encoding, and streams the result to this Message object.
8054  Message& operator <<(const ::wstring& wstr);
8055#endif  // GTEST_HAS_GLOBAL_WSTRING
8056
8057  // Gets the text streamed to this object so far as a String.
8058  // Each '\0' character in the buffer is replaced with "\\0".
8059  //
8060  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
8061  internal::String GetString() const {
8062    return internal::StrStreamToString(ss_);
8063  }
8064
8065 private:
8066#if GTEST_OS_SYMBIAN
8067  // These are needed as the Nokia Symbian Compiler cannot decide between
8068  // const T& and const T* in a function template. The Nokia compiler _can_
8069  // decide between class template specializations for T and T*, so a
8070  // tr1::type_traits-like is_pointer works, and we can overload on that.
8071  template <typename T>
8072  inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) {
8073    if (pointer == NULL) {
8074      *ss_ << "(null)";
8075    } else {
8076      ::GTestStreamToHelper(ss_, pointer);
8077    }
8078  }
8079  template <typename T>
8080  inline void StreamHelper(internal::false_type /*dummy*/, const T& value) {
8081    ::GTestStreamToHelper(ss_, value);
8082  }
8083#endif  // GTEST_OS_SYMBIAN
8084
8085  // We'll hold the text streamed to this object here.
8086  internal::StrStream* const ss_;
8087
8088  // We declare (but don't implement) this to prevent the compiler
8089  // from implementing the assignment operator.
8090  void operator=(const Message&);
8091};
8092
8093// Streams a Message to an ostream.
8094inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
8095  return os << sb.GetString();
8096}
8097
8098}  // namespace testing
8099
8100#endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
8101// This file was GENERATED by a script.  DO NOT EDIT BY HAND!!!
8102
8103// Copyright 2008, Google Inc.
8104// All rights reserved.
8105//
8106// Redistribution and use in source and binary forms, with or without
8107// modification, are permitted provided that the following conditions are
8108// met:
8109//
8110//     * Redistributions of source code must retain the above copyright
8111// notice, this list of conditions and the following disclaimer.
8112//     * Redistributions in binary form must reproduce the above
8113// copyright notice, this list of conditions and the following disclaimer
8114// in the documentation and/or other materials provided with the
8115// distribution.
8116//     * Neither the name of Google Inc. nor the names of its
8117// contributors may be used to endorse or promote products derived from
8118// this software without specific prior written permission.
8119//
8120// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8121// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8122// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8123// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8124// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8125// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8126// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8127// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8128// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8129// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8130// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8131//
8132// Authors: vladl@google.com (Vlad Losev)
8133//
8134// Macros and functions for implementing parameterized tests
8135// in Google C++ Testing Framework (Google Test)
8136//
8137// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
8138//
8139#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8140#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8141
8142
8143// Value-parameterized tests allow you to test your code with different
8144// parameters without writing multiple copies of the same test.
8145//
8146// Here is how you use value-parameterized tests:
8147
8148#if 0
8149
8150// To write value-parameterized tests, first you should define a fixture
8151// class. It must be derived from testing::TestWithParam<T>, where T is
8152// the type of your parameter values. TestWithParam<T> is itself derived
8153// from testing::Test. T can be any copyable type. If it's a raw pointer,
8154// you are responsible for managing the lifespan of the pointed values.
8155
8156class FooTest : public ::testing::TestWithParam<const char*> {
8157  // You can implement all the usual class fixture members here.
8158};
8159
8160// Then, use the TEST_P macro to define as many parameterized tests
8161// for this fixture as you want. The _P suffix is for "parameterized"
8162// or "pattern", whichever you prefer to think.
8163
8164TEST_P(FooTest, DoesBlah) {
8165  // Inside a test, access the test parameter with the GetParam() method
8166  // of the TestWithParam<T> class:
8167  EXPECT_TRUE(foo.Blah(GetParam()));
8168  ...
8169}
8170
8171TEST_P(FooTest, HasBlahBlah) {
8172  ...
8173}
8174
8175// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
8176// case with any set of parameters you want. Google Test defines a number
8177// of functions for generating test parameters. They return what we call
8178// (surprise!) parameter generators. Here is a  summary of them, which
8179// are all in the testing namespace:
8180//
8181//
8182//  Range(begin, end [, step]) - Yields values {begin, begin+step,
8183//                               begin+step+step, ...}. The values do not
8184//                               include end. step defaults to 1.
8185//  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.
8186//  ValuesIn(container)        - Yields values from a C-style array, an STL
8187//  ValuesIn(begin,end)          container, or an iterator range [begin, end).
8188//  Bool()                     - Yields sequence {false, true}.
8189//  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product
8190//                               for the math savvy) of the values generated
8191//                               by the N generators.
8192//
8193// For more details, see comments at the definitions of these functions below
8194// in this file.
8195//
8196// The following statement will instantiate tests from the FooTest test case
8197// each with parameter values "meeny", "miny", and "moe".
8198
8199INSTANTIATE_TEST_CASE_P(InstantiationName,
8200                        FooTest,
8201                        Values("meeny", "miny", "moe"));
8202
8203// To distinguish different instances of the pattern, (yes, you
8204// can instantiate it more then once) the first argument to the
8205// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
8206// actual test case name. Remember to pick unique prefixes for different
8207// instantiations. The tests from the instantiation above will have
8208// these names:
8209//
8210//    * InstantiationName/FooTest.DoesBlah/0 for "meeny"
8211//    * InstantiationName/FooTest.DoesBlah/1 for "miny"
8212//    * InstantiationName/FooTest.DoesBlah/2 for "moe"
8213//    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
8214//    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
8215//    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
8216//
8217// You can use these names in --gtest_filter.
8218//
8219// This statement will instantiate all tests from FooTest again, each
8220// with parameter values "cat" and "dog":
8221
8222const char* pets[] = {"cat", "dog"};
8223INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
8224
8225// The tests from the instantiation above will have these names:
8226//
8227//    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
8228//    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
8229//    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
8230//    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
8231//
8232// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
8233// in the given test case, whether their definitions come before or
8234// AFTER the INSTANTIATE_TEST_CASE_P statement.
8235//
8236// Please also note that generator expressions (including parameters to the
8237// generators) are evaluated in InitGoogleTest(), after main() has started.
8238// This allows the user on one hand, to adjust generator parameters in order
8239// to dynamically determine a set of tests to run and on the other hand,
8240// give the user a chance to inspect the generated tests with Google Test
8241// reflection API before RUN_ALL_TESTS() is executed.
8242//
8243// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
8244// for more examples.
8245//
8246// In the future, we plan to publish the API for defining new parameter
8247// generators. But for now this interface remains part of the internal
8248// implementation and is subject to change.
8249
8250#endif  // 0
8251
8252
8253#if !GTEST_OS_SYMBIAN
8254#include <utility>
8255#endif
8256
8257// scripts/fuse_gtest.py depends on gtest's own header being #included
8258// *unconditionally*.  Therefore these #includes cannot be moved
8259// inside #if GTEST_HAS_PARAM_TEST.
8260// Copyright 2008 Google Inc.
8261// All Rights Reserved.
8262//
8263// Redistribution and use in source and binary forms, with or without
8264// modification, are permitted provided that the following conditions are
8265// met:
8266//
8267//     * Redistributions of source code must retain the above copyright
8268// notice, this list of conditions and the following disclaimer.
8269//     * Redistributions in binary form must reproduce the above
8270// copyright notice, this list of conditions and the following disclaimer
8271// in the documentation and/or other materials provided with the
8272// distribution.
8273//     * Neither the name of Google Inc. nor the names of its
8274// contributors may be used to endorse or promote products derived from
8275// this software without specific prior written permission.
8276//
8277// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8278// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8279// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8280// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8281// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8282// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8283// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8284// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8285// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8286// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8287// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8288//
8289// Author: vladl@google.com (Vlad Losev)
8290
8291// Type and function utilities for implementing parameterized tests.
8292
8293#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
8294#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
8295
8296#include <iterator>
8297#include <utility>
8298#include <vector>
8299
8300// scripts/fuse_gtest.py depends on gtest's own header being #included
8301// *unconditionally*.  Therefore these #includes cannot be moved
8302// inside #if GTEST_HAS_PARAM_TEST.
8303// Copyright 2003 Google Inc.
8304// All rights reserved.
8305//
8306// Redistribution and use in source and binary forms, with or without
8307// modification, are permitted provided that the following conditions are
8308// met:
8309//
8310//     * Redistributions of source code must retain the above copyright
8311// notice, this list of conditions and the following disclaimer.
8312//     * Redistributions in binary form must reproduce the above
8313// copyright notice, this list of conditions and the following disclaimer
8314// in the documentation and/or other materials provided with the
8315// distribution.
8316//     * Neither the name of Google Inc. nor the names of its
8317// contributors may be used to endorse or promote products derived from
8318// this software without specific prior written permission.
8319//
8320// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8321// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8322// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8323// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8324// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8325// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8326// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8327// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8328// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8329// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8330// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8331//
8332// Authors: Dan Egnor (egnor@google.com)
8333//
8334// A "smart" pointer type with reference tracking.  Every pointer to a
8335// particular object is kept on a circular linked list.  When the last pointer
8336// to an object is destroyed or reassigned, the object is deleted.
8337//
8338// Used properly, this deletes the object when the last reference goes away.
8339// There are several caveats:
8340// - Like all reference counting schemes, cycles lead to leaks.
8341// - Each smart pointer is actually two pointers (8 bytes instead of 4).
8342// - Every time a pointer is assigned, the entire list of pointers to that
8343//   object is traversed.  This class is therefore NOT SUITABLE when there
8344//   will often be more than two or three pointers to a particular object.
8345// - References are only tracked as long as linked_ptr<> objects are copied.
8346//   If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
8347//   will happen (double deletion).
8348//
8349// A good use of this class is storing object references in STL containers.
8350// You can safely put linked_ptr<> in a vector<>.
8351// Other uses may not be as good.
8352//
8353// Note: If you use an incomplete type with linked_ptr<>, the class
8354// *containing* linked_ptr<> must have a constructor and destructor (even
8355// if they do nothing!).
8356//
8357// Bill Gibbons suggested we use something like this.
8358//
8359// Thread Safety:
8360//   Unlike other linked_ptr implementations, in this implementation
8361//   a linked_ptr object is thread-safe in the sense that:
8362//     - it's safe to copy linked_ptr objects concurrently,
8363//     - it's safe to copy *from* a linked_ptr and read its underlying
8364//       raw pointer (e.g. via get()) concurrently, and
8365//     - it's safe to write to two linked_ptrs that point to the same
8366//       shared object concurrently.
8367// TODO(wan@google.com): rename this to safe_linked_ptr to avoid
8368// confusion with normal linked_ptr.
8369
8370#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
8371#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
8372
8373#include <stdlib.h>
8374#include <assert.h>
8375
8376
8377namespace testing {
8378namespace internal {
8379
8380// Protects copying of all linked_ptr objects.
8381GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
8382
8383// This is used internally by all instances of linked_ptr<>.  It needs to be
8384// a non-template class because different types of linked_ptr<> can refer to
8385// the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
8386// So, it needs to be possible for different types of linked_ptr to participate
8387// in the same circular linked list, so we need a single class type here.
8388//
8389// DO NOT USE THIS CLASS DIRECTLY YOURSELF.  Use linked_ptr<T>.
8390class linked_ptr_internal {
8391 public:
8392  // Create a new circle that includes only this instance.
8393  void join_new() {
8394    next_ = this;
8395  }
8396
8397  // Many linked_ptr operations may change p.link_ for some linked_ptr
8398  // variable p in the same circle as this object.  Therefore we need
8399  // to prevent two such operations from occurring concurrently.
8400  //
8401  // Note that different types of linked_ptr objects can coexist in a
8402  // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
8403  // linked_ptr<Derived2>).  Therefore we must use a single mutex to
8404  // protect all linked_ptr objects.  This can create serious
8405  // contention in production code, but is acceptable in a testing
8406  // framework.
8407
8408  // Join an existing circle.
8409  // L < g_linked_ptr_mutex
8410  void join(linked_ptr_internal const* ptr) {
8411    MutexLock lock(&g_linked_ptr_mutex);
8412
8413    linked_ptr_internal const* p = ptr;
8414    while (p->next_ != ptr) p = p->next_;
8415    p->next_ = this;
8416    next_ = ptr;
8417  }
8418
8419  // Leave whatever circle we're part of.  Returns true if we were the
8420  // last member of the circle.  Once this is done, you can join() another.
8421  // L < g_linked_ptr_mutex
8422  bool depart() {
8423    MutexLock lock(&g_linked_ptr_mutex);
8424
8425    if (next_ == this) return true;
8426    linked_ptr_internal const* p = next_;
8427    while (p->next_ != this) p = p->next_;
8428    p->next_ = next_;
8429    return false;
8430  }
8431
8432 private:
8433  mutable linked_ptr_internal const* next_;
8434};
8435
8436template <typename T>
8437class linked_ptr {
8438 public:
8439  typedef T element_type;
8440
8441  // Take over ownership of a raw pointer.  This should happen as soon as
8442  // possible after the object is created.
8443  explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
8444  ~linked_ptr() { depart(); }
8445
8446  // Copy an existing linked_ptr<>, adding ourselves to the list of references.
8447  template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
8448  linked_ptr(linked_ptr const& ptr) {  // NOLINT
8449    assert(&ptr != this);
8450    copy(&ptr);
8451  }
8452
8453  // Assignment releases the old value and acquires the new.
8454  template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
8455    depart();
8456    copy(&ptr);
8457    return *this;
8458  }
8459
8460  linked_ptr& operator=(linked_ptr const& ptr) {
8461    if (&ptr != this) {
8462      depart();
8463      copy(&ptr);
8464    }
8465    return *this;
8466  }
8467
8468  // Smart pointer members.
8469  void reset(T* ptr = NULL) {
8470    depart();
8471    capture(ptr);
8472  }
8473  T* get() const { return value_; }
8474  T* operator->() const { return value_; }
8475  T& operator*() const { return *value_; }
8476  // Release ownership of the pointed object and returns it.
8477  // Sole ownership by this linked_ptr object is required.
8478  T* release() {
8479    bool last = link_.depart();
8480    assert(last);
8481    T* v = value_;
8482    value_ = NULL;
8483    return v;
8484  }
8485
8486  bool operator==(T* p) const { return value_ == p; }
8487  bool operator!=(T* p) const { return value_ != p; }
8488  template <typename U>
8489  bool operator==(linked_ptr<U> const& ptr) const {
8490    return value_ == ptr.get();
8491  }
8492  template <typename U>
8493  bool operator!=(linked_ptr<U> const& ptr) const {
8494    return value_ != ptr.get();
8495  }
8496
8497 private:
8498  template <typename U>
8499  friend class linked_ptr;
8500
8501  T* value_;
8502  linked_ptr_internal link_;
8503
8504  void depart() {
8505    if (link_.depart()) delete value_;
8506  }
8507
8508  void capture(T* ptr) {
8509    value_ = ptr;
8510    link_.join_new();
8511  }
8512
8513  template <typename U> void copy(linked_ptr<U> const* ptr) {
8514    value_ = ptr->get();
8515    if (value_)
8516      link_.join(&ptr->link_);
8517    else
8518      link_.join_new();
8519  }
8520};
8521
8522template<typename T> inline
8523bool operator==(T* ptr, const linked_ptr<T>& x) {
8524  return ptr == x.get();
8525}
8526
8527template<typename T> inline
8528bool operator!=(T* ptr, const linked_ptr<T>& x) {
8529  return ptr != x.get();
8530}
8531
8532// A function to convert T* into linked_ptr<T>
8533// Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
8534// for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
8535template <typename T>
8536linked_ptr<T> make_linked_ptr(T* ptr) {
8537  return linked_ptr<T>(ptr);
8538}
8539
8540}  // namespace internal
8541}  // namespace testing
8542
8543#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
8544
8545#if GTEST_HAS_PARAM_TEST
8546
8547namespace testing {
8548namespace internal {
8549
8550// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
8551//
8552// Outputs a message explaining invalid registration of different
8553// fixture class for the same test case. This may happen when
8554// TEST_P macro is used to define two tests with the same name
8555// but in different namespaces.
8556GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
8557                                          const char* file, int line);
8558
8559template <typename> class ParamGeneratorInterface;
8560template <typename> class ParamGenerator;
8561
8562// Interface for iterating over elements provided by an implementation
8563// of ParamGeneratorInterface<T>.
8564template <typename T>
8565class ParamIteratorInterface {
8566 public:
8567  virtual ~ParamIteratorInterface() {}
8568  // A pointer to the base generator instance.
8569  // Used only for the purposes of iterator comparison
8570  // to make sure that two iterators belong to the same generator.
8571  virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
8572  // Advances iterator to point to the next element
8573  // provided by the generator. The caller is responsible
8574  // for not calling Advance() on an iterator equal to
8575  // BaseGenerator()->End().
8576  virtual void Advance() = 0;
8577  // Clones the iterator object. Used for implementing copy semantics
8578  // of ParamIterator<T>.
8579  virtual ParamIteratorInterface* Clone() const = 0;
8580  // Dereferences the current iterator and provides (read-only) access
8581  // to the pointed value. It is the caller's responsibility not to call
8582  // Current() on an iterator equal to BaseGenerator()->End().
8583  // Used for implementing ParamGenerator<T>::operator*().
8584  virtual const T* Current() const = 0;
8585  // Determines whether the given iterator and other point to the same
8586  // element in the sequence generated by the generator.
8587  // Used for implementing ParamGenerator<T>::operator==().
8588  virtual bool Equals(const ParamIteratorInterface& other) const = 0;
8589};
8590
8591// Class iterating over elements provided by an implementation of
8592// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
8593// and implements the const forward iterator concept.
8594template <typename T>
8595class ParamIterator {
8596 public:
8597  typedef T value_type;
8598  typedef const T& reference;
8599  typedef ptrdiff_t difference_type;
8600
8601  // ParamIterator assumes ownership of the impl_ pointer.
8602  ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
8603  ParamIterator& operator=(const ParamIterator& other) {
8604    if (this != &other)
8605      impl_.reset(other.impl_->Clone());
8606    return *this;
8607  }
8608
8609  const T& operator*() const { return *impl_->Current(); }
8610  const T* operator->() const { return impl_->Current(); }
8611  // Prefix version of operator++.
8612  ParamIterator& operator++() {
8613    impl_->Advance();
8614    return *this;
8615  }
8616  // Postfix version of operator++.
8617  ParamIterator operator++(int /*unused*/) {
8618    ParamIteratorInterface<T>* clone = impl_->Clone();
8619    impl_->Advance();
8620    return ParamIterator(clone);
8621  }
8622  bool operator==(const ParamIterator& other) const {
8623    return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
8624  }
8625  bool operator!=(const ParamIterator& other) const {
8626    return !(*this == other);
8627  }
8628
8629 private:
8630  friend class ParamGenerator<T>;
8631  explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
8632  scoped_ptr<ParamIteratorInterface<T> > impl_;
8633};
8634
8635// ParamGeneratorInterface<T> is the binary interface to access generators
8636// defined in other translation units.
8637template <typename T>
8638class ParamGeneratorInterface {
8639 public:
8640  typedef T ParamType;
8641
8642  virtual ~ParamGeneratorInterface() {}
8643
8644  // Generator interface definition
8645  virtual ParamIteratorInterface<T>* Begin() const = 0;
8646  virtual ParamIteratorInterface<T>* End() const = 0;
8647};
8648
8649// Wraps ParamGeneratorInterface<T> and provides general generator syntax
8650// compatible with the STL Container concept.
8651// This class implements copy initialization semantics and the contained
8652// ParamGeneratorInterface<T> instance is shared among all copies
8653// of the original object. This is possible because that instance is immutable.
8654template<typename T>
8655class ParamGenerator {
8656 public:
8657  typedef ParamIterator<T> iterator;
8658
8659  explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
8660  ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
8661
8662  ParamGenerator& operator=(const ParamGenerator& other) {
8663    impl_ = other.impl_;
8664    return *this;
8665  }
8666
8667  iterator begin() const { return iterator(impl_->Begin()); }
8668  iterator end() const { return iterator(impl_->End()); }
8669
8670 private:
8671  ::testing::internal::linked_ptr<const ParamGeneratorInterface<T> > impl_;
8672};
8673
8674// Generates values from a range of two comparable values. Can be used to
8675// generate sequences of user-defined types that implement operator+() and
8676// operator<().
8677// This class is used in the Range() function.
8678template <typename T, typename IncrementT>
8679class RangeGenerator : public ParamGeneratorInterface<T> {
8680 public:
8681  RangeGenerator(T begin, T end, IncrementT step)
8682      : begin_(begin), end_(end),
8683        step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
8684  virtual ~RangeGenerator() {}
8685
8686  virtual ParamIteratorInterface<T>* Begin() const {
8687    return new Iterator(this, begin_, 0, step_);
8688  }
8689  virtual ParamIteratorInterface<T>* End() const {
8690    return new Iterator(this, end_, end_index_, step_);
8691  }
8692
8693 private:
8694  class Iterator : public ParamIteratorInterface<T> {
8695   public:
8696    Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
8697             IncrementT step)
8698        : base_(base), value_(value), index_(index), step_(step) {}
8699    virtual ~Iterator() {}
8700
8701    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
8702      return base_;
8703    }
8704    virtual void Advance() {
8705      value_ = value_ + step_;
8706      index_++;
8707    }
8708    virtual ParamIteratorInterface<T>* Clone() const {
8709      return new Iterator(*this);
8710    }
8711    virtual const T* Current() const { return &value_; }
8712    virtual bool Equals(const ParamIteratorInterface<T>& other) const {
8713      // Having the same base generator guarantees that the other
8714      // iterator is of the same type and we can downcast.
8715      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
8716          << "The program attempted to compare iterators "
8717          << "from different generators." << std::endl;
8718      const int other_index =
8719          CheckedDowncastToActualType<const Iterator>(&other)->index_;
8720      return index_ == other_index;
8721    }
8722
8723   private:
8724    Iterator(const Iterator& other)
8725        : ParamIteratorInterface<T>(),
8726          base_(other.base_), value_(other.value_), index_(other.index_),
8727          step_(other.step_) {}
8728
8729    // No implementation - assignment is unsupported.
8730    void operator=(const Iterator& other);
8731
8732    const ParamGeneratorInterface<T>* const base_;
8733    T value_;
8734    int index_;
8735    const IncrementT step_;
8736  };  // class RangeGenerator::Iterator
8737
8738  static int CalculateEndIndex(const T& begin,
8739                               const T& end,
8740                               const IncrementT& step) {
8741    int end_index = 0;
8742    for (T i = begin; i < end; i = i + step)
8743      end_index++;
8744    return end_index;
8745  }
8746
8747  // No implementation - assignment is unsupported.
8748  void operator=(const RangeGenerator& other);
8749
8750  const T begin_;
8751  const T end_;
8752  const IncrementT step_;
8753  // The index for the end() iterator. All the elements in the generated
8754  // sequence are indexed (0-based) to aid iterator comparison.
8755  const int end_index_;
8756};  // class RangeGenerator
8757
8758
8759// Generates values from a pair of STL-style iterators. Used in the
8760// ValuesIn() function. The elements are copied from the source range
8761// since the source can be located on the stack, and the generator
8762// is likely to persist beyond that stack frame.
8763template <typename T>
8764class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
8765 public:
8766  template <typename ForwardIterator>
8767  ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
8768      : container_(begin, end) {}
8769  virtual ~ValuesInIteratorRangeGenerator() {}
8770
8771  virtual ParamIteratorInterface<T>* Begin() const {
8772    return new Iterator(this, container_.begin());
8773  }
8774  virtual ParamIteratorInterface<T>* End() const {
8775    return new Iterator(this, container_.end());
8776  }
8777
8778 private:
8779  typedef typename ::std::vector<T> ContainerType;
8780
8781  class Iterator : public ParamIteratorInterface<T> {
8782   public:
8783    Iterator(const ParamGeneratorInterface<T>* base,
8784             typename ContainerType::const_iterator iterator)
8785        :  base_(base), iterator_(iterator) {}
8786    virtual ~Iterator() {}
8787
8788    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
8789      return base_;
8790    }
8791    virtual void Advance() {
8792      ++iterator_;
8793      value_.reset();
8794    }
8795    virtual ParamIteratorInterface<T>* Clone() const {
8796      return new Iterator(*this);
8797    }
8798    // We need to use cached value referenced by iterator_ because *iterator_
8799    // can return a temporary object (and of type other then T), so just
8800    // having "return &*iterator_;" doesn't work.
8801    // value_ is updated here and not in Advance() because Advance()
8802    // can advance iterator_ beyond the end of the range, and we cannot
8803    // detect that fact. The client code, on the other hand, is
8804    // responsible for not calling Current() on an out-of-range iterator.
8805    virtual const T* Current() const {
8806      if (value_.get() == NULL)
8807        value_.reset(new T(*iterator_));
8808      return value_.get();
8809    }
8810    virtual bool Equals(const ParamIteratorInterface<T>& other) const {
8811      // Having the same base generator guarantees that the other
8812      // iterator is of the same type and we can downcast.
8813      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
8814          << "The program attempted to compare iterators "
8815          << "from different generators." << std::endl;
8816      return iterator_ ==
8817          CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
8818    }
8819
8820   private:
8821    Iterator(const Iterator& other)
8822          // The explicit constructor call suppresses a false warning
8823          // emitted by gcc when supplied with the -Wextra option.
8824        : ParamIteratorInterface<T>(),
8825          base_(other.base_),
8826          iterator_(other.iterator_) {}
8827
8828    const ParamGeneratorInterface<T>* const base_;
8829    typename ContainerType::const_iterator iterator_;
8830    // A cached value of *iterator_. We keep it here to allow access by
8831    // pointer in the wrapping iterator's operator->().
8832    // value_ needs to be mutable to be accessed in Current().
8833    // Use of scoped_ptr helps manage cached value's lifetime,
8834    // which is bound by the lifespan of the iterator itself.
8835    mutable scoped_ptr<const T> value_;
8836  };  // class ValuesInIteratorRangeGenerator::Iterator
8837
8838  // No implementation - assignment is unsupported.
8839  void operator=(const ValuesInIteratorRangeGenerator& other);
8840
8841  const ContainerType container_;
8842};  // class ValuesInIteratorRangeGenerator
8843
8844// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
8845//
8846// Stores a parameter value and later creates tests parameterized with that
8847// value.
8848template <class TestClass>
8849class ParameterizedTestFactory : public TestFactoryBase {
8850 public:
8851  typedef typename TestClass::ParamType ParamType;
8852  explicit ParameterizedTestFactory(ParamType parameter) :
8853      parameter_(parameter) {}
8854  virtual Test* CreateTest() {
8855    TestClass::SetParam(&parameter_);
8856    return new TestClass();
8857  }
8858
8859 private:
8860  const ParamType parameter_;
8861
8862  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
8863};
8864
8865// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
8866//
8867// TestMetaFactoryBase is a base class for meta-factories that create
8868// test factories for passing into MakeAndRegisterTestInfo function.
8869template <class ParamType>
8870class TestMetaFactoryBase {
8871 public:
8872  virtual ~TestMetaFactoryBase() {}
8873
8874  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
8875};
8876
8877// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
8878//
8879// TestMetaFactory creates test factories for passing into
8880// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
8881// ownership of test factory pointer, same factory object cannot be passed
8882// into that method twice. But ParameterizedTestCaseInfo is going to call
8883// it for each Test/Parameter value combination. Thus it needs meta factory
8884// creator class.
8885template <class TestCase>
8886class TestMetaFactory
8887    : public TestMetaFactoryBase<typename TestCase::ParamType> {
8888 public:
8889  typedef typename TestCase::ParamType ParamType;
8890
8891  TestMetaFactory() {}
8892
8893  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
8894    return new ParameterizedTestFactory<TestCase>(parameter);
8895  }
8896
8897 private:
8898  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
8899};
8900
8901// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
8902//
8903// ParameterizedTestCaseInfoBase is a generic interface
8904// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
8905// accumulates test information provided by TEST_P macro invocations
8906// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
8907// and uses that information to register all resulting test instances
8908// in RegisterTests method. The ParameterizeTestCaseRegistry class holds
8909// a collection of pointers to the ParameterizedTestCaseInfo objects
8910// and calls RegisterTests() on each of them when asked.
8911class ParameterizedTestCaseInfoBase {
8912 public:
8913  virtual ~ParameterizedTestCaseInfoBase() {}
8914
8915  // Base part of test case name for display purposes.
8916  virtual const String& GetTestCaseName() const = 0;
8917  // Test case id to verify identity.
8918  virtual TypeId GetTestCaseTypeId() const = 0;
8919  // UnitTest class invokes this method to register tests in this
8920  // test case right before running them in RUN_ALL_TESTS macro.
8921  // This method should not be called more then once on any single
8922  // instance of a ParameterizedTestCaseInfoBase derived class.
8923  virtual void RegisterTests() = 0;
8924
8925 protected:
8926  ParameterizedTestCaseInfoBase() {}
8927
8928 private:
8929  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
8930};
8931
8932// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
8933//
8934// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
8935// macro invocations for a particular test case and generators
8936// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
8937// test case. It registers tests with all values generated by all
8938// generators when asked.
8939template <class TestCase>
8940class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
8941 public:
8942  // ParamType and GeneratorCreationFunc are private types but are required
8943  // for declarations of public methods AddTestPattern() and
8944  // AddTestCaseInstantiation().
8945  typedef typename TestCase::ParamType ParamType;
8946  // A function that returns an instance of appropriate generator type.
8947  typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
8948
8949  explicit ParameterizedTestCaseInfo(const char* name)
8950      : test_case_name_(name) {}
8951
8952  // Test case base name for display purposes.
8953  virtual const String& GetTestCaseName() const { return test_case_name_; }
8954  // Test case id to verify identity.
8955  virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
8956  // TEST_P macro uses AddTestPattern() to record information
8957  // about a single test in a LocalTestInfo structure.
8958  // test_case_name is the base name of the test case (without invocation
8959  // prefix). test_base_name is the name of an individual test without
8960  // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
8961  // test case base name and DoBar is test base name.
8962  void AddTestPattern(const char* test_case_name,
8963                      const char* test_base_name,
8964                      TestMetaFactoryBase<ParamType>* meta_factory) {
8965    tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
8966                                                       test_base_name,
8967                                                       meta_factory)));
8968  }
8969  // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
8970  // about a generator.
8971  int AddTestCaseInstantiation(const char* instantiation_name,
8972                               GeneratorCreationFunc* func,
8973                               const char* /* file */,
8974                               int /* line */) {
8975    instantiations_.push_back(::std::make_pair(instantiation_name, func));
8976    return 0;  // Return value used only to run this method in namespace scope.
8977  }
8978  // UnitTest class invokes this method to register tests in this test case
8979  // test cases right before running tests in RUN_ALL_TESTS macro.
8980  // This method should not be called more then once on any single
8981  // instance of a ParameterizedTestCaseInfoBase derived class.
8982  // UnitTest has a guard to prevent from calling this method more then once.
8983  virtual void RegisterTests() {
8984    for (typename TestInfoContainer::iterator test_it = tests_.begin();
8985         test_it != tests_.end(); ++test_it) {
8986      linked_ptr<TestInfo> test_info = *test_it;
8987      for (typename InstantiationContainer::iterator gen_it =
8988               instantiations_.begin(); gen_it != instantiations_.end();
8989               ++gen_it) {
8990        const String& instantiation_name = gen_it->first;
8991        ParamGenerator<ParamType> generator((*gen_it->second)());
8992
8993        Message test_case_name_stream;
8994        if ( !instantiation_name.empty() )
8995          test_case_name_stream << instantiation_name.c_str() << "/";
8996        test_case_name_stream << test_info->test_case_base_name.c_str();
8997
8998        int i = 0;
8999        for (typename ParamGenerator<ParamType>::iterator param_it =
9000                 generator.begin();
9001             param_it != generator.end(); ++param_it, ++i) {
9002          Message test_name_stream;
9003          test_name_stream << test_info->test_base_name.c_str() << "/" << i;
9004          ::testing::internal::MakeAndRegisterTestInfo(
9005              test_case_name_stream.GetString().c_str(),
9006              test_name_stream.GetString().c_str(),
9007              "",  // test_case_comment
9008              "",  // comment; TODO(vladl@google.com): provide parameter value
9009                   //                                  representation.
9010              GetTestCaseTypeId(),
9011              TestCase::SetUpTestCase,
9012              TestCase::TearDownTestCase,
9013              test_info->test_meta_factory->CreateTestFactory(*param_it));
9014        }  // for param_it
9015      }  // for gen_it
9016    }  // for test_it
9017  }  // RegisterTests
9018
9019 private:
9020  // LocalTestInfo structure keeps information about a single test registered
9021  // with TEST_P macro.
9022  struct TestInfo {
9023    TestInfo(const char* a_test_case_base_name,
9024             const char* a_test_base_name,
9025             TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
9026        test_case_base_name(a_test_case_base_name),
9027        test_base_name(a_test_base_name),
9028        test_meta_factory(a_test_meta_factory) {}
9029
9030    const String test_case_base_name;
9031    const String test_base_name;
9032    const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
9033  };
9034  typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
9035  // Keeps pairs of <Instantiation name, Sequence generator creation function>
9036  // received from INSTANTIATE_TEST_CASE_P macros.
9037  typedef ::std::vector<std::pair<String, GeneratorCreationFunc*> >
9038      InstantiationContainer;
9039
9040  const String test_case_name_;
9041  TestInfoContainer tests_;
9042  InstantiationContainer instantiations_;
9043
9044  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
9045};  // class ParameterizedTestCaseInfo
9046
9047// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
9048//
9049// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
9050// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
9051// macros use it to locate their corresponding ParameterizedTestCaseInfo
9052// descriptors.
9053class ParameterizedTestCaseRegistry {
9054 public:
9055  ParameterizedTestCaseRegistry() {}
9056  ~ParameterizedTestCaseRegistry() {
9057    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
9058         it != test_case_infos_.end(); ++it) {
9059      delete *it;
9060    }
9061  }
9062
9063  // Looks up or creates and returns a structure containing information about
9064  // tests and instantiations of a particular test case.
9065  template <class TestCase>
9066  ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
9067      const char* test_case_name,
9068      const char* file,
9069      int line) {
9070    ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
9071    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
9072         it != test_case_infos_.end(); ++it) {
9073      if ((*it)->GetTestCaseName() == test_case_name) {
9074        if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
9075          // Complain about incorrect usage of Google Test facilities
9076          // and terminate the program since we cannot guaranty correct
9077          // test case setup and tear-down in this case.
9078          ReportInvalidTestCaseType(test_case_name,  file, line);
9079          abort();
9080        } else {
9081          // At this point we are sure that the object we found is of the same
9082          // type we are looking for, so we downcast it to that type
9083          // without further checks.
9084          typed_test_info = CheckedDowncastToActualType<
9085              ParameterizedTestCaseInfo<TestCase> >(*it);
9086        }
9087        break;
9088      }
9089    }
9090    if (typed_test_info == NULL) {
9091      typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
9092      test_case_infos_.push_back(typed_test_info);
9093    }
9094    return typed_test_info;
9095  }
9096  void RegisterTests() {
9097    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
9098         it != test_case_infos_.end(); ++it) {
9099      (*it)->RegisterTests();
9100    }
9101  }
9102
9103 private:
9104  typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
9105
9106  TestCaseInfoContainer test_case_infos_;
9107
9108  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
9109};
9110
9111}  // namespace internal
9112}  // namespace testing
9113
9114#endif  //  GTEST_HAS_PARAM_TEST
9115
9116#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
9117// This file was GENERATED by a script.  DO NOT EDIT BY HAND!!!
9118
9119// Copyright 2008 Google Inc.
9120// All Rights Reserved.
9121//
9122// Redistribution and use in source and binary forms, with or without
9123// modification, are permitted provided that the following conditions are
9124// met:
9125//
9126//     * Redistributions of source code must retain the above copyright
9127// notice, this list of conditions and the following disclaimer.
9128//     * Redistributions in binary form must reproduce the above
9129// copyright notice, this list of conditions and the following disclaimer
9130// in the documentation and/or other materials provided with the
9131// distribution.
9132//     * Neither the name of Google Inc. nor the names of its
9133// contributors may be used to endorse or promote products derived from
9134// this software without specific prior written permission.
9135//
9136// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9137// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9138// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9139// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9140// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9141// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9142// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9143// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9144// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9145// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9146// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9147//
9148// Author: vladl@google.com (Vlad Losev)
9149
9150// Type and function utilities for implementing parameterized tests.
9151// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
9152//
9153// Currently Google Test supports at most 50 arguments in Values,
9154// and at most 10 arguments in Combine. Please contact
9155// googletestframework@googlegroups.com if you need more.
9156// Please note that the number of arguments to Combine is limited
9157// by the maximum arity of the implementation of tr1::tuple which is
9158// currently set at 10.
9159
9160#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
9161#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
9162
9163// scripts/fuse_gtest.py depends on gtest's own header being #included
9164// *unconditionally*.  Therefore these #includes cannot be moved
9165// inside #if GTEST_HAS_PARAM_TEST.
9166
9167#if GTEST_HAS_PARAM_TEST
9168
9169namespace testing {
9170
9171// Forward declarations of ValuesIn(), which is implemented in
9172// include/gtest/gtest-param-test.h.
9173template <typename ForwardIterator>
9174internal::ParamGenerator<
9175    typename ::std::iterator_traits<ForwardIterator>::value_type> ValuesIn(
9176        ForwardIterator begin, ForwardIterator end);
9177
9178template <typename T, size_t N>
9179internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
9180
9181template <class Container>
9182internal::ParamGenerator<typename Container::value_type> ValuesIn(
9183    const Container& container);
9184
9185namespace internal {
9186
9187// Used in the Values() function to provide polymorphic capabilities.
9188template <typename T1>
9189class ValueArray1 {
9190 public:
9191  explicit ValueArray1(T1 v1) : v1_(v1) {}
9192
9193  template <typename T>
9194  operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
9195
9196 private:
9197  // No implementation - assignment is unsupported.
9198  void operator=(const ValueArray1& other);
9199
9200  const T1 v1_;
9201};
9202
9203template <typename T1, typename T2>
9204class ValueArray2 {
9205 public:
9206  ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
9207
9208  template <typename T>
9209  operator ParamGenerator<T>() const {
9210    const T array[] = {v1_, v2_};
9211    return ValuesIn(array);
9212  }
9213
9214 private:
9215  // No implementation - assignment is unsupported.
9216  void operator=(const ValueArray2& other);
9217
9218  const T1 v1_;
9219  const T2 v2_;
9220};
9221
9222template <typename T1, typename T2, typename T3>
9223class ValueArray3 {
9224 public:
9225  ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
9226
9227  template <typename T>
9228  operator ParamGenerator<T>() const {
9229    const T array[] = {v1_, v2_, v3_};
9230    return ValuesIn(array);
9231  }
9232
9233 private:
9234  // No implementation - assignment is unsupported.
9235  void operator=(const ValueArray3& other);
9236
9237  const T1 v1_;
9238  const T2 v2_;
9239  const T3 v3_;
9240};
9241
9242template <typename T1, typename T2, typename T3, typename T4>
9243class ValueArray4 {
9244 public:
9245  ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
9246      v4_(v4) {}
9247
9248  template <typename T>
9249  operator ParamGenerator<T>() const {
9250    const T array[] = {v1_, v2_, v3_, v4_};
9251    return ValuesIn(array);
9252  }
9253
9254 private:
9255  // No implementation - assignment is unsupported.
9256  void operator=(const ValueArray4& other);
9257
9258  const T1 v1_;
9259  const T2 v2_;
9260  const T3 v3_;
9261  const T4 v4_;
9262};
9263
9264template <typename T1, typename T2, typename T3, typename T4, typename T5>
9265class ValueArray5 {
9266 public:
9267  ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
9268      v4_(v4), v5_(v5) {}
9269
9270  template <typename T>
9271  operator ParamGenerator<T>() const {
9272    const T array[] = {v1_, v2_, v3_, v4_, v5_};
9273    return ValuesIn(array);
9274  }
9275
9276 private:
9277  // No implementation - assignment is unsupported.
9278  void operator=(const ValueArray5& other);
9279
9280  const T1 v1_;
9281  const T2 v2_;
9282  const T3 v3_;
9283  const T4 v4_;
9284  const T5 v5_;
9285};
9286
9287template <typename T1, typename T2, typename T3, typename T4, typename T5,
9288    typename T6>
9289class ValueArray6 {
9290 public:
9291  ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
9292      v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
9293
9294  template <typename T>
9295  operator ParamGenerator<T>() const {
9296    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_};
9297    return ValuesIn(array);
9298  }
9299
9300 private:
9301  // No implementation - assignment is unsupported.
9302  void operator=(const ValueArray6& other);
9303
9304  const T1 v1_;
9305  const T2 v2_;
9306  const T3 v3_;
9307  const T4 v4_;
9308  const T5 v5_;
9309  const T6 v6_;
9310};
9311
9312template <typename T1, typename T2, typename T3, typename T4, typename T5,
9313    typename T6, typename T7>
9314class ValueArray7 {
9315 public:
9316  ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
9317      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
9318
9319  template <typename T>
9320  operator ParamGenerator<T>() const {
9321    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_};
9322    return ValuesIn(array);
9323  }
9324
9325 private:
9326  // No implementation - assignment is unsupported.
9327  void operator=(const ValueArray7& other);
9328
9329  const T1 v1_;
9330  const T2 v2_;
9331  const T3 v3_;
9332  const T4 v4_;
9333  const T5 v5_;
9334  const T6 v6_;
9335  const T7 v7_;
9336};
9337
9338template <typename T1, typename T2, typename T3, typename T4, typename T5,
9339    typename T6, typename T7, typename T8>
9340class ValueArray8 {
9341 public:
9342  ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
9343      T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
9344      v8_(v8) {}
9345
9346  template <typename T>
9347  operator ParamGenerator<T>() const {
9348    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_};
9349    return ValuesIn(array);
9350  }
9351
9352 private:
9353  // No implementation - assignment is unsupported.
9354  void operator=(const ValueArray8& other);
9355
9356  const T1 v1_;
9357  const T2 v2_;
9358  const T3 v3_;
9359  const T4 v4_;
9360  const T5 v5_;
9361  const T6 v6_;
9362  const T7 v7_;
9363  const T8 v8_;
9364};
9365
9366template <typename T1, typename T2, typename T3, typename T4, typename T5,
9367    typename T6, typename T7, typename T8, typename T9>
9368class ValueArray9 {
9369 public:
9370  ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
9371      T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
9372      v8_(v8), v9_(v9) {}
9373
9374  template <typename T>
9375  operator ParamGenerator<T>() const {
9376    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_};
9377    return ValuesIn(array);
9378  }
9379
9380 private:
9381  // No implementation - assignment is unsupported.
9382  void operator=(const ValueArray9& other);
9383
9384  const T1 v1_;
9385  const T2 v2_;
9386  const T3 v3_;
9387  const T4 v4_;
9388  const T5 v5_;
9389  const T6 v6_;
9390  const T7 v7_;
9391  const T8 v8_;
9392  const T9 v9_;
9393};
9394
9395template <typename T1, typename T2, typename T3, typename T4, typename T5,
9396    typename T6, typename T7, typename T8, typename T9, typename T10>
9397class ValueArray10 {
9398 public:
9399  ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9400      T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
9401      v8_(v8), v9_(v9), v10_(v10) {}
9402
9403  template <typename T>
9404  operator ParamGenerator<T>() const {
9405    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_};
9406    return ValuesIn(array);
9407  }
9408
9409 private:
9410  // No implementation - assignment is unsupported.
9411  void operator=(const ValueArray10& other);
9412
9413  const T1 v1_;
9414  const T2 v2_;
9415  const T3 v3_;
9416  const T4 v4_;
9417  const T5 v5_;
9418  const T6 v6_;
9419  const T7 v7_;
9420  const T8 v8_;
9421  const T9 v9_;
9422  const T10 v10_;
9423};
9424
9425template <typename T1, typename T2, typename T3, typename T4, typename T5,
9426    typename T6, typename T7, typename T8, typename T9, typename T10,
9427    typename T11>
9428class ValueArray11 {
9429 public:
9430  ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9431      T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
9432      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
9433
9434  template <typename T>
9435  operator ParamGenerator<T>() const {
9436    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_};
9437    return ValuesIn(array);
9438  }
9439
9440 private:
9441  // No implementation - assignment is unsupported.
9442  void operator=(const ValueArray11& other);
9443
9444  const T1 v1_;
9445  const T2 v2_;
9446  const T3 v3_;
9447  const T4 v4_;
9448  const T5 v5_;
9449  const T6 v6_;
9450  const T7 v7_;
9451  const T8 v8_;
9452  const T9 v9_;
9453  const T10 v10_;
9454  const T11 v11_;
9455};
9456
9457template <typename T1, typename T2, typename T3, typename T4, typename T5,
9458    typename T6, typename T7, typename T8, typename T9, typename T10,
9459    typename T11, typename T12>
9460class ValueArray12 {
9461 public:
9462  ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9463      T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
9464      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
9465
9466  template <typename T>
9467  operator ParamGenerator<T>() const {
9468    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9469        v12_};
9470    return ValuesIn(array);
9471  }
9472
9473 private:
9474  // No implementation - assignment is unsupported.
9475  void operator=(const ValueArray12& other);
9476
9477  const T1 v1_;
9478  const T2 v2_;
9479  const T3 v3_;
9480  const T4 v4_;
9481  const T5 v5_;
9482  const T6 v6_;
9483  const T7 v7_;
9484  const T8 v8_;
9485  const T9 v9_;
9486  const T10 v10_;
9487  const T11 v11_;
9488  const T12 v12_;
9489};
9490
9491template <typename T1, typename T2, typename T3, typename T4, typename T5,
9492    typename T6, typename T7, typename T8, typename T9, typename T10,
9493    typename T11, typename T12, typename T13>
9494class ValueArray13 {
9495 public:
9496  ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9497      T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
9498      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
9499      v12_(v12), v13_(v13) {}
9500
9501  template <typename T>
9502  operator ParamGenerator<T>() const {
9503    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9504        v12_, v13_};
9505    return ValuesIn(array);
9506  }
9507
9508 private:
9509  // No implementation - assignment is unsupported.
9510  void operator=(const ValueArray13& other);
9511
9512  const T1 v1_;
9513  const T2 v2_;
9514  const T3 v3_;
9515  const T4 v4_;
9516  const T5 v5_;
9517  const T6 v6_;
9518  const T7 v7_;
9519  const T8 v8_;
9520  const T9 v9_;
9521  const T10 v10_;
9522  const T11 v11_;
9523  const T12 v12_;
9524  const T13 v13_;
9525};
9526
9527template <typename T1, typename T2, typename T3, typename T4, typename T5,
9528    typename T6, typename T7, typename T8, typename T9, typename T10,
9529    typename T11, typename T12, typename T13, typename T14>
9530class ValueArray14 {
9531 public:
9532  ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9533      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
9534      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
9535      v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
9536
9537  template <typename T>
9538  operator ParamGenerator<T>() const {
9539    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9540        v12_, v13_, v14_};
9541    return ValuesIn(array);
9542  }
9543
9544 private:
9545  // No implementation - assignment is unsupported.
9546  void operator=(const ValueArray14& other);
9547
9548  const T1 v1_;
9549  const T2 v2_;
9550  const T3 v3_;
9551  const T4 v4_;
9552  const T5 v5_;
9553  const T6 v6_;
9554  const T7 v7_;
9555  const T8 v8_;
9556  const T9 v9_;
9557  const T10 v10_;
9558  const T11 v11_;
9559  const T12 v12_;
9560  const T13 v13_;
9561  const T14 v14_;
9562};
9563
9564template <typename T1, typename T2, typename T3, typename T4, typename T5,
9565    typename T6, typename T7, typename T8, typename T9, typename T10,
9566    typename T11, typename T12, typename T13, typename T14, typename T15>
9567class ValueArray15 {
9568 public:
9569  ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9570      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
9571      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
9572      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
9573
9574  template <typename T>
9575  operator ParamGenerator<T>() const {
9576    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9577        v12_, v13_, v14_, v15_};
9578    return ValuesIn(array);
9579  }
9580
9581 private:
9582  // No implementation - assignment is unsupported.
9583  void operator=(const ValueArray15& other);
9584
9585  const T1 v1_;
9586  const T2 v2_;
9587  const T3 v3_;
9588  const T4 v4_;
9589  const T5 v5_;
9590  const T6 v6_;
9591  const T7 v7_;
9592  const T8 v8_;
9593  const T9 v9_;
9594  const T10 v10_;
9595  const T11 v11_;
9596  const T12 v12_;
9597  const T13 v13_;
9598  const T14 v14_;
9599  const T15 v15_;
9600};
9601
9602template <typename T1, typename T2, typename T3, typename T4, typename T5,
9603    typename T6, typename T7, typename T8, typename T9, typename T10,
9604    typename T11, typename T12, typename T13, typename T14, typename T15,
9605    typename T16>
9606class ValueArray16 {
9607 public:
9608  ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9609      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
9610      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
9611      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
9612      v16_(v16) {}
9613
9614  template <typename T>
9615  operator ParamGenerator<T>() const {
9616    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9617        v12_, v13_, v14_, v15_, v16_};
9618    return ValuesIn(array);
9619  }
9620
9621 private:
9622  // No implementation - assignment is unsupported.
9623  void operator=(const ValueArray16& other);
9624
9625  const T1 v1_;
9626  const T2 v2_;
9627  const T3 v3_;
9628  const T4 v4_;
9629  const T5 v5_;
9630  const T6 v6_;
9631  const T7 v7_;
9632  const T8 v8_;
9633  const T9 v9_;
9634  const T10 v10_;
9635  const T11 v11_;
9636  const T12 v12_;
9637  const T13 v13_;
9638  const T14 v14_;
9639  const T15 v15_;
9640  const T16 v16_;
9641};
9642
9643template <typename T1, typename T2, typename T3, typename T4, typename T5,
9644    typename T6, typename T7, typename T8, typename T9, typename T10,
9645    typename T11, typename T12, typename T13, typename T14, typename T15,
9646    typename T16, typename T17>
9647class ValueArray17 {
9648 public:
9649  ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9650      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
9651      T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
9652      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
9653      v15_(v15), v16_(v16), v17_(v17) {}
9654
9655  template <typename T>
9656  operator ParamGenerator<T>() const {
9657    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9658        v12_, v13_, v14_, v15_, v16_, v17_};
9659    return ValuesIn(array);
9660  }
9661
9662 private:
9663  // No implementation - assignment is unsupported.
9664  void operator=(const ValueArray17& other);
9665
9666  const T1 v1_;
9667  const T2 v2_;
9668  const T3 v3_;
9669  const T4 v4_;
9670  const T5 v5_;
9671  const T6 v6_;
9672  const T7 v7_;
9673  const T8 v8_;
9674  const T9 v9_;
9675  const T10 v10_;
9676  const T11 v11_;
9677  const T12 v12_;
9678  const T13 v13_;
9679  const T14 v14_;
9680  const T15 v15_;
9681  const T16 v16_;
9682  const T17 v17_;
9683};
9684
9685template <typename T1, typename T2, typename T3, typename T4, typename T5,
9686    typename T6, typename T7, typename T8, typename T9, typename T10,
9687    typename T11, typename T12, typename T13, typename T14, typename T15,
9688    typename T16, typename T17, typename T18>
9689class ValueArray18 {
9690 public:
9691  ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9692      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
9693      T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
9694      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
9695      v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
9696
9697  template <typename T>
9698  operator ParamGenerator<T>() const {
9699    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9700        v12_, v13_, v14_, v15_, v16_, v17_, v18_};
9701    return ValuesIn(array);
9702  }
9703
9704 private:
9705  // No implementation - assignment is unsupported.
9706  void operator=(const ValueArray18& other);
9707
9708  const T1 v1_;
9709  const T2 v2_;
9710  const T3 v3_;
9711  const T4 v4_;
9712  const T5 v5_;
9713  const T6 v6_;
9714  const T7 v7_;
9715  const T8 v8_;
9716  const T9 v9_;
9717  const T10 v10_;
9718  const T11 v11_;
9719  const T12 v12_;
9720  const T13 v13_;
9721  const T14 v14_;
9722  const T15 v15_;
9723  const T16 v16_;
9724  const T17 v17_;
9725  const T18 v18_;
9726};
9727
9728template <typename T1, typename T2, typename T3, typename T4, typename T5,
9729    typename T6, typename T7, typename T8, typename T9, typename T10,
9730    typename T11, typename T12, typename T13, typename T14, typename T15,
9731    typename T16, typename T17, typename T18, typename T19>
9732class ValueArray19 {
9733 public:
9734  ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9735      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
9736      T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
9737      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
9738      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
9739
9740  template <typename T>
9741  operator ParamGenerator<T>() const {
9742    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9743        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_};
9744    return ValuesIn(array);
9745  }
9746
9747 private:
9748  // No implementation - assignment is unsupported.
9749  void operator=(const ValueArray19& other);
9750
9751  const T1 v1_;
9752  const T2 v2_;
9753  const T3 v3_;
9754  const T4 v4_;
9755  const T5 v5_;
9756  const T6 v6_;
9757  const T7 v7_;
9758  const T8 v8_;
9759  const T9 v9_;
9760  const T10 v10_;
9761  const T11 v11_;
9762  const T12 v12_;
9763  const T13 v13_;
9764  const T14 v14_;
9765  const T15 v15_;
9766  const T16 v16_;
9767  const T17 v17_;
9768  const T18 v18_;
9769  const T19 v19_;
9770};
9771
9772template <typename T1, typename T2, typename T3, typename T4, typename T5,
9773    typename T6, typename T7, typename T8, typename T9, typename T10,
9774    typename T11, typename T12, typename T13, typename T14, typename T15,
9775    typename T16, typename T17, typename T18, typename T19, typename T20>
9776class ValueArray20 {
9777 public:
9778  ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9779      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
9780      T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
9781      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
9782      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
9783      v19_(v19), v20_(v20) {}
9784
9785  template <typename T>
9786  operator ParamGenerator<T>() const {
9787    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9788        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_};
9789    return ValuesIn(array);
9790  }
9791
9792 private:
9793  // No implementation - assignment is unsupported.
9794  void operator=(const ValueArray20& other);
9795
9796  const T1 v1_;
9797  const T2 v2_;
9798  const T3 v3_;
9799  const T4 v4_;
9800  const T5 v5_;
9801  const T6 v6_;
9802  const T7 v7_;
9803  const T8 v8_;
9804  const T9 v9_;
9805  const T10 v10_;
9806  const T11 v11_;
9807  const T12 v12_;
9808  const T13 v13_;
9809  const T14 v14_;
9810  const T15 v15_;
9811  const T16 v16_;
9812  const T17 v17_;
9813  const T18 v18_;
9814  const T19 v19_;
9815  const T20 v20_;
9816};
9817
9818template <typename T1, typename T2, typename T3, typename T4, typename T5,
9819    typename T6, typename T7, typename T8, typename T9, typename T10,
9820    typename T11, typename T12, typename T13, typename T14, typename T15,
9821    typename T16, typename T17, typename T18, typename T19, typename T20,
9822    typename T21>
9823class ValueArray21 {
9824 public:
9825  ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9826      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
9827      T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
9828      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
9829      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
9830      v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
9831
9832  template <typename T>
9833  operator ParamGenerator<T>() const {
9834    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9835        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_};
9836    return ValuesIn(array);
9837  }
9838
9839 private:
9840  // No implementation - assignment is unsupported.
9841  void operator=(const ValueArray21& other);
9842
9843  const T1 v1_;
9844  const T2 v2_;
9845  const T3 v3_;
9846  const T4 v4_;
9847  const T5 v5_;
9848  const T6 v6_;
9849  const T7 v7_;
9850  const T8 v8_;
9851  const T9 v9_;
9852  const T10 v10_;
9853  const T11 v11_;
9854  const T12 v12_;
9855  const T13 v13_;
9856  const T14 v14_;
9857  const T15 v15_;
9858  const T16 v16_;
9859  const T17 v17_;
9860  const T18 v18_;
9861  const T19 v19_;
9862  const T20 v20_;
9863  const T21 v21_;
9864};
9865
9866template <typename T1, typename T2, typename T3, typename T4, typename T5,
9867    typename T6, typename T7, typename T8, typename T9, typename T10,
9868    typename T11, typename T12, typename T13, typename T14, typename T15,
9869    typename T16, typename T17, typename T18, typename T19, typename T20,
9870    typename T21, typename T22>
9871class ValueArray22 {
9872 public:
9873  ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9874      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
9875      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
9876      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
9877      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
9878      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
9879
9880  template <typename T>
9881  operator ParamGenerator<T>() const {
9882    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9883        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_};
9884    return ValuesIn(array);
9885  }
9886
9887 private:
9888  // No implementation - assignment is unsupported.
9889  void operator=(const ValueArray22& other);
9890
9891  const T1 v1_;
9892  const T2 v2_;
9893  const T3 v3_;
9894  const T4 v4_;
9895  const T5 v5_;
9896  const T6 v6_;
9897  const T7 v7_;
9898  const T8 v8_;
9899  const T9 v9_;
9900  const T10 v10_;
9901  const T11 v11_;
9902  const T12 v12_;
9903  const T13 v13_;
9904  const T14 v14_;
9905  const T15 v15_;
9906  const T16 v16_;
9907  const T17 v17_;
9908  const T18 v18_;
9909  const T19 v19_;
9910  const T20 v20_;
9911  const T21 v21_;
9912  const T22 v22_;
9913};
9914
9915template <typename T1, typename T2, typename T3, typename T4, typename T5,
9916    typename T6, typename T7, typename T8, typename T9, typename T10,
9917    typename T11, typename T12, typename T13, typename T14, typename T15,
9918    typename T16, typename T17, typename T18, typename T19, typename T20,
9919    typename T21, typename T22, typename T23>
9920class ValueArray23 {
9921 public:
9922  ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9923      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
9924      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
9925      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
9926      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
9927      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
9928      v23_(v23) {}
9929
9930  template <typename T>
9931  operator ParamGenerator<T>() const {
9932    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9933        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_,
9934        v23_};
9935    return ValuesIn(array);
9936  }
9937
9938 private:
9939  // No implementation - assignment is unsupported.
9940  void operator=(const ValueArray23& other);
9941
9942  const T1 v1_;
9943  const T2 v2_;
9944  const T3 v3_;
9945  const T4 v4_;
9946  const T5 v5_;
9947  const T6 v6_;
9948  const T7 v7_;
9949  const T8 v8_;
9950  const T9 v9_;
9951  const T10 v10_;
9952  const T11 v11_;
9953  const T12 v12_;
9954  const T13 v13_;
9955  const T14 v14_;
9956  const T15 v15_;
9957  const T16 v16_;
9958  const T17 v17_;
9959  const T18 v18_;
9960  const T19 v19_;
9961  const T20 v20_;
9962  const T21 v21_;
9963  const T22 v22_;
9964  const T23 v23_;
9965};
9966
9967template <typename T1, typename T2, typename T3, typename T4, typename T5,
9968    typename T6, typename T7, typename T8, typename T9, typename T10,
9969    typename T11, typename T12, typename T13, typename T14, typename T15,
9970    typename T16, typename T17, typename T18, typename T19, typename T20,
9971    typename T21, typename T22, typename T23, typename T24>
9972class ValueArray24 {
9973 public:
9974  ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
9975      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
9976      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
9977      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
9978      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
9979      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
9980      v22_(v22), v23_(v23), v24_(v24) {}
9981
9982  template <typename T>
9983  operator ParamGenerator<T>() const {
9984    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
9985        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
9986        v24_};
9987    return ValuesIn(array);
9988  }
9989
9990 private:
9991  // No implementation - assignment is unsupported.
9992  void operator=(const ValueArray24& other);
9993
9994  const T1 v1_;
9995  const T2 v2_;
9996  const T3 v3_;
9997  const T4 v4_;
9998  const T5 v5_;
9999  const T6 v6_;
10000  const T7 v7_;
10001  const T8 v8_;
10002  const T9 v9_;
10003  const T10 v10_;
10004  const T11 v11_;
10005  const T12 v12_;
10006  const T13 v13_;
10007  const T14 v14_;
10008  const T15 v15_;
10009  const T16 v16_;
10010  const T17 v17_;
10011  const T18 v18_;
10012  const T19 v19_;
10013  const T20 v20_;
10014  const T21 v21_;
10015  const T22 v22_;
10016  const T23 v23_;
10017  const T24 v24_;
10018};
10019
10020template <typename T1, typename T2, typename T3, typename T4, typename T5,
10021    typename T6, typename T7, typename T8, typename T9, typename T10,
10022    typename T11, typename T12, typename T13, typename T14, typename T15,
10023    typename T16, typename T17, typename T18, typename T19, typename T20,
10024    typename T21, typename T22, typename T23, typename T24, typename T25>
10025class ValueArray25 {
10026 public:
10027  ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10028      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10029      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
10030      T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10031      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
10032      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
10033      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
10034
10035  template <typename T>
10036  operator ParamGenerator<T>() const {
10037    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10038        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10039        v24_, v25_};
10040    return ValuesIn(array);
10041  }
10042
10043 private:
10044  // No implementation - assignment is unsupported.
10045  void operator=(const ValueArray25& other);
10046
10047  const T1 v1_;
10048  const T2 v2_;
10049  const T3 v3_;
10050  const T4 v4_;
10051  const T5 v5_;
10052  const T6 v6_;
10053  const T7 v7_;
10054  const T8 v8_;
10055  const T9 v9_;
10056  const T10 v10_;
10057  const T11 v11_;
10058  const T12 v12_;
10059  const T13 v13_;
10060  const T14 v14_;
10061  const T15 v15_;
10062  const T16 v16_;
10063  const T17 v17_;
10064  const T18 v18_;
10065  const T19 v19_;
10066  const T20 v20_;
10067  const T21 v21_;
10068  const T22 v22_;
10069  const T23 v23_;
10070  const T24 v24_;
10071  const T25 v25_;
10072};
10073
10074template <typename T1, typename T2, typename T3, typename T4, typename T5,
10075    typename T6, typename T7, typename T8, typename T9, typename T10,
10076    typename T11, typename T12, typename T13, typename T14, typename T15,
10077    typename T16, typename T17, typename T18, typename T19, typename T20,
10078    typename T21, typename T22, typename T23, typename T24, typename T25,
10079    typename T26>
10080class ValueArray26 {
10081 public:
10082  ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10083      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10084      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10085      T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10086      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
10087      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
10088      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
10089
10090  template <typename T>
10091  operator ParamGenerator<T>() const {
10092    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10093        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10094        v24_, v25_, v26_};
10095    return ValuesIn(array);
10096  }
10097
10098 private:
10099  // No implementation - assignment is unsupported.
10100  void operator=(const ValueArray26& other);
10101
10102  const T1 v1_;
10103  const T2 v2_;
10104  const T3 v3_;
10105  const T4 v4_;
10106  const T5 v5_;
10107  const T6 v6_;
10108  const T7 v7_;
10109  const T8 v8_;
10110  const T9 v9_;
10111  const T10 v10_;
10112  const T11 v11_;
10113  const T12 v12_;
10114  const T13 v13_;
10115  const T14 v14_;
10116  const T15 v15_;
10117  const T16 v16_;
10118  const T17 v17_;
10119  const T18 v18_;
10120  const T19 v19_;
10121  const T20 v20_;
10122  const T21 v21_;
10123  const T22 v22_;
10124  const T23 v23_;
10125  const T24 v24_;
10126  const T25 v25_;
10127  const T26 v26_;
10128};
10129
10130template <typename T1, typename T2, typename T3, typename T4, typename T5,
10131    typename T6, typename T7, typename T8, typename T9, typename T10,
10132    typename T11, typename T12, typename T13, typename T14, typename T15,
10133    typename T16, typename T17, typename T18, typename T19, typename T20,
10134    typename T21, typename T22, typename T23, typename T24, typename T25,
10135    typename T26, typename T27>
10136class ValueArray27 {
10137 public:
10138  ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10139      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10140      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10141      T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
10142      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
10143      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
10144      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
10145      v26_(v26), v27_(v27) {}
10146
10147  template <typename T>
10148  operator ParamGenerator<T>() const {
10149    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10150        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10151        v24_, v25_, v26_, v27_};
10152    return ValuesIn(array);
10153  }
10154
10155 private:
10156  // No implementation - assignment is unsupported.
10157  void operator=(const ValueArray27& other);
10158
10159  const T1 v1_;
10160  const T2 v2_;
10161  const T3 v3_;
10162  const T4 v4_;
10163  const T5 v5_;
10164  const T6 v6_;
10165  const T7 v7_;
10166  const T8 v8_;
10167  const T9 v9_;
10168  const T10 v10_;
10169  const T11 v11_;
10170  const T12 v12_;
10171  const T13 v13_;
10172  const T14 v14_;
10173  const T15 v15_;
10174  const T16 v16_;
10175  const T17 v17_;
10176  const T18 v18_;
10177  const T19 v19_;
10178  const T20 v20_;
10179  const T21 v21_;
10180  const T22 v22_;
10181  const T23 v23_;
10182  const T24 v24_;
10183  const T25 v25_;
10184  const T26 v26_;
10185  const T27 v27_;
10186};
10187
10188template <typename T1, typename T2, typename T3, typename T4, typename T5,
10189    typename T6, typename T7, typename T8, typename T9, typename T10,
10190    typename T11, typename T12, typename T13, typename T14, typename T15,
10191    typename T16, typename T17, typename T18, typename T19, typename T20,
10192    typename T21, typename T22, typename T23, typename T24, typename T25,
10193    typename T26, typename T27, typename T28>
10194class ValueArray28 {
10195 public:
10196  ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10197      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10198      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10199      T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
10200      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
10201      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
10202      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
10203      v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
10204
10205  template <typename T>
10206  operator ParamGenerator<T>() const {
10207    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10208        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10209        v24_, v25_, v26_, v27_, v28_};
10210    return ValuesIn(array);
10211  }
10212
10213 private:
10214  // No implementation - assignment is unsupported.
10215  void operator=(const ValueArray28& other);
10216
10217  const T1 v1_;
10218  const T2 v2_;
10219  const T3 v3_;
10220  const T4 v4_;
10221  const T5 v5_;
10222  const T6 v6_;
10223  const T7 v7_;
10224  const T8 v8_;
10225  const T9 v9_;
10226  const T10 v10_;
10227  const T11 v11_;
10228  const T12 v12_;
10229  const T13 v13_;
10230  const T14 v14_;
10231  const T15 v15_;
10232  const T16 v16_;
10233  const T17 v17_;
10234  const T18 v18_;
10235  const T19 v19_;
10236  const T20 v20_;
10237  const T21 v21_;
10238  const T22 v22_;
10239  const T23 v23_;
10240  const T24 v24_;
10241  const T25 v25_;
10242  const T26 v26_;
10243  const T27 v27_;
10244  const T28 v28_;
10245};
10246
10247template <typename T1, typename T2, typename T3, typename T4, typename T5,
10248    typename T6, typename T7, typename T8, typename T9, typename T10,
10249    typename T11, typename T12, typename T13, typename T14, typename T15,
10250    typename T16, typename T17, typename T18, typename T19, typename T20,
10251    typename T21, typename T22, typename T23, typename T24, typename T25,
10252    typename T26, typename T27, typename T28, typename T29>
10253class ValueArray29 {
10254 public:
10255  ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10256      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10257      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10258      T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
10259      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
10260      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
10261      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
10262      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
10263
10264  template <typename T>
10265  operator ParamGenerator<T>() const {
10266    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10267        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10268        v24_, v25_, v26_, v27_, v28_, v29_};
10269    return ValuesIn(array);
10270  }
10271
10272 private:
10273  // No implementation - assignment is unsupported.
10274  void operator=(const ValueArray29& other);
10275
10276  const T1 v1_;
10277  const T2 v2_;
10278  const T3 v3_;
10279  const T4 v4_;
10280  const T5 v5_;
10281  const T6 v6_;
10282  const T7 v7_;
10283  const T8 v8_;
10284  const T9 v9_;
10285  const T10 v10_;
10286  const T11 v11_;
10287  const T12 v12_;
10288  const T13 v13_;
10289  const T14 v14_;
10290  const T15 v15_;
10291  const T16 v16_;
10292  const T17 v17_;
10293  const T18 v18_;
10294  const T19 v19_;
10295  const T20 v20_;
10296  const T21 v21_;
10297  const T22 v22_;
10298  const T23 v23_;
10299  const T24 v24_;
10300  const T25 v25_;
10301  const T26 v26_;
10302  const T27 v27_;
10303  const T28 v28_;
10304  const T29 v29_;
10305};
10306
10307template <typename T1, typename T2, typename T3, typename T4, typename T5,
10308    typename T6, typename T7, typename T8, typename T9, typename T10,
10309    typename T11, typename T12, typename T13, typename T14, typename T15,
10310    typename T16, typename T17, typename T18, typename T19, typename T20,
10311    typename T21, typename T22, typename T23, typename T24, typename T25,
10312    typename T26, typename T27, typename T28, typename T29, typename T30>
10313class ValueArray30 {
10314 public:
10315  ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10316      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10317      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10318      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
10319      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
10320      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
10321      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
10322      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
10323      v29_(v29), v30_(v30) {}
10324
10325  template <typename T>
10326  operator ParamGenerator<T>() const {
10327    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10328        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10329        v24_, v25_, v26_, v27_, v28_, v29_, v30_};
10330    return ValuesIn(array);
10331  }
10332
10333 private:
10334  // No implementation - assignment is unsupported.
10335  void operator=(const ValueArray30& other);
10336
10337  const T1 v1_;
10338  const T2 v2_;
10339  const T3 v3_;
10340  const T4 v4_;
10341  const T5 v5_;
10342  const T6 v6_;
10343  const T7 v7_;
10344  const T8 v8_;
10345  const T9 v9_;
10346  const T10 v10_;
10347  const T11 v11_;
10348  const T12 v12_;
10349  const T13 v13_;
10350  const T14 v14_;
10351  const T15 v15_;
10352  const T16 v16_;
10353  const T17 v17_;
10354  const T18 v18_;
10355  const T19 v19_;
10356  const T20 v20_;
10357  const T21 v21_;
10358  const T22 v22_;
10359  const T23 v23_;
10360  const T24 v24_;
10361  const T25 v25_;
10362  const T26 v26_;
10363  const T27 v27_;
10364  const T28 v28_;
10365  const T29 v29_;
10366  const T30 v30_;
10367};
10368
10369template <typename T1, typename T2, typename T3, typename T4, typename T5,
10370    typename T6, typename T7, typename T8, typename T9, typename T10,
10371    typename T11, typename T12, typename T13, typename T14, typename T15,
10372    typename T16, typename T17, typename T18, typename T19, typename T20,
10373    typename T21, typename T22, typename T23, typename T24, typename T25,
10374    typename T26, typename T27, typename T28, typename T29, typename T30,
10375    typename T31>
10376class ValueArray31 {
10377 public:
10378  ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10379      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10380      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10381      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
10382      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
10383      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
10384      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
10385      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
10386      v29_(v29), v30_(v30), v31_(v31) {}
10387
10388  template <typename T>
10389  operator ParamGenerator<T>() const {
10390    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10391        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10392        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_};
10393    return ValuesIn(array);
10394  }
10395
10396 private:
10397  // No implementation - assignment is unsupported.
10398  void operator=(const ValueArray31& other);
10399
10400  const T1 v1_;
10401  const T2 v2_;
10402  const T3 v3_;
10403  const T4 v4_;
10404  const T5 v5_;
10405  const T6 v6_;
10406  const T7 v7_;
10407  const T8 v8_;
10408  const T9 v9_;
10409  const T10 v10_;
10410  const T11 v11_;
10411  const T12 v12_;
10412  const T13 v13_;
10413  const T14 v14_;
10414  const T15 v15_;
10415  const T16 v16_;
10416  const T17 v17_;
10417  const T18 v18_;
10418  const T19 v19_;
10419  const T20 v20_;
10420  const T21 v21_;
10421  const T22 v22_;
10422  const T23 v23_;
10423  const T24 v24_;
10424  const T25 v25_;
10425  const T26 v26_;
10426  const T27 v27_;
10427  const T28 v28_;
10428  const T29 v29_;
10429  const T30 v30_;
10430  const T31 v31_;
10431};
10432
10433template <typename T1, typename T2, typename T3, typename T4, typename T5,
10434    typename T6, typename T7, typename T8, typename T9, typename T10,
10435    typename T11, typename T12, typename T13, typename T14, typename T15,
10436    typename T16, typename T17, typename T18, typename T19, typename T20,
10437    typename T21, typename T22, typename T23, typename T24, typename T25,
10438    typename T26, typename T27, typename T28, typename T29, typename T30,
10439    typename T31, typename T32>
10440class ValueArray32 {
10441 public:
10442  ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10443      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10444      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10445      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
10446      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
10447      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
10448      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
10449      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
10450      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
10451
10452  template <typename T>
10453  operator ParamGenerator<T>() const {
10454    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10455        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10456        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_};
10457    return ValuesIn(array);
10458  }
10459
10460 private:
10461  // No implementation - assignment is unsupported.
10462  void operator=(const ValueArray32& other);
10463
10464  const T1 v1_;
10465  const T2 v2_;
10466  const T3 v3_;
10467  const T4 v4_;
10468  const T5 v5_;
10469  const T6 v6_;
10470  const T7 v7_;
10471  const T8 v8_;
10472  const T9 v9_;
10473  const T10 v10_;
10474  const T11 v11_;
10475  const T12 v12_;
10476  const T13 v13_;
10477  const T14 v14_;
10478  const T15 v15_;
10479  const T16 v16_;
10480  const T17 v17_;
10481  const T18 v18_;
10482  const T19 v19_;
10483  const T20 v20_;
10484  const T21 v21_;
10485  const T22 v22_;
10486  const T23 v23_;
10487  const T24 v24_;
10488  const T25 v25_;
10489  const T26 v26_;
10490  const T27 v27_;
10491  const T28 v28_;
10492  const T29 v29_;
10493  const T30 v30_;
10494  const T31 v31_;
10495  const T32 v32_;
10496};
10497
10498template <typename T1, typename T2, typename T3, typename T4, typename T5,
10499    typename T6, typename T7, typename T8, typename T9, typename T10,
10500    typename T11, typename T12, typename T13, typename T14, typename T15,
10501    typename T16, typename T17, typename T18, typename T19, typename T20,
10502    typename T21, typename T22, typename T23, typename T24, typename T25,
10503    typename T26, typename T27, typename T28, typename T29, typename T30,
10504    typename T31, typename T32, typename T33>
10505class ValueArray33 {
10506 public:
10507  ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10508      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10509      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10510      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
10511      T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10512      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
10513      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
10514      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
10515      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
10516      v33_(v33) {}
10517
10518  template <typename T>
10519  operator ParamGenerator<T>() const {
10520    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10521        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10522        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_};
10523    return ValuesIn(array);
10524  }
10525
10526 private:
10527  // No implementation - assignment is unsupported.
10528  void operator=(const ValueArray33& other);
10529
10530  const T1 v1_;
10531  const T2 v2_;
10532  const T3 v3_;
10533  const T4 v4_;
10534  const T5 v5_;
10535  const T6 v6_;
10536  const T7 v7_;
10537  const T8 v8_;
10538  const T9 v9_;
10539  const T10 v10_;
10540  const T11 v11_;
10541  const T12 v12_;
10542  const T13 v13_;
10543  const T14 v14_;
10544  const T15 v15_;
10545  const T16 v16_;
10546  const T17 v17_;
10547  const T18 v18_;
10548  const T19 v19_;
10549  const T20 v20_;
10550  const T21 v21_;
10551  const T22 v22_;
10552  const T23 v23_;
10553  const T24 v24_;
10554  const T25 v25_;
10555  const T26 v26_;
10556  const T27 v27_;
10557  const T28 v28_;
10558  const T29 v29_;
10559  const T30 v30_;
10560  const T31 v31_;
10561  const T32 v32_;
10562  const T33 v33_;
10563};
10564
10565template <typename T1, typename T2, typename T3, typename T4, typename T5,
10566    typename T6, typename T7, typename T8, typename T9, typename T10,
10567    typename T11, typename T12, typename T13, typename T14, typename T15,
10568    typename T16, typename T17, typename T18, typename T19, typename T20,
10569    typename T21, typename T22, typename T23, typename T24, typename T25,
10570    typename T26, typename T27, typename T28, typename T29, typename T30,
10571    typename T31, typename T32, typename T33, typename T34>
10572class ValueArray34 {
10573 public:
10574  ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10575      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10576      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10577      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
10578      T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10579      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
10580      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
10581      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
10582      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
10583      v33_(v33), v34_(v34) {}
10584
10585  template <typename T>
10586  operator ParamGenerator<T>() const {
10587    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10588        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10589        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_};
10590    return ValuesIn(array);
10591  }
10592
10593 private:
10594  // No implementation - assignment is unsupported.
10595  void operator=(const ValueArray34& other);
10596
10597  const T1 v1_;
10598  const T2 v2_;
10599  const T3 v3_;
10600  const T4 v4_;
10601  const T5 v5_;
10602  const T6 v6_;
10603  const T7 v7_;
10604  const T8 v8_;
10605  const T9 v9_;
10606  const T10 v10_;
10607  const T11 v11_;
10608  const T12 v12_;
10609  const T13 v13_;
10610  const T14 v14_;
10611  const T15 v15_;
10612  const T16 v16_;
10613  const T17 v17_;
10614  const T18 v18_;
10615  const T19 v19_;
10616  const T20 v20_;
10617  const T21 v21_;
10618  const T22 v22_;
10619  const T23 v23_;
10620  const T24 v24_;
10621  const T25 v25_;
10622  const T26 v26_;
10623  const T27 v27_;
10624  const T28 v28_;
10625  const T29 v29_;
10626  const T30 v30_;
10627  const T31 v31_;
10628  const T32 v32_;
10629  const T33 v33_;
10630  const T34 v34_;
10631};
10632
10633template <typename T1, typename T2, typename T3, typename T4, typename T5,
10634    typename T6, typename T7, typename T8, typename T9, typename T10,
10635    typename T11, typename T12, typename T13, typename T14, typename T15,
10636    typename T16, typename T17, typename T18, typename T19, typename T20,
10637    typename T21, typename T22, typename T23, typename T24, typename T25,
10638    typename T26, typename T27, typename T28, typename T29, typename T30,
10639    typename T31, typename T32, typename T33, typename T34, typename T35>
10640class ValueArray35 {
10641 public:
10642  ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10643      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10644      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10645      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
10646      T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
10647      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
10648      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
10649      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
10650      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
10651      v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
10652
10653  template <typename T>
10654  operator ParamGenerator<T>() const {
10655    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10656        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10657        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_,
10658        v35_};
10659    return ValuesIn(array);
10660  }
10661
10662 private:
10663  // No implementation - assignment is unsupported.
10664  void operator=(const ValueArray35& other);
10665
10666  const T1 v1_;
10667  const T2 v2_;
10668  const T3 v3_;
10669  const T4 v4_;
10670  const T5 v5_;
10671  const T6 v6_;
10672  const T7 v7_;
10673  const T8 v8_;
10674  const T9 v9_;
10675  const T10 v10_;
10676  const T11 v11_;
10677  const T12 v12_;
10678  const T13 v13_;
10679  const T14 v14_;
10680  const T15 v15_;
10681  const T16 v16_;
10682  const T17 v17_;
10683  const T18 v18_;
10684  const T19 v19_;
10685  const T20 v20_;
10686  const T21 v21_;
10687  const T22 v22_;
10688  const T23 v23_;
10689  const T24 v24_;
10690  const T25 v25_;
10691  const T26 v26_;
10692  const T27 v27_;
10693  const T28 v28_;
10694  const T29 v29_;
10695  const T30 v30_;
10696  const T31 v31_;
10697  const T32 v32_;
10698  const T33 v33_;
10699  const T34 v34_;
10700  const T35 v35_;
10701};
10702
10703template <typename T1, typename T2, typename T3, typename T4, typename T5,
10704    typename T6, typename T7, typename T8, typename T9, typename T10,
10705    typename T11, typename T12, typename T13, typename T14, typename T15,
10706    typename T16, typename T17, typename T18, typename T19, typename T20,
10707    typename T21, typename T22, typename T23, typename T24, typename T25,
10708    typename T26, typename T27, typename T28, typename T29, typename T30,
10709    typename T31, typename T32, typename T33, typename T34, typename T35,
10710    typename T36>
10711class ValueArray36 {
10712 public:
10713  ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10714      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10715      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10716      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
10717      T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
10718      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
10719      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
10720      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
10721      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
10722      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
10723
10724  template <typename T>
10725  operator ParamGenerator<T>() const {
10726    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10727        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10728        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
10729        v36_};
10730    return ValuesIn(array);
10731  }
10732
10733 private:
10734  // No implementation - assignment is unsupported.
10735  void operator=(const ValueArray36& other);
10736
10737  const T1 v1_;
10738  const T2 v2_;
10739  const T3 v3_;
10740  const T4 v4_;
10741  const T5 v5_;
10742  const T6 v6_;
10743  const T7 v7_;
10744  const T8 v8_;
10745  const T9 v9_;
10746  const T10 v10_;
10747  const T11 v11_;
10748  const T12 v12_;
10749  const T13 v13_;
10750  const T14 v14_;
10751  const T15 v15_;
10752  const T16 v16_;
10753  const T17 v17_;
10754  const T18 v18_;
10755  const T19 v19_;
10756  const T20 v20_;
10757  const T21 v21_;
10758  const T22 v22_;
10759  const T23 v23_;
10760  const T24 v24_;
10761  const T25 v25_;
10762  const T26 v26_;
10763  const T27 v27_;
10764  const T28 v28_;
10765  const T29 v29_;
10766  const T30 v30_;
10767  const T31 v31_;
10768  const T32 v32_;
10769  const T33 v33_;
10770  const T34 v34_;
10771  const T35 v35_;
10772  const T36 v36_;
10773};
10774
10775template <typename T1, typename T2, typename T3, typename T4, typename T5,
10776    typename T6, typename T7, typename T8, typename T9, typename T10,
10777    typename T11, typename T12, typename T13, typename T14, typename T15,
10778    typename T16, typename T17, typename T18, typename T19, typename T20,
10779    typename T21, typename T22, typename T23, typename T24, typename T25,
10780    typename T26, typename T27, typename T28, typename T29, typename T30,
10781    typename T31, typename T32, typename T33, typename T34, typename T35,
10782    typename T36, typename T37>
10783class ValueArray37 {
10784 public:
10785  ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10786      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10787      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10788      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
10789      T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
10790      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
10791      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
10792      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
10793      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
10794      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
10795      v36_(v36), v37_(v37) {}
10796
10797  template <typename T>
10798  operator ParamGenerator<T>() const {
10799    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10800        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10801        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
10802        v36_, v37_};
10803    return ValuesIn(array);
10804  }
10805
10806 private:
10807  // No implementation - assignment is unsupported.
10808  void operator=(const ValueArray37& other);
10809
10810  const T1 v1_;
10811  const T2 v2_;
10812  const T3 v3_;
10813  const T4 v4_;
10814  const T5 v5_;
10815  const T6 v6_;
10816  const T7 v7_;
10817  const T8 v8_;
10818  const T9 v9_;
10819  const T10 v10_;
10820  const T11 v11_;
10821  const T12 v12_;
10822  const T13 v13_;
10823  const T14 v14_;
10824  const T15 v15_;
10825  const T16 v16_;
10826  const T17 v17_;
10827  const T18 v18_;
10828  const T19 v19_;
10829  const T20 v20_;
10830  const T21 v21_;
10831  const T22 v22_;
10832  const T23 v23_;
10833  const T24 v24_;
10834  const T25 v25_;
10835  const T26 v26_;
10836  const T27 v27_;
10837  const T28 v28_;
10838  const T29 v29_;
10839  const T30 v30_;
10840  const T31 v31_;
10841  const T32 v32_;
10842  const T33 v33_;
10843  const T34 v34_;
10844  const T35 v35_;
10845  const T36 v36_;
10846  const T37 v37_;
10847};
10848
10849template <typename T1, typename T2, typename T3, typename T4, typename T5,
10850    typename T6, typename T7, typename T8, typename T9, typename T10,
10851    typename T11, typename T12, typename T13, typename T14, typename T15,
10852    typename T16, typename T17, typename T18, typename T19, typename T20,
10853    typename T21, typename T22, typename T23, typename T24, typename T25,
10854    typename T26, typename T27, typename T28, typename T29, typename T30,
10855    typename T31, typename T32, typename T33, typename T34, typename T35,
10856    typename T36, typename T37, typename T38>
10857class ValueArray38 {
10858 public:
10859  ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10860      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10861      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10862      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
10863      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
10864      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
10865      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
10866      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
10867      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
10868      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
10869      v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
10870
10871  template <typename T>
10872  operator ParamGenerator<T>() const {
10873    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10874        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10875        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
10876        v36_, v37_, v38_};
10877    return ValuesIn(array);
10878  }
10879
10880 private:
10881  // No implementation - assignment is unsupported.
10882  void operator=(const ValueArray38& other);
10883
10884  const T1 v1_;
10885  const T2 v2_;
10886  const T3 v3_;
10887  const T4 v4_;
10888  const T5 v5_;
10889  const T6 v6_;
10890  const T7 v7_;
10891  const T8 v8_;
10892  const T9 v9_;
10893  const T10 v10_;
10894  const T11 v11_;
10895  const T12 v12_;
10896  const T13 v13_;
10897  const T14 v14_;
10898  const T15 v15_;
10899  const T16 v16_;
10900  const T17 v17_;
10901  const T18 v18_;
10902  const T19 v19_;
10903  const T20 v20_;
10904  const T21 v21_;
10905  const T22 v22_;
10906  const T23 v23_;
10907  const T24 v24_;
10908  const T25 v25_;
10909  const T26 v26_;
10910  const T27 v27_;
10911  const T28 v28_;
10912  const T29 v29_;
10913  const T30 v30_;
10914  const T31 v31_;
10915  const T32 v32_;
10916  const T33 v33_;
10917  const T34 v34_;
10918  const T35 v35_;
10919  const T36 v36_;
10920  const T37 v37_;
10921  const T38 v38_;
10922};
10923
10924template <typename T1, typename T2, typename T3, typename T4, typename T5,
10925    typename T6, typename T7, typename T8, typename T9, typename T10,
10926    typename T11, typename T12, typename T13, typename T14, typename T15,
10927    typename T16, typename T17, typename T18, typename T19, typename T20,
10928    typename T21, typename T22, typename T23, typename T24, typename T25,
10929    typename T26, typename T27, typename T28, typename T29, typename T30,
10930    typename T31, typename T32, typename T33, typename T34, typename T35,
10931    typename T36, typename T37, typename T38, typename T39>
10932class ValueArray39 {
10933 public:
10934  ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10935      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
10936      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
10937      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
10938      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
10939      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
10940      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
10941      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
10942      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
10943      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
10944      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
10945
10946  template <typename T>
10947  operator ParamGenerator<T>() const {
10948    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
10949        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
10950        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
10951        v36_, v37_, v38_, v39_};
10952    return ValuesIn(array);
10953  }
10954
10955 private:
10956  // No implementation - assignment is unsupported.
10957  void operator=(const ValueArray39& other);
10958
10959  const T1 v1_;
10960  const T2 v2_;
10961  const T3 v3_;
10962  const T4 v4_;
10963  const T5 v5_;
10964  const T6 v6_;
10965  const T7 v7_;
10966  const T8 v8_;
10967  const T9 v9_;
10968  const T10 v10_;
10969  const T11 v11_;
10970  const T12 v12_;
10971  const T13 v13_;
10972  const T14 v14_;
10973  const T15 v15_;
10974  const T16 v16_;
10975  const T17 v17_;
10976  const T18 v18_;
10977  const T19 v19_;
10978  const T20 v20_;
10979  const T21 v21_;
10980  const T22 v22_;
10981  const T23 v23_;
10982  const T24 v24_;
10983  const T25 v25_;
10984  const T26 v26_;
10985  const T27 v27_;
10986  const T28 v28_;
10987  const T29 v29_;
10988  const T30 v30_;
10989  const T31 v31_;
10990  const T32 v32_;
10991  const T33 v33_;
10992  const T34 v34_;
10993  const T35 v35_;
10994  const T36 v36_;
10995  const T37 v37_;
10996  const T38 v38_;
10997  const T39 v39_;
10998};
10999
11000template <typename T1, typename T2, typename T3, typename T4, typename T5,
11001    typename T6, typename T7, typename T8, typename T9, typename T10,
11002    typename T11, typename T12, typename T13, typename T14, typename T15,
11003    typename T16, typename T17, typename T18, typename T19, typename T20,
11004    typename T21, typename T22, typename T23, typename T24, typename T25,
11005    typename T26, typename T27, typename T28, typename T29, typename T30,
11006    typename T31, typename T32, typename T33, typename T34, typename T35,
11007    typename T36, typename T37, typename T38, typename T39, typename T40>
11008class ValueArray40 {
11009 public:
11010  ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11011      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11012      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11013      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
11014      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
11015      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11016      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11017      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
11018      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
11019      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
11020      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
11021      v40_(v40) {}
11022
11023  template <typename T>
11024  operator ParamGenerator<T>() const {
11025    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11026        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11027        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
11028        v36_, v37_, v38_, v39_, v40_};
11029    return ValuesIn(array);
11030  }
11031
11032 private:
11033  // No implementation - assignment is unsupported.
11034  void operator=(const ValueArray40& other);
11035
11036  const T1 v1_;
11037  const T2 v2_;
11038  const T3 v3_;
11039  const T4 v4_;
11040  const T5 v5_;
11041  const T6 v6_;
11042  const T7 v7_;
11043  const T8 v8_;
11044  const T9 v9_;
11045  const T10 v10_;
11046  const T11 v11_;
11047  const T12 v12_;
11048  const T13 v13_;
11049  const T14 v14_;
11050  const T15 v15_;
11051  const T16 v16_;
11052  const T17 v17_;
11053  const T18 v18_;
11054  const T19 v19_;
11055  const T20 v20_;
11056  const T21 v21_;
11057  const T22 v22_;
11058  const T23 v23_;
11059  const T24 v24_;
11060  const T25 v25_;
11061  const T26 v26_;
11062  const T27 v27_;
11063  const T28 v28_;
11064  const T29 v29_;
11065  const T30 v30_;
11066  const T31 v31_;
11067  const T32 v32_;
11068  const T33 v33_;
11069  const T34 v34_;
11070  const T35 v35_;
11071  const T36 v36_;
11072  const T37 v37_;
11073  const T38 v38_;
11074  const T39 v39_;
11075  const T40 v40_;
11076};
11077
11078template <typename T1, typename T2, typename T3, typename T4, typename T5,
11079    typename T6, typename T7, typename T8, typename T9, typename T10,
11080    typename T11, typename T12, typename T13, typename T14, typename T15,
11081    typename T16, typename T17, typename T18, typename T19, typename T20,
11082    typename T21, typename T22, typename T23, typename T24, typename T25,
11083    typename T26, typename T27, typename T28, typename T29, typename T30,
11084    typename T31, typename T32, typename T33, typename T34, typename T35,
11085    typename T36, typename T37, typename T38, typename T39, typename T40,
11086    typename T41>
11087class ValueArray41 {
11088 public:
11089  ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11090      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11091      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11092      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
11093      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
11094      T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11095      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11096      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11097      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
11098      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
11099      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
11100      v39_(v39), v40_(v40), v41_(v41) {}
11101
11102  template <typename T>
11103  operator ParamGenerator<T>() const {
11104    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11105        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11106        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
11107        v36_, v37_, v38_, v39_, v40_, v41_};
11108    return ValuesIn(array);
11109  }
11110
11111 private:
11112  // No implementation - assignment is unsupported.
11113  void operator=(const ValueArray41& other);
11114
11115  const T1 v1_;
11116  const T2 v2_;
11117  const T3 v3_;
11118  const T4 v4_;
11119  const T5 v5_;
11120  const T6 v6_;
11121  const T7 v7_;
11122  const T8 v8_;
11123  const T9 v9_;
11124  const T10 v10_;
11125  const T11 v11_;
11126  const T12 v12_;
11127  const T13 v13_;
11128  const T14 v14_;
11129  const T15 v15_;
11130  const T16 v16_;
11131  const T17 v17_;
11132  const T18 v18_;
11133  const T19 v19_;
11134  const T20 v20_;
11135  const T21 v21_;
11136  const T22 v22_;
11137  const T23 v23_;
11138  const T24 v24_;
11139  const T25 v25_;
11140  const T26 v26_;
11141  const T27 v27_;
11142  const T28 v28_;
11143  const T29 v29_;
11144  const T30 v30_;
11145  const T31 v31_;
11146  const T32 v32_;
11147  const T33 v33_;
11148  const T34 v34_;
11149  const T35 v35_;
11150  const T36 v36_;
11151  const T37 v37_;
11152  const T38 v38_;
11153  const T39 v39_;
11154  const T40 v40_;
11155  const T41 v41_;
11156};
11157
11158template <typename T1, typename T2, typename T3, typename T4, typename T5,
11159    typename T6, typename T7, typename T8, typename T9, typename T10,
11160    typename T11, typename T12, typename T13, typename T14, typename T15,
11161    typename T16, typename T17, typename T18, typename T19, typename T20,
11162    typename T21, typename T22, typename T23, typename T24, typename T25,
11163    typename T26, typename T27, typename T28, typename T29, typename T30,
11164    typename T31, typename T32, typename T33, typename T34, typename T35,
11165    typename T36, typename T37, typename T38, typename T39, typename T40,
11166    typename T41, typename T42>
11167class ValueArray42 {
11168 public:
11169  ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11170      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11171      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11172      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
11173      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
11174      T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11175      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11176      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11177      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
11178      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
11179      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
11180      v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
11181
11182  template <typename T>
11183  operator ParamGenerator<T>() const {
11184    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11185        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11186        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
11187        v36_, v37_, v38_, v39_, v40_, v41_, v42_};
11188    return ValuesIn(array);
11189  }
11190
11191 private:
11192  // No implementation - assignment is unsupported.
11193  void operator=(const ValueArray42& other);
11194
11195  const T1 v1_;
11196  const T2 v2_;
11197  const T3 v3_;
11198  const T4 v4_;
11199  const T5 v5_;
11200  const T6 v6_;
11201  const T7 v7_;
11202  const T8 v8_;
11203  const T9 v9_;
11204  const T10 v10_;
11205  const T11 v11_;
11206  const T12 v12_;
11207  const T13 v13_;
11208  const T14 v14_;
11209  const T15 v15_;
11210  const T16 v16_;
11211  const T17 v17_;
11212  const T18 v18_;
11213  const T19 v19_;
11214  const T20 v20_;
11215  const T21 v21_;
11216  const T22 v22_;
11217  const T23 v23_;
11218  const T24 v24_;
11219  const T25 v25_;
11220  const T26 v26_;
11221  const T27 v27_;
11222  const T28 v28_;
11223  const T29 v29_;
11224  const T30 v30_;
11225  const T31 v31_;
11226  const T32 v32_;
11227  const T33 v33_;
11228  const T34 v34_;
11229  const T35 v35_;
11230  const T36 v36_;
11231  const T37 v37_;
11232  const T38 v38_;
11233  const T39 v39_;
11234  const T40 v40_;
11235  const T41 v41_;
11236  const T42 v42_;
11237};
11238
11239template <typename T1, typename T2, typename T3, typename T4, typename T5,
11240    typename T6, typename T7, typename T8, typename T9, typename T10,
11241    typename T11, typename T12, typename T13, typename T14, typename T15,
11242    typename T16, typename T17, typename T18, typename T19, typename T20,
11243    typename T21, typename T22, typename T23, typename T24, typename T25,
11244    typename T26, typename T27, typename T28, typename T29, typename T30,
11245    typename T31, typename T32, typename T33, typename T34, typename T35,
11246    typename T36, typename T37, typename T38, typename T39, typename T40,
11247    typename T41, typename T42, typename T43>
11248class ValueArray43 {
11249 public:
11250  ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11251      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11252      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11253      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
11254      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
11255      T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11256      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11257      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
11258      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
11259      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
11260      v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
11261      v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
11262
11263  template <typename T>
11264  operator ParamGenerator<T>() const {
11265    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11266        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11267        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
11268        v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_};
11269    return ValuesIn(array);
11270  }
11271
11272 private:
11273  // No implementation - assignment is unsupported.
11274  void operator=(const ValueArray43& other);
11275
11276  const T1 v1_;
11277  const T2 v2_;
11278  const T3 v3_;
11279  const T4 v4_;
11280  const T5 v5_;
11281  const T6 v6_;
11282  const T7 v7_;
11283  const T8 v8_;
11284  const T9 v9_;
11285  const T10 v10_;
11286  const T11 v11_;
11287  const T12 v12_;
11288  const T13 v13_;
11289  const T14 v14_;
11290  const T15 v15_;
11291  const T16 v16_;
11292  const T17 v17_;
11293  const T18 v18_;
11294  const T19 v19_;
11295  const T20 v20_;
11296  const T21 v21_;
11297  const T22 v22_;
11298  const T23 v23_;
11299  const T24 v24_;
11300  const T25 v25_;
11301  const T26 v26_;
11302  const T27 v27_;
11303  const T28 v28_;
11304  const T29 v29_;
11305  const T30 v30_;
11306  const T31 v31_;
11307  const T32 v32_;
11308  const T33 v33_;
11309  const T34 v34_;
11310  const T35 v35_;
11311  const T36 v36_;
11312  const T37 v37_;
11313  const T38 v38_;
11314  const T39 v39_;
11315  const T40 v40_;
11316  const T41 v41_;
11317  const T42 v42_;
11318  const T43 v43_;
11319};
11320
11321template <typename T1, typename T2, typename T3, typename T4, typename T5,
11322    typename T6, typename T7, typename T8, typename T9, typename T10,
11323    typename T11, typename T12, typename T13, typename T14, typename T15,
11324    typename T16, typename T17, typename T18, typename T19, typename T20,
11325    typename T21, typename T22, typename T23, typename T24, typename T25,
11326    typename T26, typename T27, typename T28, typename T29, typename T30,
11327    typename T31, typename T32, typename T33, typename T34, typename T35,
11328    typename T36, typename T37, typename T38, typename T39, typename T40,
11329    typename T41, typename T42, typename T43, typename T44>
11330class ValueArray44 {
11331 public:
11332  ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11333      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11334      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11335      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
11336      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
11337      T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11338      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11339      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11340      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
11341      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
11342      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
11343      v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
11344      v43_(v43), v44_(v44) {}
11345
11346  template <typename T>
11347  operator ParamGenerator<T>() const {
11348    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11349        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11350        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
11351        v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_};
11352    return ValuesIn(array);
11353  }
11354
11355 private:
11356  // No implementation - assignment is unsupported.
11357  void operator=(const ValueArray44& other);
11358
11359  const T1 v1_;
11360  const T2 v2_;
11361  const T3 v3_;
11362  const T4 v4_;
11363  const T5 v5_;
11364  const T6 v6_;
11365  const T7 v7_;
11366  const T8 v8_;
11367  const T9 v9_;
11368  const T10 v10_;
11369  const T11 v11_;
11370  const T12 v12_;
11371  const T13 v13_;
11372  const T14 v14_;
11373  const T15 v15_;
11374  const T16 v16_;
11375  const T17 v17_;
11376  const T18 v18_;
11377  const T19 v19_;
11378  const T20 v20_;
11379  const T21 v21_;
11380  const T22 v22_;
11381  const T23 v23_;
11382  const T24 v24_;
11383  const T25 v25_;
11384  const T26 v26_;
11385  const T27 v27_;
11386  const T28 v28_;
11387  const T29 v29_;
11388  const T30 v30_;
11389  const T31 v31_;
11390  const T32 v32_;
11391  const T33 v33_;
11392  const T34 v34_;
11393  const T35 v35_;
11394  const T36 v36_;
11395  const T37 v37_;
11396  const T38 v38_;
11397  const T39 v39_;
11398  const T40 v40_;
11399  const T41 v41_;
11400  const T42 v42_;
11401  const T43 v43_;
11402  const T44 v44_;
11403};
11404
11405template <typename T1, typename T2, typename T3, typename T4, typename T5,
11406    typename T6, typename T7, typename T8, typename T9, typename T10,
11407    typename T11, typename T12, typename T13, typename T14, typename T15,
11408    typename T16, typename T17, typename T18, typename T19, typename T20,
11409    typename T21, typename T22, typename T23, typename T24, typename T25,
11410    typename T26, typename T27, typename T28, typename T29, typename T30,
11411    typename T31, typename T32, typename T33, typename T34, typename T35,
11412    typename T36, typename T37, typename T38, typename T39, typename T40,
11413    typename T41, typename T42, typename T43, typename T44, typename T45>
11414class ValueArray45 {
11415 public:
11416  ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11417      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11418      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11419      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
11420      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
11421      T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11422      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11423      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11424      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
11425      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
11426      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
11427      v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
11428      v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
11429
11430  template <typename T>
11431  operator ParamGenerator<T>() const {
11432    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11433        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11434        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
11435        v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_};
11436    return ValuesIn(array);
11437  }
11438
11439 private:
11440  // No implementation - assignment is unsupported.
11441  void operator=(const ValueArray45& other);
11442
11443  const T1 v1_;
11444  const T2 v2_;
11445  const T3 v3_;
11446  const T4 v4_;
11447  const T5 v5_;
11448  const T6 v6_;
11449  const T7 v7_;
11450  const T8 v8_;
11451  const T9 v9_;
11452  const T10 v10_;
11453  const T11 v11_;
11454  const T12 v12_;
11455  const T13 v13_;
11456  const T14 v14_;
11457  const T15 v15_;
11458  const T16 v16_;
11459  const T17 v17_;
11460  const T18 v18_;
11461  const T19 v19_;
11462  const T20 v20_;
11463  const T21 v21_;
11464  const T22 v22_;
11465  const T23 v23_;
11466  const T24 v24_;
11467  const T25 v25_;
11468  const T26 v26_;
11469  const T27 v27_;
11470  const T28 v28_;
11471  const T29 v29_;
11472  const T30 v30_;
11473  const T31 v31_;
11474  const T32 v32_;
11475  const T33 v33_;
11476  const T34 v34_;
11477  const T35 v35_;
11478  const T36 v36_;
11479  const T37 v37_;
11480  const T38 v38_;
11481  const T39 v39_;
11482  const T40 v40_;
11483  const T41 v41_;
11484  const T42 v42_;
11485  const T43 v43_;
11486  const T44 v44_;
11487  const T45 v45_;
11488};
11489
11490template <typename T1, typename T2, typename T3, typename T4, typename T5,
11491    typename T6, typename T7, typename T8, typename T9, typename T10,
11492    typename T11, typename T12, typename T13, typename T14, typename T15,
11493    typename T16, typename T17, typename T18, typename T19, typename T20,
11494    typename T21, typename T22, typename T23, typename T24, typename T25,
11495    typename T26, typename T27, typename T28, typename T29, typename T30,
11496    typename T31, typename T32, typename T33, typename T34, typename T35,
11497    typename T36, typename T37, typename T38, typename T39, typename T40,
11498    typename T41, typename T42, typename T43, typename T44, typename T45,
11499    typename T46>
11500class ValueArray46 {
11501 public:
11502  ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11503      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11504      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11505      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
11506      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
11507      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
11508      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11509      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11510      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11511      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
11512      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
11513      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
11514      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
11515
11516  template <typename T>
11517  operator ParamGenerator<T>() const {
11518    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11519        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11520        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
11521        v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_};
11522    return ValuesIn(array);
11523  }
11524
11525 private:
11526  // No implementation - assignment is unsupported.
11527  void operator=(const ValueArray46& other);
11528
11529  const T1 v1_;
11530  const T2 v2_;
11531  const T3 v3_;
11532  const T4 v4_;
11533  const T5 v5_;
11534  const T6 v6_;
11535  const T7 v7_;
11536  const T8 v8_;
11537  const T9 v9_;
11538  const T10 v10_;
11539  const T11 v11_;
11540  const T12 v12_;
11541  const T13 v13_;
11542  const T14 v14_;
11543  const T15 v15_;
11544  const T16 v16_;
11545  const T17 v17_;
11546  const T18 v18_;
11547  const T19 v19_;
11548  const T20 v20_;
11549  const T21 v21_;
11550  const T22 v22_;
11551  const T23 v23_;
11552  const T24 v24_;
11553  const T25 v25_;
11554  const T26 v26_;
11555  const T27 v27_;
11556  const T28 v28_;
11557  const T29 v29_;
11558  const T30 v30_;
11559  const T31 v31_;
11560  const T32 v32_;
11561  const T33 v33_;
11562  const T34 v34_;
11563  const T35 v35_;
11564  const T36 v36_;
11565  const T37 v37_;
11566  const T38 v38_;
11567  const T39 v39_;
11568  const T40 v40_;
11569  const T41 v41_;
11570  const T42 v42_;
11571  const T43 v43_;
11572  const T44 v44_;
11573  const T45 v45_;
11574  const T46 v46_;
11575};
11576
11577template <typename T1, typename T2, typename T3, typename T4, typename T5,
11578    typename T6, typename T7, typename T8, typename T9, typename T10,
11579    typename T11, typename T12, typename T13, typename T14, typename T15,
11580    typename T16, typename T17, typename T18, typename T19, typename T20,
11581    typename T21, typename T22, typename T23, typename T24, typename T25,
11582    typename T26, typename T27, typename T28, typename T29, typename T30,
11583    typename T31, typename T32, typename T33, typename T34, typename T35,
11584    typename T36, typename T37, typename T38, typename T39, typename T40,
11585    typename T41, typename T42, typename T43, typename T44, typename T45,
11586    typename T46, typename T47>
11587class ValueArray47 {
11588 public:
11589  ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11590      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11591      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11592      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
11593      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
11594      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
11595      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11596      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11597      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11598      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
11599      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
11600      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
11601      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
11602      v47_(v47) {}
11603
11604  template <typename T>
11605  operator ParamGenerator<T>() const {
11606    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11607        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11608        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
11609        v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_,
11610        v47_};
11611    return ValuesIn(array);
11612  }
11613
11614 private:
11615  // No implementation - assignment is unsupported.
11616  void operator=(const ValueArray47& other);
11617
11618  const T1 v1_;
11619  const T2 v2_;
11620  const T3 v3_;
11621  const T4 v4_;
11622  const T5 v5_;
11623  const T6 v6_;
11624  const T7 v7_;
11625  const T8 v8_;
11626  const T9 v9_;
11627  const T10 v10_;
11628  const T11 v11_;
11629  const T12 v12_;
11630  const T13 v13_;
11631  const T14 v14_;
11632  const T15 v15_;
11633  const T16 v16_;
11634  const T17 v17_;
11635  const T18 v18_;
11636  const T19 v19_;
11637  const T20 v20_;
11638  const T21 v21_;
11639  const T22 v22_;
11640  const T23 v23_;
11641  const T24 v24_;
11642  const T25 v25_;
11643  const T26 v26_;
11644  const T27 v27_;
11645  const T28 v28_;
11646  const T29 v29_;
11647  const T30 v30_;
11648  const T31 v31_;
11649  const T32 v32_;
11650  const T33 v33_;
11651  const T34 v34_;
11652  const T35 v35_;
11653  const T36 v36_;
11654  const T37 v37_;
11655  const T38 v38_;
11656  const T39 v39_;
11657  const T40 v40_;
11658  const T41 v41_;
11659  const T42 v42_;
11660  const T43 v43_;
11661  const T44 v44_;
11662  const T45 v45_;
11663  const T46 v46_;
11664  const T47 v47_;
11665};
11666
11667template <typename T1, typename T2, typename T3, typename T4, typename T5,
11668    typename T6, typename T7, typename T8, typename T9, typename T10,
11669    typename T11, typename T12, typename T13, typename T14, typename T15,
11670    typename T16, typename T17, typename T18, typename T19, typename T20,
11671    typename T21, typename T22, typename T23, typename T24, typename T25,
11672    typename T26, typename T27, typename T28, typename T29, typename T30,
11673    typename T31, typename T32, typename T33, typename T34, typename T35,
11674    typename T36, typename T37, typename T38, typename T39, typename T40,
11675    typename T41, typename T42, typename T43, typename T44, typename T45,
11676    typename T46, typename T47, typename T48>
11677class ValueArray48 {
11678 public:
11679  ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11680      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11681      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11682      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
11683      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
11684      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
11685      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11686      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11687      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
11688      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
11689      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
11690      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
11691      v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
11692      v46_(v46), v47_(v47), v48_(v48) {}
11693
11694  template <typename T>
11695  operator ParamGenerator<T>() const {
11696    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11697        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11698        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
11699        v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
11700        v48_};
11701    return ValuesIn(array);
11702  }
11703
11704 private:
11705  // No implementation - assignment is unsupported.
11706  void operator=(const ValueArray48& other);
11707
11708  const T1 v1_;
11709  const T2 v2_;
11710  const T3 v3_;
11711  const T4 v4_;
11712  const T5 v5_;
11713  const T6 v6_;
11714  const T7 v7_;
11715  const T8 v8_;
11716  const T9 v9_;
11717  const T10 v10_;
11718  const T11 v11_;
11719  const T12 v12_;
11720  const T13 v13_;
11721  const T14 v14_;
11722  const T15 v15_;
11723  const T16 v16_;
11724  const T17 v17_;
11725  const T18 v18_;
11726  const T19 v19_;
11727  const T20 v20_;
11728  const T21 v21_;
11729  const T22 v22_;
11730  const T23 v23_;
11731  const T24 v24_;
11732  const T25 v25_;
11733  const T26 v26_;
11734  const T27 v27_;
11735  const T28 v28_;
11736  const T29 v29_;
11737  const T30 v30_;
11738  const T31 v31_;
11739  const T32 v32_;
11740  const T33 v33_;
11741  const T34 v34_;
11742  const T35 v35_;
11743  const T36 v36_;
11744  const T37 v37_;
11745  const T38 v38_;
11746  const T39 v39_;
11747  const T40 v40_;
11748  const T41 v41_;
11749  const T42 v42_;
11750  const T43 v43_;
11751  const T44 v44_;
11752  const T45 v45_;
11753  const T46 v46_;
11754  const T47 v47_;
11755  const T48 v48_;
11756};
11757
11758template <typename T1, typename T2, typename T3, typename T4, typename T5,
11759    typename T6, typename T7, typename T8, typename T9, typename T10,
11760    typename T11, typename T12, typename T13, typename T14, typename T15,
11761    typename T16, typename T17, typename T18, typename T19, typename T20,
11762    typename T21, typename T22, typename T23, typename T24, typename T25,
11763    typename T26, typename T27, typename T28, typename T29, typename T30,
11764    typename T31, typename T32, typename T33, typename T34, typename T35,
11765    typename T36, typename T37, typename T38, typename T39, typename T40,
11766    typename T41, typename T42, typename T43, typename T44, typename T45,
11767    typename T46, typename T47, typename T48, typename T49>
11768class ValueArray49 {
11769 public:
11770  ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11771      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11772      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11773      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
11774      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
11775      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
11776      T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11777      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11778      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11779      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
11780      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
11781      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
11782      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
11783      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
11784
11785  template <typename T>
11786  operator ParamGenerator<T>() const {
11787    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11788        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11789        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
11790        v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
11791        v48_, v49_};
11792    return ValuesIn(array);
11793  }
11794
11795 private:
11796  // No implementation - assignment is unsupported.
11797  void operator=(const ValueArray49& other);
11798
11799  const T1 v1_;
11800  const T2 v2_;
11801  const T3 v3_;
11802  const T4 v4_;
11803  const T5 v5_;
11804  const T6 v6_;
11805  const T7 v7_;
11806  const T8 v8_;
11807  const T9 v9_;
11808  const T10 v10_;
11809  const T11 v11_;
11810  const T12 v12_;
11811  const T13 v13_;
11812  const T14 v14_;
11813  const T15 v15_;
11814  const T16 v16_;
11815  const T17 v17_;
11816  const T18 v18_;
11817  const T19 v19_;
11818  const T20 v20_;
11819  const T21 v21_;
11820  const T22 v22_;
11821  const T23 v23_;
11822  const T24 v24_;
11823  const T25 v25_;
11824  const T26 v26_;
11825  const T27 v27_;
11826  const T28 v28_;
11827  const T29 v29_;
11828  const T30 v30_;
11829  const T31 v31_;
11830  const T32 v32_;
11831  const T33 v33_;
11832  const T34 v34_;
11833  const T35 v35_;
11834  const T36 v36_;
11835  const T37 v37_;
11836  const T38 v38_;
11837  const T39 v39_;
11838  const T40 v40_;
11839  const T41 v41_;
11840  const T42 v42_;
11841  const T43 v43_;
11842  const T44 v44_;
11843  const T45 v45_;
11844  const T46 v46_;
11845  const T47 v47_;
11846  const T48 v48_;
11847  const T49 v49_;
11848};
11849
11850template <typename T1, typename T2, typename T3, typename T4, typename T5,
11851    typename T6, typename T7, typename T8, typename T9, typename T10,
11852    typename T11, typename T12, typename T13, typename T14, typename T15,
11853    typename T16, typename T17, typename T18, typename T19, typename T20,
11854    typename T21, typename T22, typename T23, typename T24, typename T25,
11855    typename T26, typename T27, typename T28, typename T29, typename T30,
11856    typename T31, typename T32, typename T33, typename T34, typename T35,
11857    typename T36, typename T37, typename T38, typename T39, typename T40,
11858    typename T41, typename T42, typename T43, typename T44, typename T45,
11859    typename T46, typename T47, typename T48, typename T49, typename T50>
11860class ValueArray50 {
11861 public:
11862  ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11863      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11864      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11865      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
11866      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
11867      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
11868      T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11869      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11870      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11871      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
11872      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
11873      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
11874      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
11875      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
11876
11877  template <typename T>
11878  operator ParamGenerator<T>() const {
11879    const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
11880        v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
11881        v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
11882        v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
11883        v48_, v49_, v50_};
11884    return ValuesIn(array);
11885  }
11886
11887 private:
11888  // No implementation - assignment is unsupported.
11889  void operator=(const ValueArray50& other);
11890
11891  const T1 v1_;
11892  const T2 v2_;
11893  const T3 v3_;
11894  const T4 v4_;
11895  const T5 v5_;
11896  const T6 v6_;
11897  const T7 v7_;
11898  const T8 v8_;
11899  const T9 v9_;
11900  const T10 v10_;
11901  const T11 v11_;
11902  const T12 v12_;
11903  const T13 v13_;
11904  const T14 v14_;
11905  const T15 v15_;
11906  const T16 v16_;
11907  const T17 v17_;
11908  const T18 v18_;
11909  const T19 v19_;
11910  const T20 v20_;
11911  const T21 v21_;
11912  const T22 v22_;
11913  const T23 v23_;
11914  const T24 v24_;
11915  const T25 v25_;
11916  const T26 v26_;
11917  const T27 v27_;
11918  const T28 v28_;
11919  const T29 v29_;
11920  const T30 v30_;
11921  const T31 v31_;
11922  const T32 v32_;
11923  const T33 v33_;
11924  const T34 v34_;
11925  const T35 v35_;
11926  const T36 v36_;
11927  const T37 v37_;
11928  const T38 v38_;
11929  const T39 v39_;
11930  const T40 v40_;
11931  const T41 v41_;
11932  const T42 v42_;
11933  const T43 v43_;
11934  const T44 v44_;
11935  const T45 v45_;
11936  const T46 v46_;
11937  const T47 v47_;
11938  const T48 v48_;
11939  const T49 v49_;
11940  const T50 v50_;
11941};
11942
11943#if GTEST_HAS_COMBINE
11944// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
11945//
11946// Generates values from the Cartesian product of values produced
11947// by the argument generators.
11948//
11949template <typename T1, typename T2>
11950class CartesianProductGenerator2
11951    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
11952 public:
11953  typedef ::std::tr1::tuple<T1, T2> ParamType;
11954
11955  CartesianProductGenerator2(const ParamGenerator<T1>& g1,
11956      const ParamGenerator<T2>& g2)
11957      : g1_(g1), g2_(g2) {}
11958  virtual ~CartesianProductGenerator2() {}
11959
11960  virtual ParamIteratorInterface<ParamType>* Begin() const {
11961    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
11962  }
11963  virtual ParamIteratorInterface<ParamType>* End() const {
11964    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
11965  }
11966
11967 private:
11968  class Iterator : public ParamIteratorInterface<ParamType> {
11969   public:
11970    Iterator(const ParamGeneratorInterface<ParamType>* base,
11971      const ParamGenerator<T1>& g1,
11972      const typename ParamGenerator<T1>::iterator& current1,
11973      const ParamGenerator<T2>& g2,
11974      const typename ParamGenerator<T2>::iterator& current2)
11975        : base_(base),
11976          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
11977          begin2_(g2.begin()), end2_(g2.end()), current2_(current2)    {
11978      ComputeCurrentValue();
11979    }
11980    virtual ~Iterator() {}
11981
11982    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
11983      return base_;
11984    }
11985    // Advance should not be called on beyond-of-range iterators
11986    // so no component iterators must be beyond end of range, either.
11987    virtual void Advance() {
11988      assert(!AtEnd());
11989      ++current2_;
11990      if (current2_ == end2_) {
11991        current2_ = begin2_;
11992        ++current1_;
11993      }
11994      ComputeCurrentValue();
11995    }
11996    virtual ParamIteratorInterface<ParamType>* Clone() const {
11997      return new Iterator(*this);
11998    }
11999    virtual const ParamType* Current() const { return &current_value_; }
12000    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
12001      // Having the same base generator guarantees that the other
12002      // iterator is of the same type and we can downcast.
12003      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
12004          << "The program attempted to compare iterators "
12005          << "from different generators." << std::endl;
12006      const Iterator* typed_other =
12007          CheckedDowncastToActualType<const Iterator>(&other);
12008      // We must report iterators equal if they both point beyond their
12009      // respective ranges. That can happen in a variety of fashions,
12010      // so we have to consult AtEnd().
12011      return (AtEnd() && typed_other->AtEnd()) ||
12012         (
12013          current1_ == typed_other->current1_ &&
12014          current2_ == typed_other->current2_);
12015    }
12016
12017   private:
12018    Iterator(const Iterator& other)
12019        : base_(other.base_),
12020        begin1_(other.begin1_),
12021        end1_(other.end1_),
12022        current1_(other.current1_),
12023        begin2_(other.begin2_),
12024        end2_(other.end2_),
12025        current2_(other.current2_) {
12026      ComputeCurrentValue();
12027    }
12028
12029    void ComputeCurrentValue() {
12030      if (!AtEnd())
12031        current_value_ = ParamType(*current1_, *current2_);
12032    }
12033    bool AtEnd() const {
12034      // We must report iterator past the end of the range when either of the
12035      // component iterators has reached the end of its range.
12036      return
12037          current1_ == end1_ ||
12038          current2_ == end2_;
12039    }
12040
12041    // No implementation - assignment is unsupported.
12042    void operator=(const Iterator& other);
12043
12044    const ParamGeneratorInterface<ParamType>* const base_;
12045    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
12046    // current[i]_ is the actual traversing iterator.
12047    const typename ParamGenerator<T1>::iterator begin1_;
12048    const typename ParamGenerator<T1>::iterator end1_;
12049    typename ParamGenerator<T1>::iterator current1_;
12050    const typename ParamGenerator<T2>::iterator begin2_;
12051    const typename ParamGenerator<T2>::iterator end2_;
12052    typename ParamGenerator<T2>::iterator current2_;
12053    ParamType current_value_;
12054  };  // class CartesianProductGenerator2::Iterator
12055
12056  // No implementation - assignment is unsupported.
12057  void operator=(const CartesianProductGenerator2& other);
12058
12059  const ParamGenerator<T1> g1_;
12060  const ParamGenerator<T2> g2_;
12061};  // class CartesianProductGenerator2
12062
12063
12064template <typename T1, typename T2, typename T3>
12065class CartesianProductGenerator3
12066    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
12067 public:
12068  typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
12069
12070  CartesianProductGenerator3(const ParamGenerator<T1>& g1,
12071      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
12072      : g1_(g1), g2_(g2), g3_(g3) {}
12073  virtual ~CartesianProductGenerator3() {}
12074
12075  virtual ParamIteratorInterface<ParamType>* Begin() const {
12076    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
12077        g3_.begin());
12078  }
12079  virtual ParamIteratorInterface<ParamType>* End() const {
12080    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
12081  }
12082
12083 private:
12084  class Iterator : public ParamIteratorInterface<ParamType> {
12085   public:
12086    Iterator(const ParamGeneratorInterface<ParamType>* base,
12087      const ParamGenerator<T1>& g1,
12088      const typename ParamGenerator<T1>::iterator& current1,
12089      const ParamGenerator<T2>& g2,
12090      const typename ParamGenerator<T2>::iterator& current2,
12091      const ParamGenerator<T3>& g3,
12092      const typename ParamGenerator<T3>::iterator& current3)
12093        : base_(base),
12094          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
12095          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
12096          begin3_(g3.begin()), end3_(g3.end()), current3_(current3)    {
12097      ComputeCurrentValue();
12098    }
12099    virtual ~Iterator() {}
12100
12101    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
12102      return base_;
12103    }
12104    // Advance should not be called on beyond-of-range iterators
12105    // so no component iterators must be beyond end of range, either.
12106    virtual void Advance() {
12107      assert(!AtEnd());
12108      ++current3_;
12109      if (current3_ == end3_) {
12110        current3_ = begin3_;
12111        ++current2_;
12112      }
12113      if (current2_ == end2_) {
12114        current2_ = begin2_;
12115        ++current1_;
12116      }
12117      ComputeCurrentValue();
12118    }
12119    virtual ParamIteratorInterface<ParamType>* Clone() const {
12120      return new Iterator(*this);
12121    }
12122    virtual const ParamType* Current() const { return &current_value_; }
12123    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
12124      // Having the same base generator guarantees that the other
12125      // iterator is of the same type and we can downcast.
12126      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
12127          << "The program attempted to compare iterators "
12128          << "from different generators." << std::endl;
12129      const Iterator* typed_other =
12130          CheckedDowncastToActualType<const Iterator>(&other);
12131      // We must report iterators equal if they both point beyond their
12132      // respective ranges. That can happen in a variety of fashions,
12133      // so we have to consult AtEnd().
12134      return (AtEnd() && typed_other->AtEnd()) ||
12135         (
12136          current1_ == typed_other->current1_ &&
12137          current2_ == typed_other->current2_ &&
12138          current3_ == typed_other->current3_);
12139    }
12140
12141   private:
12142    Iterator(const Iterator& other)
12143        : base_(other.base_),
12144        begin1_(other.begin1_),
12145        end1_(other.end1_),
12146        current1_(other.current1_),
12147        begin2_(other.begin2_),
12148        end2_(other.end2_),
12149        current2_(other.current2_),
12150        begin3_(other.begin3_),
12151        end3_(other.end3_),
12152        current3_(other.current3_) {
12153      ComputeCurrentValue();
12154    }
12155
12156    void ComputeCurrentValue() {
12157      if (!AtEnd())
12158        current_value_ = ParamType(*current1_, *current2_, *current3_);
12159    }
12160    bool AtEnd() const {
12161      // We must report iterator past the end of the range when either of the
12162      // component iterators has reached the end of its range.
12163      return
12164          current1_ == end1_ ||
12165          current2_ == end2_ ||
12166          current3_ == end3_;
12167    }
12168
12169    // No implementation - assignment is unsupported.
12170    void operator=(const Iterator& other);
12171
12172    const ParamGeneratorInterface<ParamType>* const base_;
12173    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
12174    // current[i]_ is the actual traversing iterator.
12175    const typename ParamGenerator<T1>::iterator begin1_;
12176    const typename ParamGenerator<T1>::iterator end1_;
12177    typename ParamGenerator<T1>::iterator current1_;
12178    const typename ParamGenerator<T2>::iterator begin2_;
12179    const typename ParamGenerator<T2>::iterator end2_;
12180    typename ParamGenerator<T2>::iterator current2_;
12181    const typename ParamGenerator<T3>::iterator begin3_;
12182    const typename ParamGenerator<T3>::iterator end3_;
12183    typename ParamGenerator<T3>::iterator current3_;
12184    ParamType current_value_;
12185  };  // class CartesianProductGenerator3::Iterator
12186
12187  // No implementation - assignment is unsupported.
12188  void operator=(const CartesianProductGenerator3& other);
12189
12190  const ParamGenerator<T1> g1_;
12191  const ParamGenerator<T2> g2_;
12192  const ParamGenerator<T3> g3_;
12193};  // class CartesianProductGenerator3
12194
12195
12196template <typename T1, typename T2, typename T3, typename T4>
12197class CartesianProductGenerator4
12198    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
12199 public:
12200  typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
12201
12202  CartesianProductGenerator4(const ParamGenerator<T1>& g1,
12203      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
12204      const ParamGenerator<T4>& g4)
12205      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
12206  virtual ~CartesianProductGenerator4() {}
12207
12208  virtual ParamIteratorInterface<ParamType>* Begin() const {
12209    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
12210        g3_.begin(), g4_, g4_.begin());
12211  }
12212  virtual ParamIteratorInterface<ParamType>* End() const {
12213    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
12214        g4_, g4_.end());
12215  }
12216
12217 private:
12218  class Iterator : public ParamIteratorInterface<ParamType> {
12219   public:
12220    Iterator(const ParamGeneratorInterface<ParamType>* base,
12221      const ParamGenerator<T1>& g1,
12222      const typename ParamGenerator<T1>::iterator& current1,
12223      const ParamGenerator<T2>& g2,
12224      const typename ParamGenerator<T2>::iterator& current2,
12225      const ParamGenerator<T3>& g3,
12226      const typename ParamGenerator<T3>::iterator& current3,
12227      const ParamGenerator<T4>& g4,
12228      const typename ParamGenerator<T4>::iterator& current4)
12229        : base_(base),
12230          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
12231          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
12232          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
12233          begin4_(g4.begin()), end4_(g4.end()), current4_(current4)    {
12234      ComputeCurrentValue();
12235    }
12236    virtual ~Iterator() {}
12237
12238    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
12239      return base_;
12240    }
12241    // Advance should not be called on beyond-of-range iterators
12242    // so no component iterators must be beyond end of range, either.
12243    virtual void Advance() {
12244      assert(!AtEnd());
12245      ++current4_;
12246      if (current4_ == end4_) {
12247        current4_ = begin4_;
12248        ++current3_;
12249      }
12250      if (current3_ == end3_) {
12251        current3_ = begin3_;
12252        ++current2_;
12253      }
12254      if (current2_ == end2_) {
12255        current2_ = begin2_;
12256        ++current1_;
12257      }
12258      ComputeCurrentValue();
12259    }
12260    virtual ParamIteratorInterface<ParamType>* Clone() const {
12261      return new Iterator(*this);
12262    }
12263    virtual const ParamType* Current() const { return &current_value_; }
12264    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
12265      // Having the same base generator guarantees that the other
12266      // iterator is of the same type and we can downcast.
12267      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
12268          << "The program attempted to compare iterators "
12269          << "from different generators." << std::endl;
12270      const Iterator* typed_other =
12271          CheckedDowncastToActualType<const Iterator>(&other);
12272      // We must report iterators equal if they both point beyond their
12273      // respective ranges. That can happen in a variety of fashions,
12274      // so we have to consult AtEnd().
12275      return (AtEnd() && typed_other->AtEnd()) ||
12276         (
12277          current1_ == typed_other->current1_ &&
12278          current2_ == typed_other->current2_ &&
12279          current3_ == typed_other->current3_ &&
12280          current4_ == typed_other->current4_);
12281    }
12282
12283   private:
12284    Iterator(const Iterator& other)
12285        : base_(other.base_),
12286        begin1_(other.begin1_),
12287        end1_(other.end1_),
12288        current1_(other.current1_),
12289        begin2_(other.begin2_),
12290        end2_(other.end2_),
12291        current2_(other.current2_),
12292        begin3_(other.begin3_),
12293        end3_(other.end3_),
12294        current3_(other.current3_),
12295        begin4_(other.begin4_),
12296        end4_(other.end4_),
12297        current4_(other.current4_) {
12298      ComputeCurrentValue();
12299    }
12300
12301    void ComputeCurrentValue() {
12302      if (!AtEnd())
12303        current_value_ = ParamType(*current1_, *current2_, *current3_,
12304            *current4_);
12305    }
12306    bool AtEnd() const {
12307      // We must report iterator past the end of the range when either of the
12308      // component iterators has reached the end of its range.
12309      return
12310          current1_ == end1_ ||
12311          current2_ == end2_ ||
12312          current3_ == end3_ ||
12313          current4_ == end4_;
12314    }
12315
12316    // No implementation - assignment is unsupported.
12317    void operator=(const Iterator& other);
12318
12319    const ParamGeneratorInterface<ParamType>* const base_;
12320    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
12321    // current[i]_ is the actual traversing iterator.
12322    const typename ParamGenerator<T1>::iterator begin1_;
12323    const typename ParamGenerator<T1>::iterator end1_;
12324    typename ParamGenerator<T1>::iterator current1_;
12325    const typename ParamGenerator<T2>::iterator begin2_;
12326    const typename ParamGenerator<T2>::iterator end2_;
12327    typename ParamGenerator<T2>::iterator current2_;
12328    const typename ParamGenerator<T3>::iterator begin3_;
12329    const typename ParamGenerator<T3>::iterator end3_;
12330    typename ParamGenerator<T3>::iterator current3_;
12331    const typename ParamGenerator<T4>::iterator begin4_;
12332    const typename ParamGenerator<T4>::iterator end4_;
12333    typename ParamGenerator<T4>::iterator current4_;
12334    ParamType current_value_;
12335  };  // class CartesianProductGenerator4::Iterator
12336
12337  // No implementation - assignment is unsupported.
12338  void operator=(const CartesianProductGenerator4& other);
12339
12340  const ParamGenerator<T1> g1_;
12341  const ParamGenerator<T2> g2_;
12342  const ParamGenerator<T3> g3_;
12343  const ParamGenerator<T4> g4_;
12344};  // class CartesianProductGenerator4
12345
12346
12347template <typename T1, typename T2, typename T3, typename T4, typename T5>
12348class CartesianProductGenerator5
12349    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
12350 public:
12351  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
12352
12353  CartesianProductGenerator5(const ParamGenerator<T1>& g1,
12354      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
12355      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
12356      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
12357  virtual ~CartesianProductGenerator5() {}
12358
12359  virtual ParamIteratorInterface<ParamType>* Begin() const {
12360    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
12361        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
12362  }
12363  virtual ParamIteratorInterface<ParamType>* End() const {
12364    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
12365        g4_, g4_.end(), g5_, g5_.end());
12366  }
12367
12368 private:
12369  class Iterator : public ParamIteratorInterface<ParamType> {
12370   public:
12371    Iterator(const ParamGeneratorInterface<ParamType>* base,
12372      const ParamGenerator<T1>& g1,
12373      const typename ParamGenerator<T1>::iterator& current1,
12374      const ParamGenerator<T2>& g2,
12375      const typename ParamGenerator<T2>::iterator& current2,
12376      const ParamGenerator<T3>& g3,
12377      const typename ParamGenerator<T3>::iterator& current3,
12378      const ParamGenerator<T4>& g4,
12379      const typename ParamGenerator<T4>::iterator& current4,
12380      const ParamGenerator<T5>& g5,
12381      const typename ParamGenerator<T5>::iterator& current5)
12382        : base_(base),
12383          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
12384          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
12385          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
12386          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
12387          begin5_(g5.begin()), end5_(g5.end()), current5_(current5)    {
12388      ComputeCurrentValue();
12389    }
12390    virtual ~Iterator() {}
12391
12392    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
12393      return base_;
12394    }
12395    // Advance should not be called on beyond-of-range iterators
12396    // so no component iterators must be beyond end of range, either.
12397    virtual void Advance() {
12398      assert(!AtEnd());
12399      ++current5_;
12400      if (current5_ == end5_) {
12401        current5_ = begin5_;
12402        ++current4_;
12403      }
12404      if (current4_ == end4_) {
12405        current4_ = begin4_;
12406        ++current3_;
12407      }
12408      if (current3_ == end3_) {
12409        current3_ = begin3_;
12410        ++current2_;
12411      }
12412      if (current2_ == end2_) {
12413        current2_ = begin2_;
12414        ++current1_;
12415      }
12416      ComputeCurrentValue();
12417    }
12418    virtual ParamIteratorInterface<ParamType>* Clone() const {
12419      return new Iterator(*this);
12420    }
12421    virtual const ParamType* Current() const { return &current_value_; }
12422    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
12423      // Having the same base generator guarantees that the other
12424      // iterator is of the same type and we can downcast.
12425      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
12426          << "The program attempted to compare iterators "
12427          << "from different generators." << std::endl;
12428      const Iterator* typed_other =
12429          CheckedDowncastToActualType<const Iterator>(&other);
12430      // We must report iterators equal if they both point beyond their
12431      // respective ranges. That can happen in a variety of fashions,
12432      // so we have to consult AtEnd().
12433      return (AtEnd() && typed_other->AtEnd()) ||
12434         (
12435          current1_ == typed_other->current1_ &&
12436          current2_ == typed_other->current2_ &&
12437          current3_ == typed_other->current3_ &&
12438          current4_ == typed_other->current4_ &&
12439          current5_ == typed_other->current5_);
12440    }
12441
12442   private:
12443    Iterator(const Iterator& other)
12444        : base_(other.base_),
12445        begin1_(other.begin1_),
12446        end1_(other.end1_),
12447        current1_(other.current1_),
12448        begin2_(other.begin2_),
12449        end2_(other.end2_),
12450        current2_(other.current2_),
12451        begin3_(other.begin3_),
12452        end3_(other.end3_),
12453        current3_(other.current3_),
12454        begin4_(other.begin4_),
12455        end4_(other.end4_),
12456        current4_(other.current4_),
12457        begin5_(other.begin5_),
12458        end5_(other.end5_),
12459        current5_(other.current5_) {
12460      ComputeCurrentValue();
12461    }
12462
12463    void ComputeCurrentValue() {
12464      if (!AtEnd())
12465        current_value_ = ParamType(*current1_, *current2_, *current3_,
12466            *current4_, *current5_);
12467    }
12468    bool AtEnd() const {
12469      // We must report iterator past the end of the range when either of the
12470      // component iterators has reached the end of its range.
12471      return
12472          current1_ == end1_ ||
12473          current2_ == end2_ ||
12474          current3_ == end3_ ||
12475          current4_ == end4_ ||
12476          current5_ == end5_;
12477    }
12478
12479    // No implementation - assignment is unsupported.
12480    void operator=(const Iterator& other);
12481
12482    const ParamGeneratorInterface<ParamType>* const base_;
12483    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
12484    // current[i]_ is the actual traversing iterator.
12485    const typename ParamGenerator<T1>::iterator begin1_;
12486    const typename ParamGenerator<T1>::iterator end1_;
12487    typename ParamGenerator<T1>::iterator current1_;
12488    const typename ParamGenerator<T2>::iterator begin2_;
12489    const typename ParamGenerator<T2>::iterator end2_;
12490    typename ParamGenerator<T2>::iterator current2_;
12491    const typename ParamGenerator<T3>::iterator begin3_;
12492    const typename ParamGenerator<T3>::iterator end3_;
12493    typename ParamGenerator<T3>::iterator current3_;
12494    const typename ParamGenerator<T4>::iterator begin4_;
12495    const typename ParamGenerator<T4>::iterator end4_;
12496    typename ParamGenerator<T4>::iterator current4_;
12497    const typename ParamGenerator<T5>::iterator begin5_;
12498    const typename ParamGenerator<T5>::iterator end5_;
12499    typename ParamGenerator<T5>::iterator current5_;
12500    ParamType current_value_;
12501  };  // class CartesianProductGenerator5::Iterator
12502
12503  // No implementation - assignment is unsupported.
12504  void operator=(const CartesianProductGenerator5& other);
12505
12506  const ParamGenerator<T1> g1_;
12507  const ParamGenerator<T2> g2_;
12508  const ParamGenerator<T3> g3_;
12509  const ParamGenerator<T4> g4_;
12510  const ParamGenerator<T5> g5_;
12511};  // class CartesianProductGenerator5
12512
12513
12514template <typename T1, typename T2, typename T3, typename T4, typename T5,
12515    typename T6>
12516class CartesianProductGenerator6
12517    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
12518        T6> > {
12519 public:
12520  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
12521
12522  CartesianProductGenerator6(const ParamGenerator<T1>& g1,
12523      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
12524      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
12525      const ParamGenerator<T6>& g6)
12526      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
12527  virtual ~CartesianProductGenerator6() {}
12528
12529  virtual ParamIteratorInterface<ParamType>* Begin() const {
12530    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
12531        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
12532  }
12533  virtual ParamIteratorInterface<ParamType>* End() const {
12534    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
12535        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
12536  }
12537
12538 private:
12539  class Iterator : public ParamIteratorInterface<ParamType> {
12540   public:
12541    Iterator(const ParamGeneratorInterface<ParamType>* base,
12542      const ParamGenerator<T1>& g1,
12543      const typename ParamGenerator<T1>::iterator& current1,
12544      const ParamGenerator<T2>& g2,
12545      const typename ParamGenerator<T2>::iterator& current2,
12546      const ParamGenerator<T3>& g3,
12547      const typename ParamGenerator<T3>::iterator& current3,
12548      const ParamGenerator<T4>& g4,
12549      const typename ParamGenerator<T4>::iterator& current4,
12550      const ParamGenerator<T5>& g5,
12551      const typename ParamGenerator<T5>::iterator& current5,
12552      const ParamGenerator<T6>& g6,
12553      const typename ParamGenerator<T6>::iterator& current6)
12554        : base_(base),
12555          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
12556          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
12557          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
12558          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
12559          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
12560          begin6_(g6.begin()), end6_(g6.end()), current6_(current6)    {
12561      ComputeCurrentValue();
12562    }
12563    virtual ~Iterator() {}
12564
12565    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
12566      return base_;
12567    }
12568    // Advance should not be called on beyond-of-range iterators
12569    // so no component iterators must be beyond end of range, either.
12570    virtual void Advance() {
12571      assert(!AtEnd());
12572      ++current6_;
12573      if (current6_ == end6_) {
12574        current6_ = begin6_;
12575        ++current5_;
12576      }
12577      if (current5_ == end5_) {
12578        current5_ = begin5_;
12579        ++current4_;
12580      }
12581      if (current4_ == end4_) {
12582        current4_ = begin4_;
12583        ++current3_;
12584      }
12585      if (current3_ == end3_) {
12586        current3_ = begin3_;
12587        ++current2_;
12588      }
12589      if (current2_ == end2_) {
12590        current2_ = begin2_;
12591        ++current1_;
12592      }
12593      ComputeCurrentValue();
12594    }
12595    virtual ParamIteratorInterface<ParamType>* Clone() const {
12596      return new Iterator(*this);
12597    }
12598    virtual const ParamType* Current() const { return &current_value_; }
12599    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
12600      // Having the same base generator guarantees that the other
12601      // iterator is of the same type and we can downcast.
12602      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
12603          << "The program attempted to compare iterators "
12604          << "from different generators." << std::endl;
12605      const Iterator* typed_other =
12606          CheckedDowncastToActualType<const Iterator>(&other);
12607      // We must report iterators equal if they both point beyond their
12608      // respective ranges. That can happen in a variety of fashions,
12609      // so we have to consult AtEnd().
12610      return (AtEnd() && typed_other->AtEnd()) ||
12611         (
12612          current1_ == typed_other->current1_ &&
12613          current2_ == typed_other->current2_ &&
12614          current3_ == typed_other->current3_ &&
12615          current4_ == typed_other->current4_ &&
12616          current5_ == typed_other->current5_ &&
12617          current6_ == typed_other->current6_);
12618    }
12619
12620   private:
12621    Iterator(const Iterator& other)
12622        : base_(other.base_),
12623        begin1_(other.begin1_),
12624        end1_(other.end1_),
12625        current1_(other.current1_),
12626        begin2_(other.begin2_),
12627        end2_(other.end2_),
12628        current2_(other.current2_),
12629        begin3_(other.begin3_),
12630        end3_(other.end3_),
12631        current3_(other.current3_),
12632        begin4_(other.begin4_),
12633        end4_(other.end4_),
12634        current4_(other.current4_),
12635        begin5_(other.begin5_),
12636        end5_(other.end5_),
12637        current5_(other.current5_),
12638        begin6_(other.begin6_),
12639        end6_(other.end6_),
12640        current6_(other.current6_) {
12641      ComputeCurrentValue();
12642    }
12643
12644    void ComputeCurrentValue() {
12645      if (!AtEnd())
12646        current_value_ = ParamType(*current1_, *current2_, *current3_,
12647            *current4_, *current5_, *current6_);
12648    }
12649    bool AtEnd() const {
12650      // We must report iterator past the end of the range when either of the
12651      // component iterators has reached the end of its range.
12652      return
12653          current1_ == end1_ ||
12654          current2_ == end2_ ||
12655          current3_ == end3_ ||
12656          current4_ == end4_ ||
12657          current5_ == end5_ ||
12658          current6_ == end6_;
12659    }
12660
12661    // No implementation - assignment is unsupported.
12662    void operator=(const Iterator& other);
12663
12664    const ParamGeneratorInterface<ParamType>* const base_;
12665    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
12666    // current[i]_ is the actual traversing iterator.
12667    const typename ParamGenerator<T1>::iterator begin1_;
12668    const typename ParamGenerator<T1>::iterator end1_;
12669    typename ParamGenerator<T1>::iterator current1_;
12670    const typename ParamGenerator<T2>::iterator begin2_;
12671    const typename ParamGenerator<T2>::iterator end2_;
12672    typename ParamGenerator<T2>::iterator current2_;
12673    const typename ParamGenerator<T3>::iterator begin3_;
12674    const typename ParamGenerator<T3>::iterator end3_;
12675    typename ParamGenerator<T3>::iterator current3_;
12676    const typename ParamGenerator<T4>::iterator begin4_;
12677    const typename ParamGenerator<T4>::iterator end4_;
12678    typename ParamGenerator<T4>::iterator current4_;
12679    const typename ParamGenerator<T5>::iterator begin5_;
12680    const typename ParamGenerator<T5>::iterator end5_;
12681    typename ParamGenerator<T5>::iterator current5_;
12682    const typename ParamGenerator<T6>::iterator begin6_;
12683    const typename ParamGenerator<T6>::iterator end6_;
12684    typename ParamGenerator<T6>::iterator current6_;
12685    ParamType current_value_;
12686  };  // class CartesianProductGenerator6::Iterator
12687
12688  // No implementation - assignment is unsupported.
12689  void operator=(const CartesianProductGenerator6& other);
12690
12691  const ParamGenerator<T1> g1_;
12692  const ParamGenerator<T2> g2_;
12693  const ParamGenerator<T3> g3_;
12694  const ParamGenerator<T4> g4_;
12695  const ParamGenerator<T5> g5_;
12696  const ParamGenerator<T6> g6_;
12697};  // class CartesianProductGenerator6
12698
12699
12700template <typename T1, typename T2, typename T3, typename T4, typename T5,
12701    typename T6, typename T7>
12702class CartesianProductGenerator7
12703    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
12704        T7> > {
12705 public:
12706  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
12707
12708  CartesianProductGenerator7(const ParamGenerator<T1>& g1,
12709      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
12710      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
12711      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
12712      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
12713  virtual ~CartesianProductGenerator7() {}
12714
12715  virtual ParamIteratorInterface<ParamType>* Begin() const {
12716    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
12717        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
12718        g7_.begin());
12719  }
12720  virtual ParamIteratorInterface<ParamType>* End() const {
12721    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
12722        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
12723  }
12724
12725 private:
12726  class Iterator : public ParamIteratorInterface<ParamType> {
12727   public:
12728    Iterator(const ParamGeneratorInterface<ParamType>* base,
12729      const ParamGenerator<T1>& g1,
12730      const typename ParamGenerator<T1>::iterator& current1,
12731      const ParamGenerator<T2>& g2,
12732      const typename ParamGenerator<T2>::iterator& current2,
12733      const ParamGenerator<T3>& g3,
12734      const typename ParamGenerator<T3>::iterator& current3,
12735      const ParamGenerator<T4>& g4,
12736      const typename ParamGenerator<T4>::iterator& current4,
12737      const ParamGenerator<T5>& g5,
12738      const typename ParamGenerator<T5>::iterator& current5,
12739      const ParamGenerator<T6>& g6,
12740      const typename ParamGenerator<T6>::iterator& current6,
12741      const ParamGenerator<T7>& g7,
12742      const typename ParamGenerator<T7>::iterator& current7)
12743        : base_(base),
12744          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
12745          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
12746          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
12747          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
12748          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
12749          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
12750          begin7_(g7.begin()), end7_(g7.end()), current7_(current7)    {
12751      ComputeCurrentValue();
12752    }
12753    virtual ~Iterator() {}
12754
12755    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
12756      return base_;
12757    }
12758    // Advance should not be called on beyond-of-range iterators
12759    // so no component iterators must be beyond end of range, either.
12760    virtual void Advance() {
12761      assert(!AtEnd());
12762      ++current7_;
12763      if (current7_ == end7_) {
12764        current7_ = begin7_;
12765        ++current6_;
12766      }
12767      if (current6_ == end6_) {
12768        current6_ = begin6_;
12769        ++current5_;
12770      }
12771      if (current5_ == end5_) {
12772        current5_ = begin5_;
12773        ++current4_;
12774      }
12775      if (current4_ == end4_) {
12776        current4_ = begin4_;
12777        ++current3_;
12778      }
12779      if (current3_ == end3_) {
12780        current3_ = begin3_;
12781        ++current2_;
12782      }
12783      if (current2_ == end2_) {
12784        current2_ = begin2_;
12785        ++current1_;
12786      }
12787      ComputeCurrentValue();
12788    }
12789    virtual ParamIteratorInterface<ParamType>* Clone() const {
12790      return new Iterator(*this);
12791    }
12792    virtual const ParamType* Current() const { return &current_value_; }
12793    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
12794      // Having the same base generator guarantees that the other
12795      // iterator is of the same type and we can downcast.
12796      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
12797          << "The program attempted to compare iterators "
12798          << "from different generators." << std::endl;
12799      const Iterator* typed_other =
12800          CheckedDowncastToActualType<const Iterator>(&other);
12801      // We must report iterators equal if they both point beyond their
12802      // respective ranges. That can happen in a variety of fashions,
12803      // so we have to consult AtEnd().
12804      return (AtEnd() && typed_other->AtEnd()) ||
12805         (
12806          current1_ == typed_other->current1_ &&
12807          current2_ == typed_other->current2_ &&
12808          current3_ == typed_other->current3_ &&
12809          current4_ == typed_other->current4_ &&
12810          current5_ == typed_other->current5_ &&
12811          current6_ == typed_other->current6_ &&
12812          current7_ == typed_other->current7_);
12813    }
12814
12815   private:
12816    Iterator(const Iterator& other)
12817        : base_(other.base_),
12818        begin1_(other.begin1_),
12819        end1_(other.end1_),
12820        current1_(other.current1_),
12821        begin2_(other.begin2_),
12822        end2_(other.end2_),
12823        current2_(other.current2_),
12824        begin3_(other.begin3_),
12825        end3_(other.end3_),
12826        current3_(other.current3_),
12827        begin4_(other.begin4_),
12828        end4_(other.end4_),
12829        current4_(other.current4_),
12830        begin5_(other.begin5_),
12831        end5_(other.end5_),
12832        current5_(other.current5_),
12833        begin6_(other.begin6_),
12834        end6_(other.end6_),
12835        current6_(other.current6_),
12836        begin7_(other.begin7_),
12837        end7_(other.end7_),
12838        current7_(other.current7_) {
12839      ComputeCurrentValue();
12840    }
12841
12842    void ComputeCurrentValue() {
12843      if (!AtEnd())
12844        current_value_ = ParamType(*current1_, *current2_, *current3_,
12845            *current4_, *current5_, *current6_, *current7_);
12846    }
12847    bool AtEnd() const {
12848      // We must report iterator past the end of the range when either of the
12849      // component iterators has reached the end of its range.
12850      return
12851          current1_ == end1_ ||
12852          current2_ == end2_ ||
12853          current3_ == end3_ ||
12854          current4_ == end4_ ||
12855          current5_ == end5_ ||
12856          current6_ == end6_ ||
12857          current7_ == end7_;
12858    }
12859
12860    // No implementation - assignment is unsupported.
12861    void operator=(const Iterator& other);
12862
12863    const ParamGeneratorInterface<ParamType>* const base_;
12864    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
12865    // current[i]_ is the actual traversing iterator.
12866    const typename ParamGenerator<T1>::iterator begin1_;
12867    const typename ParamGenerator<T1>::iterator end1_;
12868    typename ParamGenerator<T1>::iterator current1_;
12869    const typename ParamGenerator<T2>::iterator begin2_;
12870    const typename ParamGenerator<T2>::iterator end2_;
12871    typename ParamGenerator<T2>::iterator current2_;
12872    const typename ParamGenerator<T3>::iterator begin3_;
12873    const typename ParamGenerator<T3>::iterator end3_;
12874    typename ParamGenerator<T3>::iterator current3_;
12875    const typename ParamGenerator<T4>::iterator begin4_;
12876    const typename ParamGenerator<T4>::iterator end4_;
12877    typename ParamGenerator<T4>::iterator current4_;
12878    const typename ParamGenerator<T5>::iterator begin5_;
12879    const typename ParamGenerator<T5>::iterator end5_;
12880    typename ParamGenerator<T5>::iterator current5_;
12881    const typename ParamGenerator<T6>::iterator begin6_;
12882    const typename ParamGenerator<T6>::iterator end6_;
12883    typename ParamGenerator<T6>::iterator current6_;
12884    const typename ParamGenerator<T7>::iterator begin7_;
12885    const typename ParamGenerator<T7>::iterator end7_;
12886    typename ParamGenerator<T7>::iterator current7_;
12887    ParamType current_value_;
12888  };  // class CartesianProductGenerator7::Iterator
12889
12890  // No implementation - assignment is unsupported.
12891  void operator=(const CartesianProductGenerator7& other);
12892
12893  const ParamGenerator<T1> g1_;
12894  const ParamGenerator<T2> g2_;
12895  const ParamGenerator<T3> g3_;
12896  const ParamGenerator<T4> g4_;
12897  const ParamGenerator<T5> g5_;
12898  const ParamGenerator<T6> g6_;
12899  const ParamGenerator<T7> g7_;
12900};  // class CartesianProductGenerator7
12901
12902
12903template <typename T1, typename T2, typename T3, typename T4, typename T5,
12904    typename T6, typename T7, typename T8>
12905class CartesianProductGenerator8
12906    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
12907        T7, T8> > {
12908 public:
12909  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
12910
12911  CartesianProductGenerator8(const ParamGenerator<T1>& g1,
12912      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
12913      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
12914      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
12915      const ParamGenerator<T8>& g8)
12916      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
12917          g8_(g8) {}
12918  virtual ~CartesianProductGenerator8() {}
12919
12920  virtual ParamIteratorInterface<ParamType>* Begin() const {
12921    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
12922        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
12923        g7_.begin(), g8_, g8_.begin());
12924  }
12925  virtual ParamIteratorInterface<ParamType>* End() const {
12926    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
12927        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
12928        g8_.end());
12929  }
12930
12931 private:
12932  class Iterator : public ParamIteratorInterface<ParamType> {
12933   public:
12934    Iterator(const ParamGeneratorInterface<ParamType>* base,
12935      const ParamGenerator<T1>& g1,
12936      const typename ParamGenerator<T1>::iterator& current1,
12937      const ParamGenerator<T2>& g2,
12938      const typename ParamGenerator<T2>::iterator& current2,
12939      const ParamGenerator<T3>& g3,
12940      const typename ParamGenerator<T3>::iterator& current3,
12941      const ParamGenerator<T4>& g4,
12942      const typename ParamGenerator<T4>::iterator& current4,
12943      const ParamGenerator<T5>& g5,
12944      const typename ParamGenerator<T5>::iterator& current5,
12945      const ParamGenerator<T6>& g6,
12946      const typename ParamGenerator<T6>::iterator& current6,
12947      const ParamGenerator<T7>& g7,
12948      const typename ParamGenerator<T7>::iterator& current7,
12949      const ParamGenerator<T8>& g8,
12950      const typename ParamGenerator<T8>::iterator& current8)
12951        : base_(base),
12952          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
12953          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
12954          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
12955          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
12956          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
12957          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
12958          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
12959          begin8_(g8.begin()), end8_(g8.end()), current8_(current8)    {
12960      ComputeCurrentValue();
12961    }
12962    virtual ~Iterator() {}
12963
12964    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
12965      return base_;
12966    }
12967    // Advance should not be called on beyond-of-range iterators
12968    // so no component iterators must be beyond end of range, either.
12969    virtual void Advance() {
12970      assert(!AtEnd());
12971      ++current8_;
12972      if (current8_ == end8_) {
12973        current8_ = begin8_;
12974        ++current7_;
12975      }
12976      if (current7_ == end7_) {
12977        current7_ = begin7_;
12978        ++current6_;
12979      }
12980      if (current6_ == end6_) {
12981        current6_ = begin6_;
12982        ++current5_;
12983      }
12984      if (current5_ == end5_) {
12985        current5_ = begin5_;
12986        ++current4_;
12987      }
12988      if (current4_ == end4_) {
12989        current4_ = begin4_;
12990        ++current3_;
12991      }
12992      if (current3_ == end3_) {
12993        current3_ = begin3_;
12994        ++current2_;
12995      }
12996      if (current2_ == end2_) {
12997        current2_ = begin2_;
12998        ++current1_;
12999      }
13000      ComputeCurrentValue();
13001    }
13002    virtual ParamIteratorInterface<ParamType>* Clone() const {
13003      return new Iterator(*this);
13004    }
13005    virtual const ParamType* Current() const { return &current_value_; }
13006    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13007      // Having the same base generator guarantees that the other
13008      // iterator is of the same type and we can downcast.
13009      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13010          << "The program attempted to compare iterators "
13011          << "from different generators." << std::endl;
13012      const Iterator* typed_other =
13013          CheckedDowncastToActualType<const Iterator>(&other);
13014      // We must report iterators equal if they both point beyond their
13015      // respective ranges. That can happen in a variety of fashions,
13016      // so we have to consult AtEnd().
13017      return (AtEnd() && typed_other->AtEnd()) ||
13018         (
13019          current1_ == typed_other->current1_ &&
13020          current2_ == typed_other->current2_ &&
13021          current3_ == typed_other->current3_ &&
13022          current4_ == typed_other->current4_ &&
13023          current5_ == typed_other->current5_ &&
13024          current6_ == typed_other->current6_ &&
13025          current7_ == typed_other->current7_ &&
13026          current8_ == typed_other->current8_);
13027    }
13028
13029   private:
13030    Iterator(const Iterator& other)
13031        : base_(other.base_),
13032        begin1_(other.begin1_),
13033        end1_(other.end1_),
13034        current1_(other.current1_),
13035        begin2_(other.begin2_),
13036        end2_(other.end2_),
13037        current2_(other.current2_),
13038        begin3_(other.begin3_),
13039        end3_(other.end3_),
13040        current3_(other.current3_),
13041        begin4_(other.begin4_),
13042        end4_(other.end4_),
13043        current4_(other.current4_),
13044        begin5_(other.begin5_),
13045        end5_(other.end5_),
13046        current5_(other.current5_),
13047        begin6_(other.begin6_),
13048        end6_(other.end6_),
13049        current6_(other.current6_),
13050        begin7_(other.begin7_),
13051        end7_(other.end7_),
13052        current7_(other.current7_),
13053        begin8_(other.begin8_),
13054        end8_(other.end8_),
13055        current8_(other.current8_) {
13056      ComputeCurrentValue();
13057    }
13058
13059    void ComputeCurrentValue() {
13060      if (!AtEnd())
13061        current_value_ = ParamType(*current1_, *current2_, *current3_,
13062            *current4_, *current5_, *current6_, *current7_, *current8_);
13063    }
13064    bool AtEnd() const {
13065      // We must report iterator past the end of the range when either of the
13066      // component iterators has reached the end of its range.
13067      return
13068          current1_ == end1_ ||
13069          current2_ == end2_ ||
13070          current3_ == end3_ ||
13071          current4_ == end4_ ||
13072          current5_ == end5_ ||
13073          current6_ == end6_ ||
13074          current7_ == end7_ ||
13075          current8_ == end8_;
13076    }
13077
13078    // No implementation - assignment is unsupported.
13079    void operator=(const Iterator& other);
13080
13081    const ParamGeneratorInterface<ParamType>* const base_;
13082    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13083    // current[i]_ is the actual traversing iterator.
13084    const typename ParamGenerator<T1>::iterator begin1_;
13085    const typename ParamGenerator<T1>::iterator end1_;
13086    typename ParamGenerator<T1>::iterator current1_;
13087    const typename ParamGenerator<T2>::iterator begin2_;
13088    const typename ParamGenerator<T2>::iterator end2_;
13089    typename ParamGenerator<T2>::iterator current2_;
13090    const typename ParamGenerator<T3>::iterator begin3_;
13091    const typename ParamGenerator<T3>::iterator end3_;
13092    typename ParamGenerator<T3>::iterator current3_;
13093    const typename ParamGenerator<T4>::iterator begin4_;
13094    const typename ParamGenerator<T4>::iterator end4_;
13095    typename ParamGenerator<T4>::iterator current4_;
13096    const typename ParamGenerator<T5>::iterator begin5_;
13097    const typename ParamGenerator<T5>::iterator end5_;
13098    typename ParamGenerator<T5>::iterator current5_;
13099    const typename ParamGenerator<T6>::iterator begin6_;
13100    const typename ParamGenerator<T6>::iterator end6_;
13101    typename ParamGenerator<T6>::iterator current6_;
13102    const typename ParamGenerator<T7>::iterator begin7_;
13103    const typename ParamGenerator<T7>::iterator end7_;
13104    typename ParamGenerator<T7>::iterator current7_;
13105    const typename ParamGenerator<T8>::iterator begin8_;
13106    const typename ParamGenerator<T8>::iterator end8_;
13107    typename ParamGenerator<T8>::iterator current8_;
13108    ParamType current_value_;
13109  };  // class CartesianProductGenerator8::Iterator
13110
13111  // No implementation - assignment is unsupported.
13112  void operator=(const CartesianProductGenerator8& other);
13113
13114  const ParamGenerator<T1> g1_;
13115  const ParamGenerator<T2> g2_;
13116  const ParamGenerator<T3> g3_;
13117  const ParamGenerator<T4> g4_;
13118  const ParamGenerator<T5> g5_;
13119  const ParamGenerator<T6> g6_;
13120  const ParamGenerator<T7> g7_;
13121  const ParamGenerator<T8> g8_;
13122};  // class CartesianProductGenerator8
13123
13124
13125template <typename T1, typename T2, typename T3, typename T4, typename T5,
13126    typename T6, typename T7, typename T8, typename T9>
13127class CartesianProductGenerator9
13128    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
13129        T7, T8, T9> > {
13130 public:
13131  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
13132
13133  CartesianProductGenerator9(const ParamGenerator<T1>& g1,
13134      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
13135      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
13136      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
13137      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
13138      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
13139          g9_(g9) {}
13140  virtual ~CartesianProductGenerator9() {}
13141
13142  virtual ParamIteratorInterface<ParamType>* Begin() const {
13143    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
13144        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
13145        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
13146  }
13147  virtual ParamIteratorInterface<ParamType>* End() const {
13148    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
13149        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
13150        g8_.end(), g9_, g9_.end());
13151  }
13152
13153 private:
13154  class Iterator : public ParamIteratorInterface<ParamType> {
13155   public:
13156    Iterator(const ParamGeneratorInterface<ParamType>* base,
13157      const ParamGenerator<T1>& g1,
13158      const typename ParamGenerator<T1>::iterator& current1,
13159      const ParamGenerator<T2>& g2,
13160      const typename ParamGenerator<T2>::iterator& current2,
13161      const ParamGenerator<T3>& g3,
13162      const typename ParamGenerator<T3>::iterator& current3,
13163      const ParamGenerator<T4>& g4,
13164      const typename ParamGenerator<T4>::iterator& current4,
13165      const ParamGenerator<T5>& g5,
13166      const typename ParamGenerator<T5>::iterator& current5,
13167      const ParamGenerator<T6>& g6,
13168      const typename ParamGenerator<T6>::iterator& current6,
13169      const ParamGenerator<T7>& g7,
13170      const typename ParamGenerator<T7>::iterator& current7,
13171      const ParamGenerator<T8>& g8,
13172      const typename ParamGenerator<T8>::iterator& current8,
13173      const ParamGenerator<T9>& g9,
13174      const typename ParamGenerator<T9>::iterator& current9)
13175        : base_(base),
13176          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13177          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
13178          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
13179          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
13180          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
13181          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
13182          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
13183          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
13184          begin9_(g9.begin()), end9_(g9.end()), current9_(current9)    {
13185      ComputeCurrentValue();
13186    }
13187    virtual ~Iterator() {}
13188
13189    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13190      return base_;
13191    }
13192    // Advance should not be called on beyond-of-range iterators
13193    // so no component iterators must be beyond end of range, either.
13194    virtual void Advance() {
13195      assert(!AtEnd());
13196      ++current9_;
13197      if (current9_ == end9_) {
13198        current9_ = begin9_;
13199        ++current8_;
13200      }
13201      if (current8_ == end8_) {
13202        current8_ = begin8_;
13203        ++current7_;
13204      }
13205      if (current7_ == end7_) {
13206        current7_ = begin7_;
13207        ++current6_;
13208      }
13209      if (current6_ == end6_) {
13210        current6_ = begin6_;
13211        ++current5_;
13212      }
13213      if (current5_ == end5_) {
13214        current5_ = begin5_;
13215        ++current4_;
13216      }
13217      if (current4_ == end4_) {
13218        current4_ = begin4_;
13219        ++current3_;
13220      }
13221      if (current3_ == end3_) {
13222        current3_ = begin3_;
13223        ++current2_;
13224      }
13225      if (current2_ == end2_) {
13226        current2_ = begin2_;
13227        ++current1_;
13228      }
13229      ComputeCurrentValue();
13230    }
13231    virtual ParamIteratorInterface<ParamType>* Clone() const {
13232      return new Iterator(*this);
13233    }
13234    virtual const ParamType* Current() const { return &current_value_; }
13235    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13236      // Having the same base generator guarantees that the other
13237      // iterator is of the same type and we can downcast.
13238      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13239          << "The program attempted to compare iterators "
13240          << "from different generators." << std::endl;
13241      const Iterator* typed_other =
13242          CheckedDowncastToActualType<const Iterator>(&other);
13243      // We must report iterators equal if they both point beyond their
13244      // respective ranges. That can happen in a variety of fashions,
13245      // so we have to consult AtEnd().
13246      return (AtEnd() && typed_other->AtEnd()) ||
13247         (
13248          current1_ == typed_other->current1_ &&
13249          current2_ == typed_other->current2_ &&
13250          current3_ == typed_other->current3_ &&
13251          current4_ == typed_other->current4_ &&
13252          current5_ == typed_other->current5_ &&
13253          current6_ == typed_other->current6_ &&
13254          current7_ == typed_other->current7_ &&
13255          current8_ == typed_other->current8_ &&
13256          current9_ == typed_other->current9_);
13257    }
13258
13259   private:
13260    Iterator(const Iterator& other)
13261        : base_(other.base_),
13262        begin1_(other.begin1_),
13263        end1_(other.end1_),
13264        current1_(other.current1_),
13265        begin2_(other.begin2_),
13266        end2_(other.end2_),
13267        current2_(other.current2_),
13268        begin3_(other.begin3_),
13269        end3_(other.end3_),
13270        current3_(other.current3_),
13271        begin4_(other.begin4_),
13272        end4_(other.end4_),
13273        current4_(other.current4_),
13274        begin5_(other.begin5_),
13275        end5_(other.end5_),
13276        current5_(other.current5_),
13277        begin6_(other.begin6_),
13278        end6_(other.end6_),
13279        current6_(other.current6_),
13280        begin7_(other.begin7_),
13281        end7_(other.end7_),
13282        current7_(other.current7_),
13283        begin8_(other.begin8_),
13284        end8_(other.end8_),
13285        current8_(other.current8_),
13286        begin9_(other.begin9_),
13287        end9_(other.end9_),
13288        current9_(other.current9_) {
13289      ComputeCurrentValue();
13290    }
13291
13292    void ComputeCurrentValue() {
13293      if (!AtEnd())
13294        current_value_ = ParamType(*current1_, *current2_, *current3_,
13295            *current4_, *current5_, *current6_, *current7_, *current8_,
13296            *current9_);
13297    }
13298    bool AtEnd() const {
13299      // We must report iterator past the end of the range when either of the
13300      // component iterators has reached the end of its range.
13301      return
13302          current1_ == end1_ ||
13303          current2_ == end2_ ||
13304          current3_ == end3_ ||
13305          current4_ == end4_ ||
13306          current5_ == end5_ ||
13307          current6_ == end6_ ||
13308          current7_ == end7_ ||
13309          current8_ == end8_ ||
13310          current9_ == end9_;
13311    }
13312
13313    // No implementation - assignment is unsupported.
13314    void operator=(const Iterator& other);
13315
13316    const ParamGeneratorInterface<ParamType>* const base_;
13317    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13318    // current[i]_ is the actual traversing iterator.
13319    const typename ParamGenerator<T1>::iterator begin1_;
13320    const typename ParamGenerator<T1>::iterator end1_;
13321    typename ParamGenerator<T1>::iterator current1_;
13322    const typename ParamGenerator<T2>::iterator begin2_;
13323    const typename ParamGenerator<T2>::iterator end2_;
13324    typename ParamGenerator<T2>::iterator current2_;
13325    const typename ParamGenerator<T3>::iterator begin3_;
13326    const typename ParamGenerator<T3>::iterator end3_;
13327    typename ParamGenerator<T3>::iterator current3_;
13328    const typename ParamGenerator<T4>::iterator begin4_;
13329    const typename ParamGenerator<T4>::iterator end4_;
13330    typename ParamGenerator<T4>::iterator current4_;
13331    const typename ParamGenerator<T5>::iterator begin5_;
13332    const typename ParamGenerator<T5>::iterator end5_;
13333    typename ParamGenerator<T5>::iterator current5_;
13334    const typename ParamGenerator<T6>::iterator begin6_;
13335    const typename ParamGenerator<T6>::iterator end6_;
13336    typename ParamGenerator<T6>::iterator current6_;
13337    const typename ParamGenerator<T7>::iterator begin7_;
13338    const typename ParamGenerator<T7>::iterator end7_;
13339    typename ParamGenerator<T7>::iterator current7_;
13340    const typename ParamGenerator<T8>::iterator begin8_;
13341    const typename ParamGenerator<T8>::iterator end8_;
13342    typename ParamGenerator<T8>::iterator current8_;
13343    const typename ParamGenerator<T9>::iterator begin9_;
13344    const typename ParamGenerator<T9>::iterator end9_;
13345    typename ParamGenerator<T9>::iterator current9_;
13346    ParamType current_value_;
13347  };  // class CartesianProductGenerator9::Iterator
13348
13349  // No implementation - assignment is unsupported.
13350  void operator=(const CartesianProductGenerator9& other);
13351
13352  const ParamGenerator<T1> g1_;
13353  const ParamGenerator<T2> g2_;
13354  const ParamGenerator<T3> g3_;
13355  const ParamGenerator<T4> g4_;
13356  const ParamGenerator<T5> g5_;
13357  const ParamGenerator<T6> g6_;
13358  const ParamGenerator<T7> g7_;
13359  const ParamGenerator<T8> g8_;
13360  const ParamGenerator<T9> g9_;
13361};  // class CartesianProductGenerator9
13362
13363
13364template <typename T1, typename T2, typename T3, typename T4, typename T5,
13365    typename T6, typename T7, typename T8, typename T9, typename T10>
13366class CartesianProductGenerator10
13367    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
13368        T7, T8, T9, T10> > {
13369 public:
13370  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
13371
13372  CartesianProductGenerator10(const ParamGenerator<T1>& g1,
13373      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
13374      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
13375      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
13376      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
13377      const ParamGenerator<T10>& g10)
13378      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
13379          g9_(g9), g10_(g10) {}
13380  virtual ~CartesianProductGenerator10() {}
13381
13382  virtual ParamIteratorInterface<ParamType>* Begin() const {
13383    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
13384        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
13385        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
13386  }
13387  virtual ParamIteratorInterface<ParamType>* End() const {
13388    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
13389        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
13390        g8_.end(), g9_, g9_.end(), g10_, g10_.end());
13391  }
13392
13393 private:
13394  class Iterator : public ParamIteratorInterface<ParamType> {
13395   public:
13396    Iterator(const ParamGeneratorInterface<ParamType>* base,
13397      const ParamGenerator<T1>& g1,
13398      const typename ParamGenerator<T1>::iterator& current1,
13399      const ParamGenerator<T2>& g2,
13400      const typename ParamGenerator<T2>::iterator& current2,
13401      const ParamGenerator<T3>& g3,
13402      const typename ParamGenerator<T3>::iterator& current3,
13403      const ParamGenerator<T4>& g4,
13404      const typename ParamGenerator<T4>::iterator& current4,
13405      const ParamGenerator<T5>& g5,
13406      const typename ParamGenerator<T5>::iterator& current5,
13407      const ParamGenerator<T6>& g6,
13408      const typename ParamGenerator<T6>::iterator& current6,
13409      const ParamGenerator<T7>& g7,
13410      const typename ParamGenerator<T7>::iterator& current7,
13411      const ParamGenerator<T8>& g8,
13412      const typename ParamGenerator<T8>::iterator& current8,
13413      const ParamGenerator<T9>& g9,
13414      const typename ParamGenerator<T9>::iterator& current9,
13415      const ParamGenerator<T10>& g10,
13416      const typename ParamGenerator<T10>::iterator& current10)
13417        : base_(base),
13418          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13419          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
13420          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
13421          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
13422          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
13423          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
13424          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
13425          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
13426          begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
13427          begin10_(g10.begin()), end10_(g10.end()), current10_(current10)    {
13428      ComputeCurrentValue();
13429    }
13430    virtual ~Iterator() {}
13431
13432    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13433      return base_;
13434    }
13435    // Advance should not be called on beyond-of-range iterators
13436    // so no component iterators must be beyond end of range, either.
13437    virtual void Advance() {
13438      assert(!AtEnd());
13439      ++current10_;
13440      if (current10_ == end10_) {
13441        current10_ = begin10_;
13442        ++current9_;
13443      }
13444      if (current9_ == end9_) {
13445        current9_ = begin9_;
13446        ++current8_;
13447      }
13448      if (current8_ == end8_) {
13449        current8_ = begin8_;
13450        ++current7_;
13451      }
13452      if (current7_ == end7_) {
13453        current7_ = begin7_;
13454        ++current6_;
13455      }
13456      if (current6_ == end6_) {
13457        current6_ = begin6_;
13458        ++current5_;
13459      }
13460      if (current5_ == end5_) {
13461        current5_ = begin5_;
13462        ++current4_;
13463      }
13464      if (current4_ == end4_) {
13465        current4_ = begin4_;
13466        ++current3_;
13467      }
13468      if (current3_ == end3_) {
13469        current3_ = begin3_;
13470        ++current2_;
13471      }
13472      if (current2_ == end2_) {
13473        current2_ = begin2_;
13474        ++current1_;
13475      }
13476      ComputeCurrentValue();
13477    }
13478    virtual ParamIteratorInterface<ParamType>* Clone() const {
13479      return new Iterator(*this);
13480    }
13481    virtual const ParamType* Current() const { return &current_value_; }
13482    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13483      // Having the same base generator guarantees that the other
13484      // iterator is of the same type and we can downcast.
13485      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13486          << "The program attempted to compare iterators "
13487          << "from different generators." << std::endl;
13488      const Iterator* typed_other =
13489          CheckedDowncastToActualType<const Iterator>(&other);
13490      // We must report iterators equal if they both point beyond their
13491      // respective ranges. That can happen in a variety of fashions,
13492      // so we have to consult AtEnd().
13493      return (AtEnd() && typed_other->AtEnd()) ||
13494         (
13495          current1_ == typed_other->current1_ &&
13496          current2_ == typed_other->current2_ &&
13497          current3_ == typed_other->current3_ &&
13498          current4_ == typed_other->current4_ &&
13499          current5_ == typed_other->current5_ &&
13500          current6_ == typed_other->current6_ &&
13501          current7_ == typed_other->current7_ &&
13502          current8_ == typed_other->current8_ &&
13503          current9_ == typed_other->current9_ &&
13504          current10_ == typed_other->current10_);
13505    }
13506
13507   private:
13508    Iterator(const Iterator& other)
13509        : base_(other.base_),
13510        begin1_(other.begin1_),
13511        end1_(other.end1_),
13512        current1_(other.current1_),
13513        begin2_(other.begin2_),
13514        end2_(other.end2_),
13515        current2_(other.current2_),
13516        begin3_(other.begin3_),
13517        end3_(other.end3_),
13518        current3_(other.current3_),
13519        begin4_(other.begin4_),
13520        end4_(other.end4_),
13521        current4_(other.current4_),
13522        begin5_(other.begin5_),
13523        end5_(other.end5_),
13524        current5_(other.current5_),
13525        begin6_(other.begin6_),
13526        end6_(other.end6_),
13527        current6_(other.current6_),
13528        begin7_(other.begin7_),
13529        end7_(other.end7_),
13530        current7_(other.current7_),
13531        begin8_(other.begin8_),
13532        end8_(other.end8_),
13533        current8_(other.current8_),
13534        begin9_(other.begin9_),
13535        end9_(other.end9_),
13536        current9_(other.current9_),
13537        begin10_(other.begin10_),
13538        end10_(other.end10_),
13539        current10_(other.current10_) {
13540      ComputeCurrentValue();
13541    }
13542
13543    void ComputeCurrentValue() {
13544      if (!AtEnd())
13545        current_value_ = ParamType(*current1_, *current2_, *current3_,
13546            *current4_, *current5_, *current6_, *current7_, *current8_,
13547            *current9_, *current10_);
13548    }
13549    bool AtEnd() const {
13550      // We must report iterator past the end of the range when either of the
13551      // component iterators has reached the end of its range.
13552      return
13553          current1_ == end1_ ||
13554          current2_ == end2_ ||
13555          current3_ == end3_ ||
13556          current4_ == end4_ ||
13557          current5_ == end5_ ||
13558          current6_ == end6_ ||
13559          current7_ == end7_ ||
13560          current8_ == end8_ ||
13561          current9_ == end9_ ||
13562          current10_ == end10_;
13563    }
13564
13565    // No implementation - assignment is unsupported.
13566    void operator=(const Iterator& other);
13567
13568    const ParamGeneratorInterface<ParamType>* const base_;
13569    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13570    // current[i]_ is the actual traversing iterator.
13571    const typename ParamGenerator<T1>::iterator begin1_;
13572    const typename ParamGenerator<T1>::iterator end1_;
13573    typename ParamGenerator<T1>::iterator current1_;
13574    const typename ParamGenerator<T2>::iterator begin2_;
13575    const typename ParamGenerator<T2>::iterator end2_;
13576    typename ParamGenerator<T2>::iterator current2_;
13577    const typename ParamGenerator<T3>::iterator begin3_;
13578    const typename ParamGenerator<T3>::iterator end3_;
13579    typename ParamGenerator<T3>::iterator current3_;
13580    const typename ParamGenerator<T4>::iterator begin4_;
13581    const typename ParamGenerator<T4>::iterator end4_;
13582    typename ParamGenerator<T4>::iterator current4_;
13583    const typename ParamGenerator<T5>::iterator begin5_;
13584    const typename ParamGenerator<T5>::iterator end5_;
13585    typename ParamGenerator<T5>::iterator current5_;
13586    const typename ParamGenerator<T6>::iterator begin6_;
13587    const typename ParamGenerator<T6>::iterator end6_;
13588    typename ParamGenerator<T6>::iterator current6_;
13589    const typename ParamGenerator<T7>::iterator begin7_;
13590    const typename ParamGenerator<T7>::iterator end7_;
13591    typename ParamGenerator<T7>::iterator current7_;
13592    const typename ParamGenerator<T8>::iterator begin8_;
13593    const typename ParamGenerator<T8>::iterator end8_;
13594    typename ParamGenerator<T8>::iterator current8_;
13595    const typename ParamGenerator<T9>::iterator begin9_;
13596    const typename ParamGenerator<T9>::iterator end9_;
13597    typename ParamGenerator<T9>::iterator current9_;
13598    const typename ParamGenerator<T10>::iterator begin10_;
13599    const typename ParamGenerator<T10>::iterator end10_;
13600    typename ParamGenerator<T10>::iterator current10_;
13601    ParamType current_value_;
13602  };  // class CartesianProductGenerator10::Iterator
13603
13604  // No implementation - assignment is unsupported.
13605  void operator=(const CartesianProductGenerator10& other);
13606
13607  const ParamGenerator<T1> g1_;
13608  const ParamGenerator<T2> g2_;
13609  const ParamGenerator<T3> g3_;
13610  const ParamGenerator<T4> g4_;
13611  const ParamGenerator<T5> g5_;
13612  const ParamGenerator<T6> g6_;
13613  const ParamGenerator<T7> g7_;
13614  const ParamGenerator<T8> g8_;
13615  const ParamGenerator<T9> g9_;
13616  const ParamGenerator<T10> g10_;
13617};  // class CartesianProductGenerator10
13618
13619
13620// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
13621//
13622// Helper classes providing Combine() with polymorphic features. They allow
13623// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
13624// convertible to U.
13625//
13626template <class Generator1, class Generator2>
13627class CartesianProductHolder2 {
13628 public:
13629CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
13630      : g1_(g1), g2_(g2) {}
13631  template <typename T1, typename T2>
13632  operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
13633    return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
13634        new CartesianProductGenerator2<T1, T2>(
13635        static_cast<ParamGenerator<T1> >(g1_),
13636        static_cast<ParamGenerator<T2> >(g2_)));
13637  }
13638
13639 private:
13640  // No implementation - assignment is unsupported.
13641  void operator=(const CartesianProductHolder2& other);
13642
13643  const Generator1 g1_;
13644  const Generator2 g2_;
13645};  // class CartesianProductHolder2
13646
13647template <class Generator1, class Generator2, class Generator3>
13648class CartesianProductHolder3 {
13649 public:
13650CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
13651    const Generator3& g3)
13652      : g1_(g1), g2_(g2), g3_(g3) {}
13653  template <typename T1, typename T2, typename T3>
13654  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
13655    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
13656        new CartesianProductGenerator3<T1, T2, T3>(
13657        static_cast<ParamGenerator<T1> >(g1_),
13658        static_cast<ParamGenerator<T2> >(g2_),
13659        static_cast<ParamGenerator<T3> >(g3_)));
13660  }
13661
13662 private:
13663  // No implementation - assignment is unsupported.
13664  void operator=(const CartesianProductHolder3& other);
13665
13666  const Generator1 g1_;
13667  const Generator2 g2_;
13668  const Generator3 g3_;
13669};  // class CartesianProductHolder3
13670
13671template <class Generator1, class Generator2, class Generator3,
13672    class Generator4>
13673class CartesianProductHolder4 {
13674 public:
13675CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
13676    const Generator3& g3, const Generator4& g4)
13677      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
13678  template <typename T1, typename T2, typename T3, typename T4>
13679  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
13680    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
13681        new CartesianProductGenerator4<T1, T2, T3, T4>(
13682        static_cast<ParamGenerator<T1> >(g1_),
13683        static_cast<ParamGenerator<T2> >(g2_),
13684        static_cast<ParamGenerator<T3> >(g3_),
13685        static_cast<ParamGenerator<T4> >(g4_)));
13686  }
13687
13688 private:
13689  // No implementation - assignment is unsupported.
13690  void operator=(const CartesianProductHolder4& other);
13691
13692  const Generator1 g1_;
13693  const Generator2 g2_;
13694  const Generator3 g3_;
13695  const Generator4 g4_;
13696};  // class CartesianProductHolder4
13697
13698template <class Generator1, class Generator2, class Generator3,
13699    class Generator4, class Generator5>
13700class CartesianProductHolder5 {
13701 public:
13702CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
13703    const Generator3& g3, const Generator4& g4, const Generator5& g5)
13704      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
13705  template <typename T1, typename T2, typename T3, typename T4, typename T5>
13706  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
13707    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
13708        new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
13709        static_cast<ParamGenerator<T1> >(g1_),
13710        static_cast<ParamGenerator<T2> >(g2_),
13711        static_cast<ParamGenerator<T3> >(g3_),
13712        static_cast<ParamGenerator<T4> >(g4_),
13713        static_cast<ParamGenerator<T5> >(g5_)));
13714  }
13715
13716 private:
13717  // No implementation - assignment is unsupported.
13718  void operator=(const CartesianProductHolder5& other);
13719
13720  const Generator1 g1_;
13721  const Generator2 g2_;
13722  const Generator3 g3_;
13723  const Generator4 g4_;
13724  const Generator5 g5_;
13725};  // class CartesianProductHolder5
13726
13727template <class Generator1, class Generator2, class Generator3,
13728    class Generator4, class Generator5, class Generator6>
13729class CartesianProductHolder6 {
13730 public:
13731CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
13732    const Generator3& g3, const Generator4& g4, const Generator5& g5,
13733    const Generator6& g6)
13734      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
13735  template <typename T1, typename T2, typename T3, typename T4, typename T5,
13736      typename T6>
13737  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
13738    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
13739        new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
13740        static_cast<ParamGenerator<T1> >(g1_),
13741        static_cast<ParamGenerator<T2> >(g2_),
13742        static_cast<ParamGenerator<T3> >(g3_),
13743        static_cast<ParamGenerator<T4> >(g4_),
13744        static_cast<ParamGenerator<T5> >(g5_),
13745        static_cast<ParamGenerator<T6> >(g6_)));
13746  }
13747
13748 private:
13749  // No implementation - assignment is unsupported.
13750  void operator=(const CartesianProductHolder6& other);
13751
13752  const Generator1 g1_;
13753  const Generator2 g2_;
13754  const Generator3 g3_;
13755  const Generator4 g4_;
13756  const Generator5 g5_;
13757  const Generator6 g6_;
13758};  // class CartesianProductHolder6
13759
13760template <class Generator1, class Generator2, class Generator3,
13761    class Generator4, class Generator5, class Generator6, class Generator7>
13762class CartesianProductHolder7 {
13763 public:
13764CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
13765    const Generator3& g3, const Generator4& g4, const Generator5& g5,
13766    const Generator6& g6, const Generator7& g7)
13767      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
13768  template <typename T1, typename T2, typename T3, typename T4, typename T5,
13769      typename T6, typename T7>
13770  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
13771      T7> >() const {
13772    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
13773        new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
13774        static_cast<ParamGenerator<T1> >(g1_),
13775        static_cast<ParamGenerator<T2> >(g2_),
13776        static_cast<ParamGenerator<T3> >(g3_),
13777        static_cast<ParamGenerator<T4> >(g4_),
13778        static_cast<ParamGenerator<T5> >(g5_),
13779        static_cast<ParamGenerator<T6> >(g6_),
13780        static_cast<ParamGenerator<T7> >(g7_)));
13781  }
13782
13783 private:
13784  // No implementation - assignment is unsupported.
13785  void operator=(const CartesianProductHolder7& other);
13786
13787  const Generator1 g1_;
13788  const Generator2 g2_;
13789  const Generator3 g3_;
13790  const Generator4 g4_;
13791  const Generator5 g5_;
13792  const Generator6 g6_;
13793  const Generator7 g7_;
13794};  // class CartesianProductHolder7
13795
13796template <class Generator1, class Generator2, class Generator3,
13797    class Generator4, class Generator5, class Generator6, class Generator7,
13798    class Generator8>
13799class CartesianProductHolder8 {
13800 public:
13801CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
13802    const Generator3& g3, const Generator4& g4, const Generator5& g5,
13803    const Generator6& g6, const Generator7& g7, const Generator8& g8)
13804      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
13805          g8_(g8) {}
13806  template <typename T1, typename T2, typename T3, typename T4, typename T5,
13807      typename T6, typename T7, typename T8>
13808  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
13809      T8> >() const {
13810    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
13811        new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
13812        static_cast<ParamGenerator<T1> >(g1_),
13813        static_cast<ParamGenerator<T2> >(g2_),
13814        static_cast<ParamGenerator<T3> >(g3_),
13815        static_cast<ParamGenerator<T4> >(g4_),
13816        static_cast<ParamGenerator<T5> >(g5_),
13817        static_cast<ParamGenerator<T6> >(g6_),
13818        static_cast<ParamGenerator<T7> >(g7_),
13819        static_cast<ParamGenerator<T8> >(g8_)));
13820  }
13821
13822 private:
13823  // No implementation - assignment is unsupported.
13824  void operator=(const CartesianProductHolder8& other);
13825
13826  const Generator1 g1_;
13827  const Generator2 g2_;
13828  const Generator3 g3_;
13829  const Generator4 g4_;
13830  const Generator5 g5_;
13831  const Generator6 g6_;
13832  const Generator7 g7_;
13833  const Generator8 g8_;
13834};  // class CartesianProductHolder8
13835
13836template <class Generator1, class Generator2, class Generator3,
13837    class Generator4, class Generator5, class Generator6, class Generator7,
13838    class Generator8, class Generator9>
13839class CartesianProductHolder9 {
13840 public:
13841CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
13842    const Generator3& g3, const Generator4& g4, const Generator5& g5,
13843    const Generator6& g6, const Generator7& g7, const Generator8& g8,
13844    const Generator9& g9)
13845      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
13846          g9_(g9) {}
13847  template <typename T1, typename T2, typename T3, typename T4, typename T5,
13848      typename T6, typename T7, typename T8, typename T9>
13849  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
13850      T9> >() const {
13851    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
13852        T9> >(
13853        new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
13854        static_cast<ParamGenerator<T1> >(g1_),
13855        static_cast<ParamGenerator<T2> >(g2_),
13856        static_cast<ParamGenerator<T3> >(g3_),
13857        static_cast<ParamGenerator<T4> >(g4_),
13858        static_cast<ParamGenerator<T5> >(g5_),
13859        static_cast<ParamGenerator<T6> >(g6_),
13860        static_cast<ParamGenerator<T7> >(g7_),
13861        static_cast<ParamGenerator<T8> >(g8_),
13862        static_cast<ParamGenerator<T9> >(g9_)));
13863  }
13864
13865 private:
13866  // No implementation - assignment is unsupported.
13867  void operator=(const CartesianProductHolder9& other);
13868
13869  const Generator1 g1_;
13870  const Generator2 g2_;
13871  const Generator3 g3_;
13872  const Generator4 g4_;
13873  const Generator5 g5_;
13874  const Generator6 g6_;
13875  const Generator7 g7_;
13876  const Generator8 g8_;
13877  const Generator9 g9_;
13878};  // class CartesianProductHolder9
13879
13880template <class Generator1, class Generator2, class Generator3,
13881    class Generator4, class Generator5, class Generator6, class Generator7,
13882    class Generator8, class Generator9, class Generator10>
13883class CartesianProductHolder10 {
13884 public:
13885CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
13886    const Generator3& g3, const Generator4& g4, const Generator5& g5,
13887    const Generator6& g6, const Generator7& g7, const Generator8& g8,
13888    const Generator9& g9, const Generator10& g10)
13889      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
13890          g9_(g9), g10_(g10) {}
13891  template <typename T1, typename T2, typename T3, typename T4, typename T5,
13892      typename T6, typename T7, typename T8, typename T9, typename T10>
13893  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
13894      T9, T10> >() const {
13895    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
13896        T9, T10> >(
13897        new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
13898            T10>(
13899        static_cast<ParamGenerator<T1> >(g1_),
13900        static_cast<ParamGenerator<T2> >(g2_),
13901        static_cast<ParamGenerator<T3> >(g3_),
13902        static_cast<ParamGenerator<T4> >(g4_),
13903        static_cast<ParamGenerator<T5> >(g5_),
13904        static_cast<ParamGenerator<T6> >(g6_),
13905        static_cast<ParamGenerator<T7> >(g7_),
13906        static_cast<ParamGenerator<T8> >(g8_),
13907        static_cast<ParamGenerator<T9> >(g9_),
13908        static_cast<ParamGenerator<T10> >(g10_)));
13909  }
13910
13911 private:
13912  // No implementation - assignment is unsupported.
13913  void operator=(const CartesianProductHolder10& other);
13914
13915  const Generator1 g1_;
13916  const Generator2 g2_;
13917  const Generator3 g3_;
13918  const Generator4 g4_;
13919  const Generator5 g5_;
13920  const Generator6 g6_;
13921  const Generator7 g7_;
13922  const Generator8 g8_;
13923  const Generator9 g9_;
13924  const Generator10 g10_;
13925};  // class CartesianProductHolder10
13926
13927#endif  // GTEST_HAS_COMBINE
13928
13929}  // namespace internal
13930}  // namespace testing
13931
13932#endif  //  GTEST_HAS_PARAM_TEST
13933
13934#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
13935
13936#if GTEST_HAS_PARAM_TEST
13937
13938namespace testing {
13939
13940// Functions producing parameter generators.
13941//
13942// Google Test uses these generators to produce parameters for value-
13943// parameterized tests. When a parameterized test case is instantiated
13944// with a particular generator, Google Test creates and runs tests
13945// for each element in the sequence produced by the generator.
13946//
13947// In the following sample, tests from test case FooTest are instantiated
13948// each three times with parameter values 3, 5, and 8:
13949//
13950// class FooTest : public TestWithParam<int> { ... };
13951//
13952// TEST_P(FooTest, TestThis) {
13953// }
13954// TEST_P(FooTest, TestThat) {
13955// }
13956// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
13957//
13958
13959// Range() returns generators providing sequences of values in a range.
13960//
13961// Synopsis:
13962// Range(start, end)
13963//   - returns a generator producing a sequence of values {start, start+1,
13964//     start+2, ..., }.
13965// Range(start, end, step)
13966//   - returns a generator producing a sequence of values {start, start+step,
13967//     start+step+step, ..., }.
13968// Notes:
13969//   * The generated sequences never include end. For example, Range(1, 5)
13970//     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
13971//     returns a generator producing {1, 3, 5, 7}.
13972//   * start and end must have the same type. That type may be any integral or
13973//     floating-point type or a user defined type satisfying these conditions:
13974//     * It must be assignable (have operator=() defined).
13975//     * It must have operator+() (operator+(int-compatible type) for
13976//       two-operand version).
13977//     * It must have operator<() defined.
13978//     Elements in the resulting sequences will also have that type.
13979//   * Condition start < end must be satisfied in order for resulting sequences
13980//     to contain any elements.
13981//
13982template <typename T, typename IncrementT>
13983internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
13984  return internal::ParamGenerator<T>(
13985      new internal::RangeGenerator<T, IncrementT>(start, end, step));
13986}
13987
13988template <typename T>
13989internal::ParamGenerator<T> Range(T start, T end) {
13990  return Range(start, end, 1);
13991}
13992
13993// ValuesIn() function allows generation of tests with parameters coming from
13994// a container.
13995//
13996// Synopsis:
13997// ValuesIn(const T (&array)[N])
13998//   - returns a generator producing sequences with elements from
13999//     a C-style array.
14000// ValuesIn(const Container& container)
14001//   - returns a generator producing sequences with elements from
14002//     an STL-style container.
14003// ValuesIn(Iterator begin, Iterator end)
14004//   - returns a generator producing sequences with elements from
14005//     a range [begin, end) defined by a pair of STL-style iterators. These
14006//     iterators can also be plain C pointers.
14007//
14008// Please note that ValuesIn copies the values from the containers
14009// passed in and keeps them to generate tests in RUN_ALL_TESTS().
14010//
14011// Examples:
14012//
14013// This instantiates tests from test case StringTest
14014// each with C-string values of "foo", "bar", and "baz":
14015//
14016// const char* strings[] = {"foo", "bar", "baz"};
14017// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
14018//
14019// This instantiates tests from test case StlStringTest
14020// each with STL strings with values "a" and "b":
14021//
14022// ::std::vector< ::std::string> GetParameterStrings() {
14023//   ::std::vector< ::std::string> v;
14024//   v.push_back("a");
14025//   v.push_back("b");
14026//   return v;
14027// }
14028//
14029// INSTANTIATE_TEST_CASE_P(CharSequence,
14030//                         StlStringTest,
14031//                         ValuesIn(GetParameterStrings()));
14032//
14033//
14034// This will also instantiate tests from CharTest
14035// each with parameter values 'a' and 'b':
14036//
14037// ::std::list<char> GetParameterChars() {
14038//   ::std::list<char> list;
14039//   list.push_back('a');
14040//   list.push_back('b');
14041//   return list;
14042// }
14043// ::std::list<char> l = GetParameterChars();
14044// INSTANTIATE_TEST_CASE_P(CharSequence2,
14045//                         CharTest,
14046//                         ValuesIn(l.begin(), l.end()));
14047//
14048template <typename ForwardIterator>
14049internal::ParamGenerator<
14050    typename ::std::iterator_traits<ForwardIterator>::value_type> ValuesIn(
14051  ForwardIterator begin,
14052  ForwardIterator end) {
14053  typedef typename ::std::iterator_traits<ForwardIterator>::value_type
14054      ParamType;
14055  return internal::ParamGenerator<ParamType>(
14056      new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
14057}
14058
14059template <typename T, size_t N>
14060internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
14061  return ValuesIn(array, array + N);
14062}
14063
14064template <class Container>
14065internal::ParamGenerator<typename Container::value_type> ValuesIn(
14066    const Container& container) {
14067  return ValuesIn(container.begin(), container.end());
14068}
14069
14070// Values() allows generating tests from explicitly specified list of
14071// parameters.
14072//
14073// Synopsis:
14074// Values(T v1, T v2, ..., T vN)
14075//   - returns a generator producing sequences with elements v1, v2, ..., vN.
14076//
14077// For example, this instantiates tests from test case BarTest each
14078// with values "one", "two", and "three":
14079//
14080// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
14081//
14082// This instantiates tests from test case BazTest each with values 1, 2, 3.5.
14083// The exact type of values will depend on the type of parameter in BazTest.
14084//
14085// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
14086//
14087// Currently, Values() supports from 1 to 50 parameters.
14088//
14089template <typename T1>
14090internal::ValueArray1<T1> Values(T1 v1) {
14091  return internal::ValueArray1<T1>(v1);
14092}
14093
14094template <typename T1, typename T2>
14095internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
14096  return internal::ValueArray2<T1, T2>(v1, v2);
14097}
14098
14099template <typename T1, typename T2, typename T3>
14100internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
14101  return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
14102}
14103
14104template <typename T1, typename T2, typename T3, typename T4>
14105internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
14106  return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
14107}
14108
14109template <typename T1, typename T2, typename T3, typename T4, typename T5>
14110internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
14111    T5 v5) {
14112  return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
14113}
14114
14115template <typename T1, typename T2, typename T3, typename T4, typename T5,
14116    typename T6>
14117internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
14118    T4 v4, T5 v5, T6 v6) {
14119  return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
14120}
14121
14122template <typename T1, typename T2, typename T3, typename T4, typename T5,
14123    typename T6, typename T7>
14124internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
14125    T4 v4, T5 v5, T6 v6, T7 v7) {
14126  return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
14127      v6, v7);
14128}
14129
14130template <typename T1, typename T2, typename T3, typename T4, typename T5,
14131    typename T6, typename T7, typename T8>
14132internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
14133    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
14134  return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
14135      v5, v6, v7, v8);
14136}
14137
14138template <typename T1, typename T2, typename T3, typename T4, typename T5,
14139    typename T6, typename T7, typename T8, typename T9>
14140internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
14141    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
14142  return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
14143      v4, v5, v6, v7, v8, v9);
14144}
14145
14146template <typename T1, typename T2, typename T3, typename T4, typename T5,
14147    typename T6, typename T7, typename T8, typename T9, typename T10>
14148internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
14149    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
14150  return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
14151      v2, v3, v4, v5, v6, v7, v8, v9, v10);
14152}
14153
14154template <typename T1, typename T2, typename T3, typename T4, typename T5,
14155    typename T6, typename T7, typename T8, typename T9, typename T10,
14156    typename T11>
14157internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
14158    T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14159    T10 v10, T11 v11) {
14160  return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
14161      T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
14162}
14163
14164template <typename T1, typename T2, typename T3, typename T4, typename T5,
14165    typename T6, typename T7, typename T8, typename T9, typename T10,
14166    typename T11, typename T12>
14167internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14168    T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14169    T10 v10, T11 v11, T12 v12) {
14170  return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14171      T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
14172}
14173
14174template <typename T1, typename T2, typename T3, typename T4, typename T5,
14175    typename T6, typename T7, typename T8, typename T9, typename T10,
14176    typename T11, typename T12, typename T13>
14177internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
14178    T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14179    T10 v10, T11 v11, T12 v12, T13 v13) {
14180  return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14181      T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
14182}
14183
14184template <typename T1, typename T2, typename T3, typename T4, typename T5,
14185    typename T6, typename T7, typename T8, typename T9, typename T10,
14186    typename T11, typename T12, typename T13, typename T14>
14187internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14188    T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14189    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
14190  return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14191      T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
14192      v14);
14193}
14194
14195template <typename T1, typename T2, typename T3, typename T4, typename T5,
14196    typename T6, typename T7, typename T8, typename T9, typename T10,
14197    typename T11, typename T12, typename T13, typename T14, typename T15>
14198internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14199    T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
14200    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
14201  return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14202      T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
14203      v13, v14, v15);
14204}
14205
14206template <typename T1, typename T2, typename T3, typename T4, typename T5,
14207    typename T6, typename T7, typename T8, typename T9, typename T10,
14208    typename T11, typename T12, typename T13, typename T14, typename T15,
14209    typename T16>
14210internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14211    T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
14212    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
14213    T16 v16) {
14214  return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14215      T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
14216      v12, v13, v14, v15, v16);
14217}
14218
14219template <typename T1, typename T2, typename T3, typename T4, typename T5,
14220    typename T6, typename T7, typename T8, typename T9, typename T10,
14221    typename T11, typename T12, typename T13, typename T14, typename T15,
14222    typename T16, typename T17>
14223internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14224    T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
14225    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
14226    T16 v16, T17 v17) {
14227  return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14228      T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
14229      v11, v12, v13, v14, v15, v16, v17);
14230}
14231
14232template <typename T1, typename T2, typename T3, typename T4, typename T5,
14233    typename T6, typename T7, typename T8, typename T9, typename T10,
14234    typename T11, typename T12, typename T13, typename T14, typename T15,
14235    typename T16, typename T17, typename T18>
14236internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14237    T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
14238    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
14239    T16 v16, T17 v17, T18 v18) {
14240  return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14241      T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
14242      v10, v11, v12, v13, v14, v15, v16, v17, v18);
14243}
14244
14245template <typename T1, typename T2, typename T3, typename T4, typename T5,
14246    typename T6, typename T7, typename T8, typename T9, typename T10,
14247    typename T11, typename T12, typename T13, typename T14, typename T15,
14248    typename T16, typename T17, typename T18, typename T19>
14249internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14250    T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
14251    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
14252    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
14253  return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14254      T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
14255      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
14256}
14257
14258template <typename T1, typename T2, typename T3, typename T4, typename T5,
14259    typename T6, typename T7, typename T8, typename T9, typename T10,
14260    typename T11, typename T12, typename T13, typename T14, typename T15,
14261    typename T16, typename T17, typename T18, typename T19, typename T20>
14262internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14263    T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
14264    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
14265    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
14266  return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14267      T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
14268      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
14269}
14270
14271template <typename T1, typename T2, typename T3, typename T4, typename T5,
14272    typename T6, typename T7, typename T8, typename T9, typename T10,
14273    typename T11, typename T12, typename T13, typename T14, typename T15,
14274    typename T16, typename T17, typename T18, typename T19, typename T20,
14275    typename T21>
14276internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14277    T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
14278    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
14279    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
14280  return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14281      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
14282      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
14283}
14284
14285template <typename T1, typename T2, typename T3, typename T4, typename T5,
14286    typename T6, typename T7, typename T8, typename T9, typename T10,
14287    typename T11, typename T12, typename T13, typename T14, typename T15,
14288    typename T16, typename T17, typename T18, typename T19, typename T20,
14289    typename T21, typename T22>
14290internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14291    T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
14292    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
14293    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
14294    T21 v21, T22 v22) {
14295  return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14296      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
14297      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
14298      v20, v21, v22);
14299}
14300
14301template <typename T1, typename T2, typename T3, typename T4, typename T5,
14302    typename T6, typename T7, typename T8, typename T9, typename T10,
14303    typename T11, typename T12, typename T13, typename T14, typename T15,
14304    typename T16, typename T17, typename T18, typename T19, typename T20,
14305    typename T21, typename T22, typename T23>
14306internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14307    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
14308    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
14309    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
14310    T21 v21, T22 v22, T23 v23) {
14311  return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14312      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
14313      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
14314      v20, v21, v22, v23);
14315}
14316
14317template <typename T1, typename T2, typename T3, typename T4, typename T5,
14318    typename T6, typename T7, typename T8, typename T9, typename T10,
14319    typename T11, typename T12, typename T13, typename T14, typename T15,
14320    typename T16, typename T17, typename T18, typename T19, typename T20,
14321    typename T21, typename T22, typename T23, typename T24>
14322internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14323    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
14324    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
14325    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
14326    T21 v21, T22 v22, T23 v23, T24 v24) {
14327  return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14328      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
14329      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
14330      v19, v20, v21, v22, v23, v24);
14331}
14332
14333template <typename T1, typename T2, typename T3, typename T4, typename T5,
14334    typename T6, typename T7, typename T8, typename T9, typename T10,
14335    typename T11, typename T12, typename T13, typename T14, typename T15,
14336    typename T16, typename T17, typename T18, typename T19, typename T20,
14337    typename T21, typename T22, typename T23, typename T24, typename T25>
14338internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14339    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
14340    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
14341    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
14342    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
14343  return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14344      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
14345      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
14346      v18, v19, v20, v21, v22, v23, v24, v25);
14347}
14348
14349template <typename T1, typename T2, typename T3, typename T4, typename T5,
14350    typename T6, typename T7, typename T8, typename T9, typename T10,
14351    typename T11, typename T12, typename T13, typename T14, typename T15,
14352    typename T16, typename T17, typename T18, typename T19, typename T20,
14353    typename T21, typename T22, typename T23, typename T24, typename T25,
14354    typename T26>
14355internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14356    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14357    T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14358    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14359    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14360    T26 v26) {
14361  return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14362      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14363      T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
14364      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
14365}
14366
14367template <typename T1, typename T2, typename T3, typename T4, typename T5,
14368    typename T6, typename T7, typename T8, typename T9, typename T10,
14369    typename T11, typename T12, typename T13, typename T14, typename T15,
14370    typename T16, typename T17, typename T18, typename T19, typename T20,
14371    typename T21, typename T22, typename T23, typename T24, typename T25,
14372    typename T26, typename T27>
14373internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14374    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
14375    T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14376    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14377    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14378    T26 v26, T27 v27) {
14379  return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14380      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14381      T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
14382      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
14383}
14384
14385template <typename T1, typename T2, typename T3, typename T4, typename T5,
14386    typename T6, typename T7, typename T8, typename T9, typename T10,
14387    typename T11, typename T12, typename T13, typename T14, typename T15,
14388    typename T16, typename T17, typename T18, typename T19, typename T20,
14389    typename T21, typename T22, typename T23, typename T24, typename T25,
14390    typename T26, typename T27, typename T28>
14391internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14392    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
14393    T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14394    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14395    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14396    T26 v26, T27 v27, T28 v28) {
14397  return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14398      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14399      T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
14400      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
14401      v28);
14402}
14403
14404template <typename T1, typename T2, typename T3, typename T4, typename T5,
14405    typename T6, typename T7, typename T8, typename T9, typename T10,
14406    typename T11, typename T12, typename T13, typename T14, typename T15,
14407    typename T16, typename T17, typename T18, typename T19, typename T20,
14408    typename T21, typename T22, typename T23, typename T24, typename T25,
14409    typename T26, typename T27, typename T28, typename T29>
14410internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14411    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14412    T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14413    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14414    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14415    T26 v26, T27 v27, T28 v28, T29 v29) {
14416  return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14417      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14418      T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
14419      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
14420      v27, v28, v29);
14421}
14422
14423template <typename T1, typename T2, typename T3, typename T4, typename T5,
14424    typename T6, typename T7, typename T8, typename T9, typename T10,
14425    typename T11, typename T12, typename T13, typename T14, typename T15,
14426    typename T16, typename T17, typename T18, typename T19, typename T20,
14427    typename T21, typename T22, typename T23, typename T24, typename T25,
14428    typename T26, typename T27, typename T28, typename T29, typename T30>
14429internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14430    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14431    T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
14432    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
14433    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
14434    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
14435  return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14436      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14437      T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
14438      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
14439      v26, v27, v28, v29, v30);
14440}
14441
14442template <typename T1, typename T2, typename T3, typename T4, typename T5,
14443    typename T6, typename T7, typename T8, typename T9, typename T10,
14444    typename T11, typename T12, typename T13, typename T14, typename T15,
14445    typename T16, typename T17, typename T18, typename T19, typename T20,
14446    typename T21, typename T22, typename T23, typename T24, typename T25,
14447    typename T26, typename T27, typename T28, typename T29, typename T30,
14448    typename T31>
14449internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14450    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14451    T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
14452    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
14453    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
14454    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
14455  return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14456      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14457      T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
14458      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
14459      v25, v26, v27, v28, v29, v30, v31);
14460}
14461
14462template <typename T1, typename T2, typename T3, typename T4, typename T5,
14463    typename T6, typename T7, typename T8, typename T9, typename T10,
14464    typename T11, typename T12, typename T13, typename T14, typename T15,
14465    typename T16, typename T17, typename T18, typename T19, typename T20,
14466    typename T21, typename T22, typename T23, typename T24, typename T25,
14467    typename T26, typename T27, typename T28, typename T29, typename T30,
14468    typename T31, typename T32>
14469internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14470    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14471    T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
14472    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
14473    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
14474    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
14475    T32 v32) {
14476  return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14477      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14478      T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
14479      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
14480      v24, v25, v26, v27, v28, v29, v30, v31, v32);
14481}
14482
14483template <typename T1, typename T2, typename T3, typename T4, typename T5,
14484    typename T6, typename T7, typename T8, typename T9, typename T10,
14485    typename T11, typename T12, typename T13, typename T14, typename T15,
14486    typename T16, typename T17, typename T18, typename T19, typename T20,
14487    typename T21, typename T22, typename T23, typename T24, typename T25,
14488    typename T26, typename T27, typename T28, typename T29, typename T30,
14489    typename T31, typename T32, typename T33>
14490internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14491    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14492    T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
14493    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
14494    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
14495    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
14496    T32 v32, T33 v33) {
14497  return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14498      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14499      T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
14500      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
14501      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
14502}
14503
14504template <typename T1, typename T2, typename T3, typename T4, typename T5,
14505    typename T6, typename T7, typename T8, typename T9, typename T10,
14506    typename T11, typename T12, typename T13, typename T14, typename T15,
14507    typename T16, typename T17, typename T18, typename T19, typename T20,
14508    typename T21, typename T22, typename T23, typename T24, typename T25,
14509    typename T26, typename T27, typename T28, typename T29, typename T30,
14510    typename T31, typename T32, typename T33, typename T34>
14511internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14512    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14513    T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
14514    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
14515    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
14516    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
14517    T31 v31, T32 v32, T33 v33, T34 v34) {
14518  return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14519      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14520      T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
14521      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
14522      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
14523}
14524
14525template <typename T1, typename T2, typename T3, typename T4, typename T5,
14526    typename T6, typename T7, typename T8, typename T9, typename T10,
14527    typename T11, typename T12, typename T13, typename T14, typename T15,
14528    typename T16, typename T17, typename T18, typename T19, typename T20,
14529    typename T21, typename T22, typename T23, typename T24, typename T25,
14530    typename T26, typename T27, typename T28, typename T29, typename T30,
14531    typename T31, typename T32, typename T33, typename T34, typename T35>
14532internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14533    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14534    T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
14535    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
14536    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
14537    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
14538    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
14539  return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14540      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14541      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
14542      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
14543      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
14544}
14545
14546template <typename T1, typename T2, typename T3, typename T4, typename T5,
14547    typename T6, typename T7, typename T8, typename T9, typename T10,
14548    typename T11, typename T12, typename T13, typename T14, typename T15,
14549    typename T16, typename T17, typename T18, typename T19, typename T20,
14550    typename T21, typename T22, typename T23, typename T24, typename T25,
14551    typename T26, typename T27, typename T28, typename T29, typename T30,
14552    typename T31, typename T32, typename T33, typename T34, typename T35,
14553    typename T36>
14554internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14555    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14556    T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
14557    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
14558    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
14559    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
14560    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
14561  return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14562      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14563      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
14564      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
14565      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
14566      v34, v35, v36);
14567}
14568
14569template <typename T1, typename T2, typename T3, typename T4, typename T5,
14570    typename T6, typename T7, typename T8, typename T9, typename T10,
14571    typename T11, typename T12, typename T13, typename T14, typename T15,
14572    typename T16, typename T17, typename T18, typename T19, typename T20,
14573    typename T21, typename T22, typename T23, typename T24, typename T25,
14574    typename T26, typename T27, typename T28, typename T29, typename T30,
14575    typename T31, typename T32, typename T33, typename T34, typename T35,
14576    typename T36, typename T37>
14577internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14578    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14579    T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
14580    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
14581    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
14582    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
14583    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
14584    T37 v37) {
14585  return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14586      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14587      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
14588      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
14589      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
14590      v34, v35, v36, v37);
14591}
14592
14593template <typename T1, typename T2, typename T3, typename T4, typename T5,
14594    typename T6, typename T7, typename T8, typename T9, typename T10,
14595    typename T11, typename T12, typename T13, typename T14, typename T15,
14596    typename T16, typename T17, typename T18, typename T19, typename T20,
14597    typename T21, typename T22, typename T23, typename T24, typename T25,
14598    typename T26, typename T27, typename T28, typename T29, typename T30,
14599    typename T31, typename T32, typename T33, typename T34, typename T35,
14600    typename T36, typename T37, typename T38>
14601internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14602    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14603    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
14604    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
14605    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
14606    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
14607    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
14608    T37 v37, T38 v38) {
14609  return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14610      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14611      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
14612      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
14613      v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
14614      v33, v34, v35, v36, v37, v38);
14615}
14616
14617template <typename T1, typename T2, typename T3, typename T4, typename T5,
14618    typename T6, typename T7, typename T8, typename T9, typename T10,
14619    typename T11, typename T12, typename T13, typename T14, typename T15,
14620    typename T16, typename T17, typename T18, typename T19, typename T20,
14621    typename T21, typename T22, typename T23, typename T24, typename T25,
14622    typename T26, typename T27, typename T28, typename T29, typename T30,
14623    typename T31, typename T32, typename T33, typename T34, typename T35,
14624    typename T36, typename T37, typename T38, typename T39>
14625internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14626    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14627    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
14628    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
14629    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
14630    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
14631    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
14632    T37 v37, T38 v38, T39 v39) {
14633  return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14634      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14635      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
14636      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
14637      v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
14638      v32, v33, v34, v35, v36, v37, v38, v39);
14639}
14640
14641template <typename T1, typename T2, typename T3, typename T4, typename T5,
14642    typename T6, typename T7, typename T8, typename T9, typename T10,
14643    typename T11, typename T12, typename T13, typename T14, typename T15,
14644    typename T16, typename T17, typename T18, typename T19, typename T20,
14645    typename T21, typename T22, typename T23, typename T24, typename T25,
14646    typename T26, typename T27, typename T28, typename T29, typename T30,
14647    typename T31, typename T32, typename T33, typename T34, typename T35,
14648    typename T36, typename T37, typename T38, typename T39, typename T40>
14649internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14650    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14651    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
14652    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
14653    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
14654    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
14655    T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
14656    T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
14657  return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14658      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14659      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
14660      T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
14661      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
14662      v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
14663}
14664
14665template <typename T1, typename T2, typename T3, typename T4, typename T5,
14666    typename T6, typename T7, typename T8, typename T9, typename T10,
14667    typename T11, typename T12, typename T13, typename T14, typename T15,
14668    typename T16, typename T17, typename T18, typename T19, typename T20,
14669    typename T21, typename T22, typename T23, typename T24, typename T25,
14670    typename T26, typename T27, typename T28, typename T29, typename T30,
14671    typename T31, typename T32, typename T33, typename T34, typename T35,
14672    typename T36, typename T37, typename T38, typename T39, typename T40,
14673    typename T41>
14674internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14675    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14676    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
14677    T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14678    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14679    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14680    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14681    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
14682  return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14683      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14684      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
14685      T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
14686      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
14687      v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
14688}
14689
14690template <typename T1, typename T2, typename T3, typename T4, typename T5,
14691    typename T6, typename T7, typename T8, typename T9, typename T10,
14692    typename T11, typename T12, typename T13, typename T14, typename T15,
14693    typename T16, typename T17, typename T18, typename T19, typename T20,
14694    typename T21, typename T22, typename T23, typename T24, typename T25,
14695    typename T26, typename T27, typename T28, typename T29, typename T30,
14696    typename T31, typename T32, typename T33, typename T34, typename T35,
14697    typename T36, typename T37, typename T38, typename T39, typename T40,
14698    typename T41, typename T42>
14699internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14700    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14701    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
14702    T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14703    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14704    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14705    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14706    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14707    T42 v42) {
14708  return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14709      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14710      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
14711      T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
14712      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
14713      v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
14714      v42);
14715}
14716
14717template <typename T1, typename T2, typename T3, typename T4, typename T5,
14718    typename T6, typename T7, typename T8, typename T9, typename T10,
14719    typename T11, typename T12, typename T13, typename T14, typename T15,
14720    typename T16, typename T17, typename T18, typename T19, typename T20,
14721    typename T21, typename T22, typename T23, typename T24, typename T25,
14722    typename T26, typename T27, typename T28, typename T29, typename T30,
14723    typename T31, typename T32, typename T33, typename T34, typename T35,
14724    typename T36, typename T37, typename T38, typename T39, typename T40,
14725    typename T41, typename T42, typename T43>
14726internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14727    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14728    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
14729    T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14730    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14731    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14732    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14733    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14734    T42 v42, T43 v43) {
14735  return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14736      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14737      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
14738      T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
14739      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
14740      v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
14741      v41, v42, v43);
14742}
14743
14744template <typename T1, typename T2, typename T3, typename T4, typename T5,
14745    typename T6, typename T7, typename T8, typename T9, typename T10,
14746    typename T11, typename T12, typename T13, typename T14, typename T15,
14747    typename T16, typename T17, typename T18, typename T19, typename T20,
14748    typename T21, typename T22, typename T23, typename T24, typename T25,
14749    typename T26, typename T27, typename T28, typename T29, typename T30,
14750    typename T31, typename T32, typename T33, typename T34, typename T35,
14751    typename T36, typename T37, typename T38, typename T39, typename T40,
14752    typename T41, typename T42, typename T43, typename T44>
14753internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14754    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14755    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
14756    T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
14757    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
14758    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
14759    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
14760    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
14761    T42 v42, T43 v43, T44 v44) {
14762  return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14763      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14764      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
14765      T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
14766      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
14767      v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
14768      v40, v41, v42, v43, v44);
14769}
14770
14771template <typename T1, typename T2, typename T3, typename T4, typename T5,
14772    typename T6, typename T7, typename T8, typename T9, typename T10,
14773    typename T11, typename T12, typename T13, typename T14, typename T15,
14774    typename T16, typename T17, typename T18, typename T19, typename T20,
14775    typename T21, typename T22, typename T23, typename T24, typename T25,
14776    typename T26, typename T27, typename T28, typename T29, typename T30,
14777    typename T31, typename T32, typename T33, typename T34, typename T35,
14778    typename T36, typename T37, typename T38, typename T39, typename T40,
14779    typename T41, typename T42, typename T43, typename T44, typename T45>
14780internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14781    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14782    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
14783    T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
14784    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
14785    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
14786    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
14787    T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
14788    T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
14789  return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14790      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14791      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
14792      T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
14793      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
14794      v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
14795      v39, v40, v41, v42, v43, v44, v45);
14796}
14797
14798template <typename T1, typename T2, typename T3, typename T4, typename T5,
14799    typename T6, typename T7, typename T8, typename T9, typename T10,
14800    typename T11, typename T12, typename T13, typename T14, typename T15,
14801    typename T16, typename T17, typename T18, typename T19, typename T20,
14802    typename T21, typename T22, typename T23, typename T24, typename T25,
14803    typename T26, typename T27, typename T28, typename T29, typename T30,
14804    typename T31, typename T32, typename T33, typename T34, typename T35,
14805    typename T36, typename T37, typename T38, typename T39, typename T40,
14806    typename T41, typename T42, typename T43, typename T44, typename T45,
14807    typename T46>
14808internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14809    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14810    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
14811    T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
14812    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
14813    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
14814    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
14815    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
14816    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
14817  return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14818      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14819      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
14820      T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
14821      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
14822      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
14823      v38, v39, v40, v41, v42, v43, v44, v45, v46);
14824}
14825
14826template <typename T1, typename T2, typename T3, typename T4, typename T5,
14827    typename T6, typename T7, typename T8, typename T9, typename T10,
14828    typename T11, typename T12, typename T13, typename T14, typename T15,
14829    typename T16, typename T17, typename T18, typename T19, typename T20,
14830    typename T21, typename T22, typename T23, typename T24, typename T25,
14831    typename T26, typename T27, typename T28, typename T29, typename T30,
14832    typename T31, typename T32, typename T33, typename T34, typename T35,
14833    typename T36, typename T37, typename T38, typename T39, typename T40,
14834    typename T41, typename T42, typename T43, typename T44, typename T45,
14835    typename T46, typename T47>
14836internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14837    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14838    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
14839    T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
14840    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
14841    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
14842    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
14843    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
14844    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
14845  return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14846      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14847      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
14848      T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
14849      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
14850      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
14851      v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
14852}
14853
14854template <typename T1, typename T2, typename T3, typename T4, typename T5,
14855    typename T6, typename T7, typename T8, typename T9, typename T10,
14856    typename T11, typename T12, typename T13, typename T14, typename T15,
14857    typename T16, typename T17, typename T18, typename T19, typename T20,
14858    typename T21, typename T22, typename T23, typename T24, typename T25,
14859    typename T26, typename T27, typename T28, typename T29, typename T30,
14860    typename T31, typename T32, typename T33, typename T34, typename T35,
14861    typename T36, typename T37, typename T38, typename T39, typename T40,
14862    typename T41, typename T42, typename T43, typename T44, typename T45,
14863    typename T46, typename T47, typename T48>
14864internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14865    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14866    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
14867    T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
14868    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
14869    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
14870    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
14871    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
14872    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
14873    T48 v48) {
14874  return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14875      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14876      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
14877      T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
14878      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
14879      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
14880      v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
14881}
14882
14883template <typename T1, typename T2, typename T3, typename T4, typename T5,
14884    typename T6, typename T7, typename T8, typename T9, typename T10,
14885    typename T11, typename T12, typename T13, typename T14, typename T15,
14886    typename T16, typename T17, typename T18, typename T19, typename T20,
14887    typename T21, typename T22, typename T23, typename T24, typename T25,
14888    typename T26, typename T27, typename T28, typename T29, typename T30,
14889    typename T31, typename T32, typename T33, typename T34, typename T35,
14890    typename T36, typename T37, typename T38, typename T39, typename T40,
14891    typename T41, typename T42, typename T43, typename T44, typename T45,
14892    typename T46, typename T47, typename T48, typename T49>
14893internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14894    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14895    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
14896    T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
14897    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
14898    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
14899    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
14900    T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
14901    T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
14902    T47 v47, T48 v48, T49 v49) {
14903  return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14904      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14905      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
14906      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
14907      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
14908      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
14909      v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
14910}
14911
14912template <typename T1, typename T2, typename T3, typename T4, typename T5,
14913    typename T6, typename T7, typename T8, typename T9, typename T10,
14914    typename T11, typename T12, typename T13, typename T14, typename T15,
14915    typename T16, typename T17, typename T18, typename T19, typename T20,
14916    typename T21, typename T22, typename T23, typename T24, typename T25,
14917    typename T26, typename T27, typename T28, typename T29, typename T30,
14918    typename T31, typename T32, typename T33, typename T34, typename T35,
14919    typename T36, typename T37, typename T38, typename T39, typename T40,
14920    typename T41, typename T42, typename T43, typename T44, typename T45,
14921    typename T46, typename T47, typename T48, typename T49, typename T50>
14922internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
14923    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
14924    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
14925    T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
14926    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
14927    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
14928    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
14929    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
14930    T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
14931    T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
14932  return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
14933      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
14934      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
14935      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
14936      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
14937      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
14938      v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
14939      v48, v49, v50);
14940}
14941
14942// Bool() allows generating tests with parameters in a set of (false, true).
14943//
14944// Synopsis:
14945// Bool()
14946//   - returns a generator producing sequences with elements {false, true}.
14947//
14948// It is useful when testing code that depends on Boolean flags. Combinations
14949// of multiple flags can be tested when several Bool()'s are combined using
14950// Combine() function.
14951//
14952// In the following example all tests in the test case FlagDependentTest
14953// will be instantiated twice with parameters false and true.
14954//
14955// class FlagDependentTest : public testing::TestWithParam<bool> {
14956//   virtual void SetUp() {
14957//     external_flag = GetParam();
14958//   }
14959// }
14960// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
14961//
14962inline internal::ParamGenerator<bool> Bool() {
14963  return Values(false, true);
14964}
14965
14966#if GTEST_HAS_COMBINE
14967// Combine() allows the user to combine two or more sequences to produce
14968// values of a Cartesian product of those sequences' elements.
14969//
14970// Synopsis:
14971// Combine(gen1, gen2, ..., genN)
14972//   - returns a generator producing sequences with elements coming from
14973//     the Cartesian product of elements from the sequences generated by
14974//     gen1, gen2, ..., genN. The sequence elements will have a type of
14975//     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
14976//     of elements from sequences produces by gen1, gen2, ..., genN.
14977//
14978// Combine can have up to 10 arguments. This number is currently limited
14979// by the maximum number of elements in the tuple implementation used by Google
14980// Test.
14981//
14982// Example:
14983//
14984// This will instantiate tests in test case AnimalTest each one with
14985// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
14986// tuple("dog", BLACK), and tuple("dog", WHITE):
14987//
14988// enum Color { BLACK, GRAY, WHITE };
14989// class AnimalTest
14990//     : public testing::TestWithParam<tuple<const char*, Color> > {...};
14991//
14992// TEST_P(AnimalTest, AnimalLooksNice) {...}
14993//
14994// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
14995//                         Combine(Values("cat", "dog"),
14996//                                 Values(BLACK, WHITE)));
14997//
14998// This will instantiate tests in FlagDependentTest with all variations of two
14999// Boolean flags:
15000//
15001// class FlagDependentTest
15002//     : public testing::TestWithParam<tuple(bool, bool)> > {
15003//   virtual void SetUp() {
15004//     // Assigns external_flag_1 and external_flag_2 values from the tuple.
15005//     tie(external_flag_1, external_flag_2) = GetParam();
15006//   }
15007// };
15008//
15009// TEST_P(FlagDependentTest, TestFeature1) {
15010//   // Test your code using external_flag_1 and external_flag_2 here.
15011// }
15012// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
15013//                         Combine(Bool(), Bool()));
15014//
15015template <typename Generator1, typename Generator2>
15016internal::CartesianProductHolder2<Generator1, Generator2> Combine(
15017    const Generator1& g1, const Generator2& g2) {
15018  return internal::CartesianProductHolder2<Generator1, Generator2>(
15019      g1, g2);
15020}
15021
15022template <typename Generator1, typename Generator2, typename Generator3>
15023internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
15024    const Generator1& g1, const Generator2& g2, const Generator3& g3) {
15025  return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
15026      g1, g2, g3);
15027}
15028
15029template <typename Generator1, typename Generator2, typename Generator3,
15030    typename Generator4>
15031internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
15032    Generator4> Combine(
15033    const Generator1& g1, const Generator2& g2, const Generator3& g3,
15034        const Generator4& g4) {
15035  return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
15036      Generator4>(
15037      g1, g2, g3, g4);
15038}
15039
15040template <typename Generator1, typename Generator2, typename Generator3,
15041    typename Generator4, typename Generator5>
15042internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
15043    Generator4, Generator5> Combine(
15044    const Generator1& g1, const Generator2& g2, const Generator3& g3,
15045        const Generator4& g4, const Generator5& g5) {
15046  return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
15047      Generator4, Generator5>(
15048      g1, g2, g3, g4, g5);
15049}
15050
15051template <typename Generator1, typename Generator2, typename Generator3,
15052    typename Generator4, typename Generator5, typename Generator6>
15053internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
15054    Generator4, Generator5, Generator6> Combine(
15055    const Generator1& g1, const Generator2& g2, const Generator3& g3,
15056        const Generator4& g4, const Generator5& g5, const Generator6& g6) {
15057  return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
15058      Generator4, Generator5, Generator6>(
15059      g1, g2, g3, g4, g5, g6);
15060}
15061
15062template <typename Generator1, typename Generator2, typename Generator3,
15063    typename Generator4, typename Generator5, typename Generator6,
15064    typename Generator7>
15065internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
15066    Generator4, Generator5, Generator6, Generator7> Combine(
15067    const Generator1& g1, const Generator2& g2, const Generator3& g3,
15068        const Generator4& g4, const Generator5& g5, const Generator6& g6,
15069        const Generator7& g7) {
15070  return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
15071      Generator4, Generator5, Generator6, Generator7>(
15072      g1, g2, g3, g4, g5, g6, g7);
15073}
15074
15075template <typename Generator1, typename Generator2, typename Generator3,
15076    typename Generator4, typename Generator5, typename Generator6,
15077    typename Generator7, typename Generator8>
15078internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
15079    Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
15080    const Generator1& g1, const Generator2& g2, const Generator3& g3,
15081        const Generator4& g4, const Generator5& g5, const Generator6& g6,
15082        const Generator7& g7, const Generator8& g8) {
15083  return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
15084      Generator4, Generator5, Generator6, Generator7, Generator8>(
15085      g1, g2, g3, g4, g5, g6, g7, g8);
15086}
15087
15088template <typename Generator1, typename Generator2, typename Generator3,
15089    typename Generator4, typename Generator5, typename Generator6,
15090    typename Generator7, typename Generator8, typename Generator9>
15091internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
15092    Generator4, Generator5, Generator6, Generator7, Generator8,
15093    Generator9> Combine(
15094    const Generator1& g1, const Generator2& g2, const Generator3& g3,
15095        const Generator4& g4, const Generator5& g5, const Generator6& g6,
15096        const Generator7& g7, const Generator8& g8, const Generator9& g9) {
15097  return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
15098      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
15099      g1, g2, g3, g4, g5, g6, g7, g8, g9);
15100}
15101
15102template <typename Generator1, typename Generator2, typename Generator3,
15103    typename Generator4, typename Generator5, typename Generator6,
15104    typename Generator7, typename Generator8, typename Generator9,
15105    typename Generator10>
15106internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
15107    Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
15108    Generator10> Combine(
15109    const Generator1& g1, const Generator2& g2, const Generator3& g3,
15110        const Generator4& g4, const Generator5& g5, const Generator6& g6,
15111        const Generator7& g7, const Generator8& g8, const Generator9& g9,
15112        const Generator10& g10) {
15113  return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
15114      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
15115      Generator10>(
15116      g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
15117}
15118#endif  // GTEST_HAS_COMBINE
15119
15120
15121
15122#define TEST_P(test_case_name, test_name) \
15123  class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
15124      : public test_case_name { \
15125   public: \
15126    GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
15127    virtual void TestBody(); \
15128   private: \
15129    static int AddToRegistry() { \
15130      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
15131          GetTestCasePatternHolder<test_case_name>(\
15132              #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
15133                  #test_case_name, \
15134                  #test_name, \
15135                  new ::testing::internal::TestMetaFactory< \
15136                      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
15137      return 0; \
15138    } \
15139    static int gtest_registering_dummy_; \
15140    GTEST_DISALLOW_COPY_AND_ASSIGN_(\
15141        GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
15142  }; \
15143  int GTEST_TEST_CLASS_NAME_(test_case_name, \
15144                             test_name)::gtest_registering_dummy_ = \
15145      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
15146  void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
15147
15148#define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
15149  ::testing::internal::ParamGenerator<test_case_name::ParamType> \
15150      gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
15151  int gtest_##prefix##test_case_name##_dummy_ = \
15152      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
15153          GetTestCasePatternHolder<test_case_name>(\
15154              #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
15155                  #prefix, \
15156                  &gtest_##prefix##test_case_name##_EvalGenerator_, \
15157                  __FILE__, __LINE__)
15158
15159}  // namespace testing
15160
15161#endif  // GTEST_HAS_PARAM_TEST
15162
15163#endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
15164// Copyright 2006, Google Inc.
15165// All rights reserved.
15166//
15167// Redistribution and use in source and binary forms, with or without
15168// modification, are permitted provided that the following conditions are
15169// met:
15170//
15171//     * Redistributions of source code must retain the above copyright
15172// notice, this list of conditions and the following disclaimer.
15173//     * Redistributions in binary form must reproduce the above
15174// copyright notice, this list of conditions and the following disclaimer
15175// in the documentation and/or other materials provided with the
15176// distribution.
15177//     * Neither the name of Google Inc. nor the names of its
15178// contributors may be used to endorse or promote products derived from
15179// this software without specific prior written permission.
15180//
15181// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15182// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15183// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15184// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
15185// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15186// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
15187// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
15188// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
15189// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15190// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15191// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15192//
15193// Author: wan@google.com (Zhanyong Wan)
15194//
15195// Google C++ Testing Framework definitions useful in production code.
15196
15197#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
15198#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
15199
15200// When you need to test the private or protected members of a class,
15201// use the FRIEND_TEST macro to declare your tests as friends of the
15202// class.  For example:
15203//
15204// class MyClass {
15205//  private:
15206//   void MyMethod();
15207//   FRIEND_TEST(MyClassTest, MyMethod);
15208// };
15209//
15210// class MyClassTest : public testing::Test {
15211//   // ...
15212// };
15213//
15214// TEST_F(MyClassTest, MyMethod) {
15215//   // Can call MyClass::MyMethod() here.
15216// }
15217
15218#define FRIEND_TEST(test_case_name, test_name)\
15219friend class test_case_name##_##test_name##_Test
15220
15221#endif  // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
15222// Copyright 2008, Google Inc.
15223// All rights reserved.
15224//
15225// Redistribution and use in source and binary forms, with or without
15226// modification, are permitted provided that the following conditions are
15227// met:
15228//
15229//     * Redistributions of source code must retain the above copyright
15230// notice, this list of conditions and the following disclaimer.
15231//     * Redistributions in binary form must reproduce the above
15232// copyright notice, this list of conditions and the following disclaimer
15233// in the documentation and/or other materials provided with the
15234// distribution.
15235//     * Neither the name of Google Inc. nor the names of its
15236// contributors may be used to endorse or promote products derived from
15237// this software without specific prior written permission.
15238//
15239// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15240// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15241// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15242// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
15243// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15244// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
15245// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
15246// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
15247// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15248// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15249// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15250//
15251// Author: mheule@google.com (Markus Heule)
15252//
15253
15254#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
15255#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
15256
15257#include <iosfwd>
15258#include <vector>
15259
15260namespace testing {
15261
15262// A copyable object representing the result of a test part (i.e. an
15263// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
15264//
15265// Don't inherit from TestPartResult as its destructor is not virtual.
15266class GTEST_API_ TestPartResult {
15267 public:
15268  // The possible outcomes of a test part (i.e. an assertion or an
15269  // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
15270  enum Type {
15271    kSuccess,          // Succeeded.
15272    kNonFatalFailure,  // Failed but the test can continue.
15273    kFatalFailure      // Failed and the test should be terminated.
15274  };
15275
15276  // C'tor.  TestPartResult does NOT have a default constructor.
15277  // Always use this constructor (with parameters) to create a
15278  // TestPartResult object.
15279  TestPartResult(Type a_type,
15280                 const char* a_file_name,
15281                 int a_line_number,
15282                 const char* a_message)
15283      : type_(a_type),
15284        file_name_(a_file_name),
15285        line_number_(a_line_number),
15286        summary_(ExtractSummary(a_message)),
15287        message_(a_message) {
15288  }
15289
15290  // Gets the outcome of the test part.
15291  Type type() const { return type_; }
15292
15293  // Gets the name of the source file where the test part took place, or
15294  // NULL if it's unknown.
15295  const char* file_name() const { return file_name_.c_str(); }
15296
15297  // Gets the line in the source file where the test part took place,
15298  // or -1 if it's unknown.
15299  int line_number() const { return line_number_; }
15300
15301  // Gets the summary of the failure message.
15302  const char* summary() const { return summary_.c_str(); }
15303
15304  // Gets the message associated with the test part.
15305  const char* message() const { return message_.c_str(); }
15306
15307  // Returns true iff the test part passed.
15308  bool passed() const { return type_ == kSuccess; }
15309
15310  // Returns true iff the test part failed.
15311  bool failed() const { return type_ != kSuccess; }
15312
15313  // Returns true iff the test part non-fatally failed.
15314  bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
15315
15316  // Returns true iff the test part fatally failed.
15317  bool fatally_failed() const { return type_ == kFatalFailure; }
15318 private:
15319  Type type_;
15320
15321  // Gets the summary of the failure message by omitting the stack
15322  // trace in it.
15323  static internal::String ExtractSummary(const char* message);
15324
15325  // The name of the source file where the test part took place, or
15326  // NULL if the source file is unknown.
15327  internal::String file_name_;
15328  // The line in the source file where the test part took place, or -1
15329  // if the line number is unknown.
15330  int line_number_;
15331  internal::String summary_;  // The test failure summary.
15332  internal::String message_;  // The test failure message.
15333};
15334
15335// Prints a TestPartResult object.
15336std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
15337
15338// An array of TestPartResult objects.
15339//
15340// Don't inherit from TestPartResultArray as its destructor is not
15341// virtual.
15342class GTEST_API_ TestPartResultArray {
15343 public:
15344  TestPartResultArray() {}
15345
15346  // Appends the given TestPartResult to the array.
15347  void Append(const TestPartResult& result);
15348
15349  // Returns the TestPartResult at the given index (0-based).
15350  const TestPartResult& GetTestPartResult(int index) const;
15351
15352  // Returns the number of TestPartResult objects in the array.
15353  int size() const;
15354
15355 private:
15356  std::vector<TestPartResult> array_;
15357
15358  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
15359};
15360
15361// This interface knows how to report a test part result.
15362class TestPartResultReporterInterface {
15363 public:
15364  virtual ~TestPartResultReporterInterface() {}
15365
15366  virtual void ReportTestPartResult(const TestPartResult& result) = 0;
15367};
15368
15369namespace internal {
15370
15371// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
15372// statement generates new fatal failures. To do so it registers itself as the
15373// current test part result reporter. Besides checking if fatal failures were
15374// reported, it only delegates the reporting to the former result reporter.
15375// The original result reporter is restored in the destructor.
15376// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
15377class GTEST_API_ HasNewFatalFailureHelper
15378    : public TestPartResultReporterInterface {
15379 public:
15380  HasNewFatalFailureHelper();
15381  virtual ~HasNewFatalFailureHelper();
15382  virtual void ReportTestPartResult(const TestPartResult& result);
15383  bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
15384 private:
15385  bool has_new_fatal_failure_;
15386  TestPartResultReporterInterface* original_reporter_;
15387
15388  GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
15389};
15390
15391}  // namespace internal
15392
15393}  // namespace testing
15394
15395#endif  // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
15396// Copyright 2008 Google Inc.
15397// All Rights Reserved.
15398//
15399// Redistribution and use in source and binary forms, with or without
15400// modification, are permitted provided that the following conditions are
15401// met:
15402//
15403//     * Redistributions of source code must retain the above copyright
15404// notice, this list of conditions and the following disclaimer.
15405//     * Redistributions in binary form must reproduce the above
15406// copyright notice, this list of conditions and the following disclaimer
15407// in the documentation and/or other materials provided with the
15408// distribution.
15409//     * Neither the name of Google Inc. nor the names of its
15410// contributors may be used to endorse or promote products derived from
15411// this software without specific prior written permission.
15412//
15413// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15414// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15415// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15416// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
15417// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15418// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
15419// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
15420// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
15421// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15422// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15423// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15424//
15425// Author: wan@google.com (Zhanyong Wan)
15426
15427#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
15428#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
15429
15430// This header implements typed tests and type-parameterized tests.
15431
15432// Typed (aka type-driven) tests repeat the same test for types in a
15433// list.  You must know which types you want to test with when writing
15434// typed tests. Here's how you do it:
15435
15436#if 0
15437
15438// First, define a fixture class template.  It should be parameterized
15439// by a type.  Remember to derive it from testing::Test.
15440template <typename T>
15441class FooTest : public testing::Test {
15442 public:
15443  ...
15444  typedef std::list<T> List;
15445  static T shared_;
15446  T value_;
15447};
15448
15449// Next, associate a list of types with the test case, which will be
15450// repeated for each type in the list.  The typedef is necessary for
15451// the macro to parse correctly.
15452typedef testing::Types<char, int, unsigned int> MyTypes;
15453TYPED_TEST_CASE(FooTest, MyTypes);
15454
15455// If the type list contains only one type, you can write that type
15456// directly without Types<...>:
15457//   TYPED_TEST_CASE(FooTest, int);
15458
15459// Then, use TYPED_TEST() instead of TEST_F() to define as many typed
15460// tests for this test case as you want.
15461TYPED_TEST(FooTest, DoesBlah) {
15462  // Inside a test, refer to TypeParam to get the type parameter.
15463  // Since we are inside a derived class template, C++ requires use to
15464  // visit the members of FooTest via 'this'.
15465  TypeParam n = this->value_;
15466
15467  // To visit static members of the fixture, add the TestFixture::
15468  // prefix.
15469  n += TestFixture::shared_;
15470
15471  // To refer to typedefs in the fixture, add the "typename
15472  // TestFixture::" prefix.
15473  typename TestFixture::List values;
15474  values.push_back(n);
15475  ...
15476}
15477
15478TYPED_TEST(FooTest, HasPropertyA) { ... }
15479
15480#endif  // 0
15481
15482// Type-parameterized tests are abstract test patterns parameterized
15483// by a type.  Compared with typed tests, type-parameterized tests
15484// allow you to define the test pattern without knowing what the type
15485// parameters are.  The defined pattern can be instantiated with
15486// different types any number of times, in any number of translation
15487// units.
15488//
15489// If you are designing an interface or concept, you can define a
15490// suite of type-parameterized tests to verify properties that any
15491// valid implementation of the interface/concept should have.  Then,
15492// each implementation can easily instantiate the test suite to verify
15493// that it conforms to the requirements, without having to write
15494// similar tests repeatedly.  Here's an example:
15495
15496#if 0
15497
15498// First, define a fixture class template.  It should be parameterized
15499// by a type.  Remember to derive it from testing::Test.
15500template <typename T>
15501class FooTest : public testing::Test {
15502  ...
15503};
15504
15505// Next, declare that you will define a type-parameterized test case
15506// (the _P suffix is for "parameterized" or "pattern", whichever you
15507// prefer):
15508TYPED_TEST_CASE_P(FooTest);
15509
15510// Then, use TYPED_TEST_P() to define as many type-parameterized tests
15511// for this type-parameterized test case as you want.
15512TYPED_TEST_P(FooTest, DoesBlah) {
15513  // Inside a test, refer to TypeParam to get the type parameter.
15514  TypeParam n = 0;
15515  ...
15516}
15517
15518TYPED_TEST_P(FooTest, HasPropertyA) { ... }
15519
15520// Now the tricky part: you need to register all test patterns before
15521// you can instantiate them.  The first argument of the macro is the
15522// test case name; the rest are the names of the tests in this test
15523// case.
15524REGISTER_TYPED_TEST_CASE_P(FooTest,
15525                           DoesBlah, HasPropertyA);
15526
15527// Finally, you are free to instantiate the pattern with the types you
15528// want.  If you put the above code in a header file, you can #include
15529// it in multiple C++ source files and instantiate it multiple times.
15530//
15531// To distinguish different instances of the pattern, the first
15532// argument to the INSTANTIATE_* macro is a prefix that will be added
15533// to the actual test case name.  Remember to pick unique prefixes for
15534// different instances.
15535typedef testing::Types<char, int, unsigned int> MyTypes;
15536INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
15537
15538// If the type list contains only one type, you can write that type
15539// directly without Types<...>:
15540//   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
15541
15542#endif  // 0
15543
15544
15545// Implements typed tests.
15546
15547#if GTEST_HAS_TYPED_TEST
15548
15549// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15550//
15551// Expands to the name of the typedef for the type parameters of the
15552// given test case.
15553#define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
15554
15555// The 'Types' template argument below must have spaces around it
15556// since some compilers may choke on '>>' when passing a template
15557// instance (e.g. Types<int>)
15558#define TYPED_TEST_CASE(CaseName, Types) \
15559  typedef ::testing::internal::TypeList< Types >::type \
15560      GTEST_TYPE_PARAMS_(CaseName)
15561
15562#define TYPED_TEST(CaseName, TestName) \
15563  template <typename gtest_TypeParam_> \
15564  class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
15565      : public CaseName<gtest_TypeParam_> { \
15566   private: \
15567    typedef CaseName<gtest_TypeParam_> TestFixture; \
15568    typedef gtest_TypeParam_ TypeParam; \
15569    virtual void TestBody(); \
15570  }; \
15571  bool gtest_##CaseName##_##TestName##_registered_ = \
15572      ::testing::internal::TypeParameterizedTest< \
15573          CaseName, \
15574          ::testing::internal::TemplateSel< \
15575              GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
15576          GTEST_TYPE_PARAMS_(CaseName)>::Register(\
15577              "", #CaseName, #TestName, 0); \
15578  template <typename gtest_TypeParam_> \
15579  void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
15580
15581#endif  // GTEST_HAS_TYPED_TEST
15582
15583// Implements type-parameterized tests.
15584
15585#if GTEST_HAS_TYPED_TEST_P
15586
15587// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15588//
15589// Expands to the namespace name that the type-parameterized tests for
15590// the given type-parameterized test case are defined in.  The exact
15591// name of the namespace is subject to change without notice.
15592#define GTEST_CASE_NAMESPACE_(TestCaseName) \
15593  gtest_case_##TestCaseName##_
15594
15595// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15596//
15597// Expands to the name of the variable used to remember the names of
15598// the defined tests in the given test case.
15599#define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
15600  gtest_typed_test_case_p_state_##TestCaseName##_
15601
15602// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
15603//
15604// Expands to the name of the variable used to remember the names of
15605// the registered tests in the given test case.
15606#define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
15607  gtest_registered_test_names_##TestCaseName##_
15608
15609// The variables defined in the type-parameterized test macros are
15610// static as typically these macros are used in a .h file that can be
15611// #included in multiple translation units linked together.
15612#define TYPED_TEST_CASE_P(CaseName) \
15613  static ::testing::internal::TypedTestCasePState \
15614      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
15615
15616#define TYPED_TEST_P(CaseName, TestName) \
15617  namespace GTEST_CASE_NAMESPACE_(CaseName) { \
15618  template <typename gtest_TypeParam_> \
15619  class TestName : public CaseName<gtest_TypeParam_> { \
15620   private: \
15621    typedef CaseName<gtest_TypeParam_> TestFixture; \
15622    typedef gtest_TypeParam_ TypeParam; \
15623    virtual void TestBody(); \
15624  }; \
15625  static bool gtest_##TestName##_defined_ = \
15626      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
15627          __FILE__, __LINE__, #CaseName, #TestName); \
15628  } \
15629  template <typename gtest_TypeParam_> \
15630  void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
15631
15632#define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
15633  namespace GTEST_CASE_NAMESPACE_(CaseName) { \
15634  typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
15635  } \
15636  static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
15637      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
15638          __FILE__, __LINE__, #__VA_ARGS__)
15639
15640// The 'Types' template argument below must have spaces around it
15641// since some compilers may choke on '>>' when passing a template
15642// instance (e.g. Types<int>)
15643#define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
15644  bool gtest_##Prefix##_##CaseName = \
15645      ::testing::internal::TypeParameterizedTestCase<CaseName, \
15646          GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
15647          ::testing::internal::TypeList< Types >::type>::Register(\
15648              #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
15649
15650#endif  // GTEST_HAS_TYPED_TEST_P
15651
15652#endif  // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
15653
15654// Depending on the platform, different string classes are available.
15655// On Linux, in addition to ::std::string, Google also makes use of
15656// class ::string, which has the same interface as ::std::string, but
15657// has a different implementation.
15658//
15659// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
15660// ::string is available AND is a distinct type to ::std::string, or
15661// define it to 0 to indicate otherwise.
15662//
15663// If the user's ::std::string and ::string are the same class due to
15664// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
15665//
15666// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
15667// heuristically.
15668
15669namespace testing {
15670
15671// Declares the flags.
15672
15673// This flag temporary enables the disabled tests.
15674GTEST_DECLARE_bool_(also_run_disabled_tests);
15675
15676// This flag brings the debugger on an assertion failure.
15677GTEST_DECLARE_bool_(break_on_failure);
15678
15679// This flag controls whether Google Test catches all test-thrown exceptions
15680// and logs them as failures.
15681GTEST_DECLARE_bool_(catch_exceptions);
15682
15683// This flag enables using colors in terminal output. Available values are
15684// "yes" to enable colors, "no" (disable colors), or "auto" (the default)
15685// to let Google Test decide.
15686GTEST_DECLARE_string_(color);
15687
15688// This flag sets up the filter to select by name using a glob pattern
15689// the tests to run. If the filter is not given all tests are executed.
15690GTEST_DECLARE_string_(filter);
15691
15692// This flag causes the Google Test to list tests. None of the tests listed
15693// are actually run if the flag is provided.
15694GTEST_DECLARE_bool_(list_tests);
15695
15696// This flag controls whether Google Test emits a detailed XML report to a file
15697// in addition to its normal textual output.
15698GTEST_DECLARE_string_(output);
15699
15700// This flags control whether Google Test prints the elapsed time for each
15701// test.
15702GTEST_DECLARE_bool_(print_time);
15703
15704// This flag specifies the random number seed.
15705GTEST_DECLARE_int32_(random_seed);
15706
15707// This flag sets how many times the tests are repeated. The default value
15708// is 1. If the value is -1 the tests are repeating forever.
15709GTEST_DECLARE_int32_(repeat);
15710
15711// This flag controls whether Google Test includes Google Test internal
15712// stack frames in failure stack traces.
15713GTEST_DECLARE_bool_(show_internal_stack_frames);
15714
15715// When this flag is specified, tests' order is randomized on every iteration.
15716GTEST_DECLARE_bool_(shuffle);
15717
15718// This flag specifies the maximum number of stack frames to be
15719// printed in a failure message.
15720GTEST_DECLARE_int32_(stack_trace_depth);
15721
15722// When this flag is specified, a failed assertion will throw an
15723// exception if exceptions are enabled, or exit the program with a
15724// non-zero code otherwise.
15725GTEST_DECLARE_bool_(throw_on_failure);
15726
15727// The upper limit for valid stack trace depths.
15728const int kMaxStackTraceDepth = 100;
15729
15730namespace internal {
15731
15732class AssertHelper;
15733class DefaultGlobalTestPartResultReporter;
15734class ExecDeathTest;
15735class NoExecDeathTest;
15736class FinalSuccessChecker;
15737class GTestFlagSaver;
15738class TestInfoImpl;
15739class TestResultAccessor;
15740class TestEventListenersAccessor;
15741class TestEventRepeater;
15742class WindowsDeathTest;
15743class UnitTestImpl* GetUnitTestImpl();
15744void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
15745                                    const String& message);
15746class PrettyUnitTestResultPrinter;
15747class XmlUnitTestResultPrinter;
15748
15749// Converts a streamable value to a String.  A NULL pointer is
15750// converted to "(null)".  When the input value is a ::string,
15751// ::std::string, ::wstring, or ::std::wstring object, each NUL
15752// character in it is replaced with "\\0".
15753// Declared in gtest-internal.h but defined here, so that it has access
15754// to the definition of the Message class, required by the ARM
15755// compiler.
15756template <typename T>
15757String StreamableToString(const T& streamable) {
15758  return (Message() << streamable).GetString();
15759}
15760
15761}  // namespace internal
15762
15763// A class for indicating whether an assertion was successful.  When
15764// the assertion wasn't successful, the AssertionResult object
15765// remembers a non-empty message that describes how it failed.
15766//
15767// To create an instance of this class, use one of the factory functions
15768// (AssertionSuccess() and AssertionFailure()).
15769//
15770// This class is useful for two purposes:
15771//   1. Defining predicate functions to be used with Boolean test assertions
15772//      EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
15773//   2. Defining predicate-format functions to be
15774//      used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
15775//
15776// For example, if you define IsEven predicate:
15777//
15778//   testing::AssertionResult IsEven(int n) {
15779//     if ((n % 2) == 0)
15780//       return testing::AssertionSuccess();
15781//     else
15782//       return testing::AssertionFailure() << n << " is odd";
15783//   }
15784//
15785// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
15786// will print the message
15787//
15788//   Value of: IsEven(Fib(5))
15789//     Actual: false (5 is odd)
15790//   Expected: true
15791//
15792// instead of a more opaque
15793//
15794//   Value of: IsEven(Fib(5))
15795//     Actual: false
15796//   Expected: true
15797//
15798// in case IsEven is a simple Boolean predicate.
15799//
15800// If you expect your predicate to be reused and want to support informative
15801// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
15802// about half as often as positive ones in our tests), supply messages for
15803// both success and failure cases:
15804//
15805//   testing::AssertionResult IsEven(int n) {
15806//     if ((n % 2) == 0)
15807//       return testing::AssertionSuccess() << n << " is even";
15808//     else
15809//       return testing::AssertionFailure() << n << " is odd";
15810//   }
15811//
15812// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
15813//
15814//   Value of: IsEven(Fib(6))
15815//     Actual: true (8 is even)
15816//   Expected: false
15817//
15818// NB: Predicates that support negative Boolean assertions have reduced
15819// performance in positive ones so be careful not to use them in tests
15820// that have lots (tens of thousands) of positive Boolean assertions.
15821//
15822// To use this class with EXPECT_PRED_FORMAT assertions such as:
15823//
15824//   // Verifies that Foo() returns an even number.
15825//   EXPECT_PRED_FORMAT1(IsEven, Foo());
15826//
15827// you need to define:
15828//
15829//   testing::AssertionResult IsEven(const char* expr, int n) {
15830//     if ((n % 2) == 0)
15831//       return testing::AssertionSuccess();
15832//     else
15833//       return testing::AssertionFailure()
15834//         << "Expected: " << expr << " is even\n  Actual: it's " << n;
15835//   }
15836//
15837// If Foo() returns 5, you will see the following message:
15838//
15839//   Expected: Foo() is even
15840//     Actual: it's 5
15841//
15842class GTEST_API_ AssertionResult {
15843 public:
15844  // Copy constructor.
15845  // Used in EXPECT_TRUE/FALSE(assertion_result).
15846  AssertionResult(const AssertionResult& other);
15847  // Used in the EXPECT_TRUE/FALSE(bool_expression).
15848  explicit AssertionResult(bool success) : success_(success) {}
15849
15850  // Returns true iff the assertion succeeded.
15851  operator bool() const { return success_; }  // NOLINT
15852
15853  // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
15854  AssertionResult operator!() const;
15855
15856  // Returns the text streamed into this AssertionResult. Test assertions
15857  // use it when they fail (i.e., the predicate's outcome doesn't match the
15858  // assertion's expectation). When nothing has been streamed into the
15859  // object, returns an empty string.
15860  const char* message() const {
15861    return message_.get() != NULL && message_->c_str() != NULL ?
15862           message_->c_str() : "";
15863  }
15864  // TODO(vladl@google.com): Remove this after making sure no clients use it.
15865  // Deprecated; please use message() instead.
15866  const char* failure_message() const { return message(); }
15867
15868  // Streams a custom failure message into this object.
15869  template <typename T> AssertionResult& operator<<(const T& value);
15870
15871 private:
15872  // No implementation - we want AssertionResult to be
15873  // copy-constructible but not assignable.
15874  void operator=(const AssertionResult& other);
15875
15876  // Stores result of the assertion predicate.
15877  bool success_;
15878  // Stores the message describing the condition in case the expectation
15879  // construct is not satisfied with the predicate's outcome.
15880  // Referenced via a pointer to avoid taking too much stack frame space
15881  // with test assertions.
15882  internal::scoped_ptr<internal::String> message_;
15883};  // class AssertionResult
15884
15885// Streams a custom failure message into this object.
15886template <typename T>
15887AssertionResult& AssertionResult::operator<<(const T& value) {
15888  Message msg;
15889  if (message_.get() != NULL)
15890    msg << *message_;
15891  msg << value;
15892  message_.reset(new internal::String(msg.GetString()));
15893  return *this;
15894}
15895
15896// Makes a successful assertion result.
15897GTEST_API_ AssertionResult AssertionSuccess();
15898
15899// Makes a failed assertion result.
15900GTEST_API_ AssertionResult AssertionFailure();
15901
15902// Makes a failed assertion result with the given failure message.
15903// Deprecated; use AssertionFailure() << msg.
15904GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
15905
15906// The abstract class that all tests inherit from.
15907//
15908// In Google Test, a unit test program contains one or many TestCases, and
15909// each TestCase contains one or many Tests.
15910//
15911// When you define a test using the TEST macro, you don't need to
15912// explicitly derive from Test - the TEST macro automatically does
15913// this for you.
15914//
15915// The only time you derive from Test is when defining a test fixture
15916// to be used a TEST_F.  For example:
15917//
15918//   class FooTest : public testing::Test {
15919//    protected:
15920//     virtual void SetUp() { ... }
15921//     virtual void TearDown() { ... }
15922//     ...
15923//   };
15924//
15925//   TEST_F(FooTest, Bar) { ... }
15926//   TEST_F(FooTest, Baz) { ... }
15927//
15928// Test is not copyable.
15929class GTEST_API_ Test {
15930 public:
15931  friend class internal::TestInfoImpl;
15932
15933  // Defines types for pointers to functions that set up and tear down
15934  // a test case.
15935  typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
15936  typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
15937
15938  // The d'tor is virtual as we intend to inherit from Test.
15939  virtual ~Test();
15940
15941  // Sets up the stuff shared by all tests in this test case.
15942  //
15943  // Google Test will call Foo::SetUpTestCase() before running the first
15944  // test in test case Foo.  Hence a sub-class can define its own
15945  // SetUpTestCase() method to shadow the one defined in the super
15946  // class.
15947  static void SetUpTestCase() {}
15948
15949  // Tears down the stuff shared by all tests in this test case.
15950  //
15951  // Google Test will call Foo::TearDownTestCase() after running the last
15952  // test in test case Foo.  Hence a sub-class can define its own
15953  // TearDownTestCase() method to shadow the one defined in the super
15954  // class.
15955  static void TearDownTestCase() {}
15956
15957  // Returns true iff the current test has a fatal failure.
15958  static bool HasFatalFailure();
15959
15960  // Returns true iff the current test has a non-fatal failure.
15961  static bool HasNonfatalFailure();
15962
15963  // Returns true iff the current test has a (either fatal or
15964  // non-fatal) failure.
15965  static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
15966
15967  // Logs a property for the current test.  Only the last value for a given
15968  // key is remembered.
15969  // These are public static so they can be called from utility functions
15970  // that are not members of the test fixture.
15971  // The arguments are const char* instead strings, as Google Test is used
15972  // on platforms where string doesn't compile.
15973  //
15974  // Note that a driving consideration for these RecordProperty methods
15975  // was to produce xml output suited to the Greenspan charting utility,
15976  // which at present will only chart values that fit in a 32-bit int. It
15977  // is the user's responsibility to restrict their values to 32-bit ints
15978  // if they intend them to be used with Greenspan.
15979  static void RecordProperty(const char* key, const char* value);
15980  static void RecordProperty(const char* key, int value);
15981
15982 protected:
15983  // Creates a Test object.
15984  Test();
15985
15986  // Sets up the test fixture.
15987  virtual void SetUp();
15988
15989  // Tears down the test fixture.
15990  virtual void TearDown();
15991
15992 private:
15993  // Returns true iff the current test has the same fixture class as
15994  // the first test in the current test case.
15995  static bool HasSameFixtureClass();
15996
15997  // Runs the test after the test fixture has been set up.
15998  //
15999  // A sub-class must implement this to define the test logic.
16000  //
16001  // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
16002  // Instead, use the TEST or TEST_F macro.
16003  virtual void TestBody() = 0;
16004
16005  // Sets up, executes, and tears down the test.
16006  void Run();
16007
16008  // Uses a GTestFlagSaver to save and restore all Google Test flags.
16009  const internal::GTestFlagSaver* const gtest_flag_saver_;
16010
16011  // Often a user mis-spells SetUp() as Setup() and spends a long time
16012  // wondering why it is never called by Google Test.  The declaration of
16013  // the following method is solely for catching such an error at
16014  // compile time:
16015  //
16016  //   - The return type is deliberately chosen to be not void, so it
16017  //   will be a conflict if a user declares void Setup() in his test
16018  //   fixture.
16019  //
16020  //   - This method is private, so it will be another compiler error
16021  //   if a user calls it from his test fixture.
16022  //
16023  // DO NOT OVERRIDE THIS FUNCTION.
16024  //
16025  // If you see an error about overriding the following function or
16026  // about it being private, you have mis-spelled SetUp() as Setup().
16027  struct Setup_should_be_spelled_SetUp {};
16028  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
16029
16030  // We disallow copying Tests.
16031  GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
16032};
16033
16034typedef internal::TimeInMillis TimeInMillis;
16035
16036// A copyable object representing a user specified test property which can be
16037// output as a key/value string pair.
16038//
16039// Don't inherit from TestProperty as its destructor is not virtual.
16040class TestProperty {
16041 public:
16042  // C'tor.  TestProperty does NOT have a default constructor.
16043  // Always use this constructor (with parameters) to create a
16044  // TestProperty object.
16045  TestProperty(const char* a_key, const char* a_value) :
16046    key_(a_key), value_(a_value) {
16047  }
16048
16049  // Gets the user supplied key.
16050  const char* key() const {
16051    return key_.c_str();
16052  }
16053
16054  // Gets the user supplied value.
16055  const char* value() const {
16056    return value_.c_str();
16057  }
16058
16059  // Sets a new value, overriding the one supplied in the constructor.
16060  void SetValue(const char* new_value) {
16061    value_ = new_value;
16062  }
16063
16064 private:
16065  // The key supplied by the user.
16066  internal::String key_;
16067  // The value supplied by the user.
16068  internal::String value_;
16069};
16070
16071// The result of a single Test.  This includes a list of
16072// TestPartResults, a list of TestProperties, a count of how many
16073// death tests there are in the Test, and how much time it took to run
16074// the Test.
16075//
16076// TestResult is not copyable.
16077class GTEST_API_ TestResult {
16078 public:
16079  // Creates an empty TestResult.
16080  TestResult();
16081
16082  // D'tor.  Do not inherit from TestResult.
16083  ~TestResult();
16084
16085  // Gets the number of all test parts.  This is the sum of the number
16086  // of successful test parts and the number of failed test parts.
16087  int total_part_count() const;
16088
16089  // Returns the number of the test properties.
16090  int test_property_count() const;
16091
16092  // Returns true iff the test passed (i.e. no test part failed).
16093  bool Passed() const { return !Failed(); }
16094
16095  // Returns true iff the test failed.
16096  bool Failed() const;
16097
16098  // Returns true iff the test fatally failed.
16099  bool HasFatalFailure() const;
16100
16101  // Returns true iff the test has a non-fatal failure.
16102  bool HasNonfatalFailure() const;
16103
16104  // Returns the elapsed time, in milliseconds.
16105  TimeInMillis elapsed_time() const { return elapsed_time_; }
16106
16107  // Returns the i-th test part result among all the results. i can range
16108  // from 0 to test_property_count() - 1. If i is not in that range, aborts
16109  // the program.
16110  const TestPartResult& GetTestPartResult(int i) const;
16111
16112  // Returns the i-th test property. i can range from 0 to
16113  // test_property_count() - 1. If i is not in that range, aborts the
16114  // program.
16115  const TestProperty& GetTestProperty(int i) const;
16116
16117 private:
16118  friend class TestInfo;
16119  friend class UnitTest;
16120  friend class internal::DefaultGlobalTestPartResultReporter;
16121  friend class internal::ExecDeathTest;
16122  friend class internal::TestInfoImpl;
16123  friend class internal::TestResultAccessor;
16124  friend class internal::UnitTestImpl;
16125  friend class internal::WindowsDeathTest;
16126
16127  // Gets the vector of TestPartResults.
16128  const std::vector<TestPartResult>& test_part_results() const {
16129    return test_part_results_;
16130  }
16131
16132  // Gets the vector of TestProperties.
16133  const std::vector<TestProperty>& test_properties() const {
16134    return test_properties_;
16135  }
16136
16137  // Sets the elapsed time.
16138  void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
16139
16140  // Adds a test property to the list. The property is validated and may add
16141  // a non-fatal failure if invalid (e.g., if it conflicts with reserved
16142  // key names). If a property is already recorded for the same key, the
16143  // value will be updated, rather than storing multiple values for the same
16144  // key.
16145  void RecordProperty(const TestProperty& test_property);
16146
16147  // Adds a failure if the key is a reserved attribute of Google Test
16148  // testcase tags.  Returns true if the property is valid.
16149  // TODO(russr): Validate attribute names are legal and human readable.
16150  static bool ValidateTestProperty(const TestProperty& test_property);
16151
16152  // Adds a test part result to the list.
16153  void AddTestPartResult(const TestPartResult& test_part_result);
16154
16155  // Returns the death test count.
16156  int death_test_count() const { return death_test_count_; }
16157
16158  // Increments the death test count, returning the new count.
16159  int increment_death_test_count() { return ++death_test_count_; }
16160
16161  // Clears the test part results.
16162  void ClearTestPartResults();
16163
16164  // Clears the object.
16165  void Clear();
16166
16167  // Protects mutable state of the property vector and of owned
16168  // properties, whose values may be updated.
16169  internal::Mutex test_properites_mutex_;
16170
16171  // The vector of TestPartResults
16172  std::vector<TestPartResult> test_part_results_;
16173  // The vector of TestProperties
16174  std::vector<TestProperty> test_properties_;
16175  // Running count of death tests.
16176  int death_test_count_;
16177  // The elapsed time, in milliseconds.
16178  TimeInMillis elapsed_time_;
16179
16180  // We disallow copying TestResult.
16181  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
16182};  // class TestResult
16183
16184// A TestInfo object stores the following information about a test:
16185//
16186//   Test case name
16187//   Test name
16188//   Whether the test should be run
16189//   A function pointer that creates the test object when invoked
16190//   Test result
16191//
16192// The constructor of TestInfo registers itself with the UnitTest
16193// singleton such that the RUN_ALL_TESTS() macro knows which tests to
16194// run.
16195class GTEST_API_ TestInfo {
16196 public:
16197  // Destructs a TestInfo object.  This function is not virtual, so
16198  // don't inherit from TestInfo.
16199  ~TestInfo();
16200
16201  // Returns the test case name.
16202  const char* test_case_name() const;
16203
16204  // Returns the test name.
16205  const char* name() const;
16206
16207  // Returns the test case comment.
16208  const char* test_case_comment() const;
16209
16210  // Returns the test comment.
16211  const char* comment() const;
16212
16213  // Returns true if this test should run, that is if the test is not disabled
16214  // (or it is disabled but the also_run_disabled_tests flag has been specified)
16215  // and its full name matches the user-specified filter.
16216  //
16217  // Google Test allows the user to filter the tests by their full names.
16218  // The full name of a test Bar in test case Foo is defined as
16219  // "Foo.Bar".  Only the tests that match the filter will run.
16220  //
16221  // A filter is a colon-separated list of glob (not regex) patterns,
16222  // optionally followed by a '-' and a colon-separated list of
16223  // negative patterns (tests to exclude).  A test is run if it
16224  // matches one of the positive patterns and does not match any of
16225  // the negative patterns.
16226  //
16227  // For example, *A*:Foo.* is a filter that matches any string that
16228  // contains the character 'A' or starts with "Foo.".
16229  bool should_run() const;
16230
16231  // Returns the result of the test.
16232  const TestResult* result() const;
16233
16234 private:
16235#if GTEST_HAS_DEATH_TEST
16236  friend class internal::DefaultDeathTestFactory;
16237#endif  // GTEST_HAS_DEATH_TEST
16238  friend class Test;
16239  friend class TestCase;
16240  friend class internal::TestInfoImpl;
16241  friend class internal::UnitTestImpl;
16242  friend TestInfo* internal::MakeAndRegisterTestInfo(
16243      const char* test_case_name, const char* name,
16244      const char* test_case_comment, const char* comment,
16245      internal::TypeId fixture_class_id,
16246      Test::SetUpTestCaseFunc set_up_tc,
16247      Test::TearDownTestCaseFunc tear_down_tc,
16248      internal::TestFactoryBase* factory);
16249
16250  // Returns true if this test matches the user-specified filter.
16251  bool matches_filter() const;
16252
16253  // Increments the number of death tests encountered in this test so
16254  // far.
16255  int increment_death_test_count();
16256
16257  // Accessors for the implementation object.
16258  internal::TestInfoImpl* impl() { return impl_; }
16259  const internal::TestInfoImpl* impl() const { return impl_; }
16260
16261  // Constructs a TestInfo object. The newly constructed instance assumes
16262  // ownership of the factory object.
16263  TestInfo(const char* test_case_name, const char* name,
16264           const char* test_case_comment, const char* comment,
16265           internal::TypeId fixture_class_id,
16266           internal::TestFactoryBase* factory);
16267
16268  // An opaque implementation object.
16269  internal::TestInfoImpl* impl_;
16270
16271  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
16272};
16273
16274// A test case, which consists of a vector of TestInfos.
16275//
16276// TestCase is not copyable.
16277class GTEST_API_ TestCase {
16278 public:
16279  // Creates a TestCase with the given name.
16280  //
16281  // TestCase does NOT have a default constructor.  Always use this
16282  // constructor to create a TestCase object.
16283  //
16284  // Arguments:
16285  //
16286  //   name:         name of the test case
16287  //   set_up_tc:    pointer to the function that sets up the test case
16288  //   tear_down_tc: pointer to the function that tears down the test case
16289  TestCase(const char* name, const char* comment,
16290           Test::SetUpTestCaseFunc set_up_tc,
16291           Test::TearDownTestCaseFunc tear_down_tc);
16292
16293  // Destructor of TestCase.
16294  virtual ~TestCase();
16295
16296  // Gets the name of the TestCase.
16297  const char* name() const { return name_.c_str(); }
16298
16299  // Returns the test case comment.
16300  const char* comment() const { return comment_.c_str(); }
16301
16302  // Returns true if any test in this test case should run.
16303  bool should_run() const { return should_run_; }
16304
16305  // Gets the number of successful tests in this test case.
16306  int successful_test_count() const;
16307
16308  // Gets the number of failed tests in this test case.
16309  int failed_test_count() const;
16310
16311  // Gets the number of disabled tests in this test case.
16312  int disabled_test_count() const;
16313
16314  // Get the number of tests in this test case that should run.
16315  int test_to_run_count() const;
16316
16317  // Gets the number of all tests in this test case.
16318  int total_test_count() const;
16319
16320  // Returns true iff the test case passed.
16321  bool Passed() const { return !Failed(); }
16322
16323  // Returns true iff the test case failed.
16324  bool Failed() const { return failed_test_count() > 0; }
16325
16326  // Returns the elapsed time, in milliseconds.
16327  TimeInMillis elapsed_time() const { return elapsed_time_; }
16328
16329  // Returns the i-th test among all the tests. i can range from 0 to
16330  // total_test_count() - 1. If i is not in that range, returns NULL.
16331  const TestInfo* GetTestInfo(int i) const;
16332
16333 private:
16334  friend class Test;
16335  friend class internal::UnitTestImpl;
16336
16337  // Gets the (mutable) vector of TestInfos in this TestCase.
16338  std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
16339
16340  // Gets the (immutable) vector of TestInfos in this TestCase.
16341  const std::vector<TestInfo*>& test_info_list() const {
16342    return test_info_list_;
16343  }
16344
16345  // Returns the i-th test among all the tests. i can range from 0 to
16346  // total_test_count() - 1. If i is not in that range, returns NULL.
16347  TestInfo* GetMutableTestInfo(int i);
16348
16349  // Sets the should_run member.
16350  void set_should_run(bool should) { should_run_ = should; }
16351
16352  // Adds a TestInfo to this test case.  Will delete the TestInfo upon
16353  // destruction of the TestCase object.
16354  void AddTestInfo(TestInfo * test_info);
16355
16356  // Clears the results of all tests in this test case.
16357  void ClearResult();
16358
16359  // Clears the results of all tests in the given test case.
16360  static void ClearTestCaseResult(TestCase* test_case) {
16361    test_case->ClearResult();
16362  }
16363
16364  // Runs every test in this TestCase.
16365  void Run();
16366
16367  // Returns true iff test passed.
16368  static bool TestPassed(const TestInfo * test_info);
16369
16370  // Returns true iff test failed.
16371  static bool TestFailed(const TestInfo * test_info);
16372
16373  // Returns true iff test is disabled.
16374  static bool TestDisabled(const TestInfo * test_info);
16375
16376  // Returns true if the given test should run.
16377  static bool ShouldRunTest(const TestInfo *test_info);
16378
16379  // Shuffles the tests in this test case.
16380  void ShuffleTests(internal::Random* random);
16381
16382  // Restores the test order to before the first shuffle.
16383  void UnshuffleTests();
16384
16385  // Name of the test case.
16386  internal::String name_;
16387  // Comment on the test case.
16388  internal::String comment_;
16389  // The vector of TestInfos in their original order.  It owns the
16390  // elements in the vector.
16391  std::vector<TestInfo*> test_info_list_;
16392  // Provides a level of indirection for the test list to allow easy
16393  // shuffling and restoring the test order.  The i-th element in this
16394  // vector is the index of the i-th test in the shuffled test list.
16395  std::vector<int> test_indices_;
16396  // Pointer to the function that sets up the test case.
16397  Test::SetUpTestCaseFunc set_up_tc_;
16398  // Pointer to the function that tears down the test case.
16399  Test::TearDownTestCaseFunc tear_down_tc_;
16400  // True iff any test in this test case should run.
16401  bool should_run_;
16402  // Elapsed time, in milliseconds.
16403  TimeInMillis elapsed_time_;
16404
16405  // We disallow copying TestCases.
16406  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
16407};
16408
16409// An Environment object is capable of setting up and tearing down an
16410// environment.  The user should subclass this to define his own
16411// environment(s).
16412//
16413// An Environment object does the set-up and tear-down in virtual
16414// methods SetUp() and TearDown() instead of the constructor and the
16415// destructor, as:
16416//
16417//   1. You cannot safely throw from a destructor.  This is a problem
16418//      as in some cases Google Test is used where exceptions are enabled, and
16419//      we may want to implement ASSERT_* using exceptions where they are
16420//      available.
16421//   2. You cannot use ASSERT_* directly in a constructor or
16422//      destructor.
16423class Environment {
16424 public:
16425  // The d'tor is virtual as we need to subclass Environment.
16426  virtual ~Environment() {}
16427
16428  // Override this to define how to set up the environment.
16429  virtual void SetUp() {}
16430
16431  // Override this to define how to tear down the environment.
16432  virtual void TearDown() {}
16433 private:
16434  // If you see an error about overriding the following function or
16435  // about it being private, you have mis-spelled SetUp() as Setup().
16436  struct Setup_should_be_spelled_SetUp {};
16437  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
16438};
16439
16440// The interface for tracing execution of tests. The methods are organized in
16441// the order the corresponding events are fired.
16442class TestEventListener {
16443 public:
16444  virtual ~TestEventListener() {}
16445
16446  // Fired before any test activity starts.
16447  virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
16448
16449  // Fired before each iteration of tests starts.  There may be more than
16450  // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
16451  // index, starting from 0.
16452  virtual void OnTestIterationStart(const UnitTest& unit_test,
16453                                    int iteration) = 0;
16454
16455  // Fired before environment set-up for each iteration of tests starts.
16456  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
16457
16458  // Fired after environment set-up for each iteration of tests ends.
16459  virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
16460
16461  // Fired before the test case starts.
16462  virtual void OnTestCaseStart(const TestCase& test_case) = 0;
16463
16464  // Fired before the test starts.
16465  virtual void OnTestStart(const TestInfo& test_info) = 0;
16466
16467  // Fired after a failed assertion or a SUCCESS().
16468  virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
16469
16470  // Fired after the test ends.
16471  virtual void OnTestEnd(const TestInfo& test_info) = 0;
16472
16473  // Fired after the test case ends.
16474  virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
16475
16476  // Fired before environment tear-down for each iteration of tests starts.
16477  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
16478
16479  // Fired after environment tear-down for each iteration of tests ends.
16480  virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
16481
16482  // Fired after each iteration of tests finishes.
16483  virtual void OnTestIterationEnd(const UnitTest& unit_test,
16484                                  int iteration) = 0;
16485
16486  // Fired after all test activities have ended.
16487  virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
16488};
16489
16490// The convenience class for users who need to override just one or two
16491// methods and are not concerned that a possible change to a signature of
16492// the methods they override will not be caught during the build.  For
16493// comments about each method please see the definition of TestEventListener
16494// above.
16495class EmptyTestEventListener : public TestEventListener {
16496 public:
16497  virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
16498  virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
16499                                    int /*iteration*/) {}
16500  virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
16501  virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
16502  virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
16503  virtual void OnTestStart(const TestInfo& /*test_info*/) {}
16504  virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
16505  virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
16506  virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
16507  virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
16508  virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
16509  virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
16510                                  int /*iteration*/) {}
16511  virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
16512};
16513
16514// TestEventListeners lets users add listeners to track events in Google Test.
16515class GTEST_API_ TestEventListeners {
16516 public:
16517  TestEventListeners();
16518  ~TestEventListeners();
16519
16520  // Appends an event listener to the end of the list. Google Test assumes
16521  // the ownership of the listener (i.e. it will delete the listener when
16522  // the test program finishes).
16523  void Append(TestEventListener* listener);
16524
16525  // Removes the given event listener from the list and returns it.  It then
16526  // becomes the caller's responsibility to delete the listener. Returns
16527  // NULL if the listener is not found in the list.
16528  TestEventListener* Release(TestEventListener* listener);
16529
16530  // Returns the standard listener responsible for the default console
16531  // output.  Can be removed from the listeners list to shut down default
16532  // console output.  Note that removing this object from the listener list
16533  // with Release transfers its ownership to the caller and makes this
16534  // function return NULL the next time.
16535  TestEventListener* default_result_printer() const {
16536    return default_result_printer_;
16537  }
16538
16539  // Returns the standard listener responsible for the default XML output
16540  // controlled by the --gtest_output=xml flag.  Can be removed from the
16541  // listeners list by users who want to shut down the default XML output
16542  // controlled by this flag and substitute it with custom one.  Note that
16543  // removing this object from the listener list with Release transfers its
16544  // ownership to the caller and makes this function return NULL the next
16545  // time.
16546  TestEventListener* default_xml_generator() const {
16547    return default_xml_generator_;
16548  }
16549
16550 private:
16551  friend class TestCase;
16552  friend class internal::DefaultGlobalTestPartResultReporter;
16553  friend class internal::NoExecDeathTest;
16554  friend class internal::TestEventListenersAccessor;
16555  friend class internal::TestInfoImpl;
16556  friend class internal::UnitTestImpl;
16557
16558  // Returns repeater that broadcasts the TestEventListener events to all
16559  // subscribers.
16560  TestEventListener* repeater();
16561
16562  // Sets the default_result_printer attribute to the provided listener.
16563  // The listener is also added to the listener list and previous
16564  // default_result_printer is removed from it and deleted. The listener can
16565  // also be NULL in which case it will not be added to the list. Does
16566  // nothing if the previous and the current listener objects are the same.
16567  void SetDefaultResultPrinter(TestEventListener* listener);
16568
16569  // Sets the default_xml_generator attribute to the provided listener.  The
16570  // listener is also added to the listener list and previous
16571  // default_xml_generator is removed from it and deleted. The listener can
16572  // also be NULL in which case it will not be added to the list. Does
16573  // nothing if the previous and the current listener objects are the same.
16574  void SetDefaultXmlGenerator(TestEventListener* listener);
16575
16576  // Controls whether events will be forwarded by the repeater to the
16577  // listeners in the list.
16578  bool EventForwardingEnabled() const;
16579  void SuppressEventForwarding();
16580
16581  // The actual list of listeners.
16582  internal::TestEventRepeater* repeater_;
16583  // Listener responsible for the standard result output.
16584  TestEventListener* default_result_printer_;
16585  // Listener responsible for the creation of the XML output file.
16586  TestEventListener* default_xml_generator_;
16587
16588  // We disallow copying TestEventListeners.
16589  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
16590};
16591
16592// A UnitTest consists of a vector of TestCases.
16593//
16594// This is a singleton class.  The only instance of UnitTest is
16595// created when UnitTest::GetInstance() is first called.  This
16596// instance is never deleted.
16597//
16598// UnitTest is not copyable.
16599//
16600// This class is thread-safe as long as the methods are called
16601// according to their specification.
16602class GTEST_API_ UnitTest {
16603 public:
16604  // Gets the singleton UnitTest object.  The first time this method
16605  // is called, a UnitTest object is constructed and returned.
16606  // Consecutive calls will return the same object.
16607  static UnitTest* GetInstance();
16608
16609  // Runs all tests in this UnitTest object and prints the result.
16610  // Returns 0 if successful, or 1 otherwise.
16611  //
16612  // This method can only be called from the main thread.
16613  //
16614  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
16615  int Run() GTEST_MUST_USE_RESULT_;
16616
16617  // Returns the working directory when the first TEST() or TEST_F()
16618  // was executed.  The UnitTest object owns the string.
16619  const char* original_working_dir() const;
16620
16621  // Returns the TestCase object for the test that's currently running,
16622  // or NULL if no test is running.
16623  const TestCase* current_test_case() const;
16624
16625  // Returns the TestInfo object for the test that's currently running,
16626  // or NULL if no test is running.
16627  const TestInfo* current_test_info() const;
16628
16629  // Returns the random seed used at the start of the current test run.
16630  int random_seed() const;
16631
16632#if GTEST_HAS_PARAM_TEST
16633  // Returns the ParameterizedTestCaseRegistry object used to keep track of
16634  // value-parameterized tests and instantiate and register them.
16635  //
16636  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
16637  internal::ParameterizedTestCaseRegistry& parameterized_test_registry();
16638#endif  // GTEST_HAS_PARAM_TEST
16639
16640  // Gets the number of successful test cases.
16641  int successful_test_case_count() const;
16642
16643  // Gets the number of failed test cases.
16644  int failed_test_case_count() const;
16645
16646  // Gets the number of all test cases.
16647  int total_test_case_count() const;
16648
16649  // Gets the number of all test cases that contain at least one test
16650  // that should run.
16651  int test_case_to_run_count() const;
16652
16653  // Gets the number of successful tests.
16654  int successful_test_count() const;
16655
16656  // Gets the number of failed tests.
16657  int failed_test_count() const;
16658
16659  // Gets the number of disabled tests.
16660  int disabled_test_count() const;
16661
16662  // Gets the number of all tests.
16663  int total_test_count() const;
16664
16665  // Gets the number of tests that should run.
16666  int test_to_run_count() const;
16667
16668  // Gets the elapsed time, in milliseconds.
16669  TimeInMillis elapsed_time() const;
16670
16671  // Returns true iff the unit test passed (i.e. all test cases passed).
16672  bool Passed() const;
16673
16674  // Returns true iff the unit test failed (i.e. some test case failed
16675  // or something outside of all tests failed).
16676  bool Failed() const;
16677
16678  // Gets the i-th test case among all the test cases. i can range from 0 to
16679  // total_test_case_count() - 1. If i is not in that range, returns NULL.
16680  const TestCase* GetTestCase(int i) const;
16681
16682  // Returns the list of event listeners that can be used to track events
16683  // inside Google Test.
16684  TestEventListeners& listeners();
16685
16686 private:
16687  // Registers and returns a global test environment.  When a test
16688  // program is run, all global test environments will be set-up in
16689  // the order they were registered.  After all tests in the program
16690  // have finished, all global test environments will be torn-down in
16691  // the *reverse* order they were registered.
16692  //
16693  // The UnitTest object takes ownership of the given environment.
16694  //
16695  // This method can only be called from the main thread.
16696  Environment* AddEnvironment(Environment* env);
16697
16698  // Adds a TestPartResult to the current TestResult object.  All
16699  // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
16700  // eventually call this to report their results.  The user code
16701  // should use the assertion macros instead of calling this directly.
16702  void AddTestPartResult(TestPartResult::Type result_type,
16703                         const char* file_name,
16704                         int line_number,
16705                         const internal::String& message,
16706                         const internal::String& os_stack_trace);
16707
16708  // Adds a TestProperty to the current TestResult object. If the result already
16709  // contains a property with the same key, the value will be updated.
16710  void RecordPropertyForCurrentTest(const char* key, const char* value);
16711
16712  // Gets the i-th test case among all the test cases. i can range from 0 to
16713  // total_test_case_count() - 1. If i is not in that range, returns NULL.
16714  TestCase* GetMutableTestCase(int i);
16715
16716  // Accessors for the implementation object.
16717  internal::UnitTestImpl* impl() { return impl_; }
16718  const internal::UnitTestImpl* impl() const { return impl_; }
16719
16720  // These classes and funcions are friends as they need to access private
16721  // members of UnitTest.
16722  friend class Test;
16723  friend class internal::AssertHelper;
16724  friend class internal::ScopedTrace;
16725  friend Environment* AddGlobalTestEnvironment(Environment* env);
16726  friend internal::UnitTestImpl* internal::GetUnitTestImpl();
16727  friend void internal::ReportFailureInUnknownLocation(
16728      TestPartResult::Type result_type,
16729      const internal::String& message);
16730
16731  // Creates an empty UnitTest.
16732  UnitTest();
16733
16734  // D'tor
16735  virtual ~UnitTest();
16736
16737  // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
16738  // Google Test trace stack.
16739  void PushGTestTrace(const internal::TraceInfo& trace);
16740
16741  // Pops a trace from the per-thread Google Test trace stack.
16742  void PopGTestTrace();
16743
16744  // Protects mutable state in *impl_.  This is mutable as some const
16745  // methods need to lock it too.
16746  mutable internal::Mutex mutex_;
16747
16748  // Opaque implementation object.  This field is never changed once
16749  // the object is constructed.  We don't mark it as const here, as
16750  // doing so will cause a warning in the constructor of UnitTest.
16751  // Mutable state in *impl_ is protected by mutex_.
16752  internal::UnitTestImpl* impl_;
16753
16754  // We disallow copying UnitTest.
16755  GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
16756};
16757
16758// A convenient wrapper for adding an environment for the test
16759// program.
16760//
16761// You should call this before RUN_ALL_TESTS() is called, probably in
16762// main().  If you use gtest_main, you need to call this before main()
16763// starts for it to take effect.  For example, you can define a global
16764// variable like this:
16765//
16766//   testing::Environment* const foo_env =
16767//       testing::AddGlobalTestEnvironment(new FooEnvironment);
16768//
16769// However, we strongly recommend you to write your own main() and
16770// call AddGlobalTestEnvironment() there, as relying on initialization
16771// of global variables makes the code harder to read and may cause
16772// problems when you register multiple environments from different
16773// translation units and the environments have dependencies among them
16774// (remember that the compiler doesn't guarantee the order in which
16775// global variables from different translation units are initialized).
16776inline Environment* AddGlobalTestEnvironment(Environment* env) {
16777  return UnitTest::GetInstance()->AddEnvironment(env);
16778}
16779
16780// Initializes Google Test.  This must be called before calling
16781// RUN_ALL_TESTS().  In particular, it parses a command line for the
16782// flags that Google Test recognizes.  Whenever a Google Test flag is
16783// seen, it is removed from argv, and *argc is decremented.
16784//
16785// No value is returned.  Instead, the Google Test flag variables are
16786// updated.
16787//
16788// Calling the function for the second time has no user-visible effect.
16789GTEST_API_ void InitGoogleTest(int* argc, char** argv);
16790
16791// This overloaded version can be used in Windows programs compiled in
16792// UNICODE mode.
16793GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
16794
16795namespace internal {
16796
16797// These overloaded versions handle ::std::string and ::std::wstring.
16798GTEST_API_ inline String FormatForFailureMessage(const ::std::string& str) {
16799  return (Message() << '"' << str << '"').GetString();
16800}
16801
16802#if GTEST_HAS_STD_WSTRING
16803GTEST_API_ inline String FormatForFailureMessage(const ::std::wstring& wstr) {
16804  return (Message() << "L\"" << wstr << '"').GetString();
16805}
16806#endif  // GTEST_HAS_STD_WSTRING
16807
16808// These overloaded versions handle ::string and ::wstring.
16809#if GTEST_HAS_GLOBAL_STRING
16810GTEST_API_ inline String FormatForFailureMessage(const ::string& str) {
16811  return (Message() << '"' << str << '"').GetString();
16812}
16813#endif  // GTEST_HAS_GLOBAL_STRING
16814
16815#if GTEST_HAS_GLOBAL_WSTRING
16816GTEST_API_ inline String FormatForFailureMessage(const ::wstring& wstr) {
16817  return (Message() << "L\"" << wstr << '"').GetString();
16818}
16819#endif  // GTEST_HAS_GLOBAL_WSTRING
16820
16821// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
16822// operand to be used in a failure message.  The type (but not value)
16823// of the other operand may affect the format.  This allows us to
16824// print a char* as a raw pointer when it is compared against another
16825// char*, and print it as a C string when it is compared against an
16826// std::string object, for example.
16827//
16828// The default implementation ignores the type of the other operand.
16829// Some specialized versions are used to handle formatting wide or
16830// narrow C strings.
16831//
16832// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
16833template <typename T1, typename T2>
16834String FormatForComparisonFailureMessage(const T1& value,
16835                                         const T2& /* other_operand */) {
16836  return FormatForFailureMessage(value);
16837}
16838
16839// The helper function for {ASSERT|EXPECT}_EQ.
16840template <typename T1, typename T2>
16841AssertionResult CmpHelperEQ(const char* expected_expression,
16842                            const char* actual_expression,
16843                            const T1& expected,
16844                            const T2& actual) {
16845#ifdef _MSC_VER
16846#pragma warning(push)          // Saves the current warning state.
16847#pragma warning(disable:4389)  // Temporarily disables warning on
16848                               // signed/unsigned mismatch.
16849#endif
16850
16851  if (expected == actual) {
16852    return AssertionSuccess();
16853  }
16854
16855#ifdef _MSC_VER
16856#pragma warning(pop)          // Restores the warning state.
16857#endif
16858
16859  return EqFailure(expected_expression,
16860                   actual_expression,
16861                   FormatForComparisonFailureMessage(expected, actual),
16862                   FormatForComparisonFailureMessage(actual, expected),
16863                   false);
16864}
16865
16866// With this overloaded version, we allow anonymous enums to be used
16867// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
16868// can be implicitly cast to BiggestInt.
16869GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
16870                                       const char* actual_expression,
16871                                       BiggestInt expected,
16872                                       BiggestInt actual);
16873
16874// The helper class for {ASSERT|EXPECT}_EQ.  The template argument
16875// lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
16876// is a null pointer literal.  The following default implementation is
16877// for lhs_is_null_literal being false.
16878template <bool lhs_is_null_literal>
16879class EqHelper {
16880 public:
16881  // This templatized version is for the general case.
16882  template <typename T1, typename T2>
16883  static AssertionResult Compare(const char* expected_expression,
16884                                 const char* actual_expression,
16885                                 const T1& expected,
16886                                 const T2& actual) {
16887    return CmpHelperEQ(expected_expression, actual_expression, expected,
16888                       actual);
16889  }
16890
16891  // With this overloaded version, we allow anonymous enums to be used
16892  // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
16893  // enums can be implicitly cast to BiggestInt.
16894  //
16895  // Even though its body looks the same as the above version, we
16896  // cannot merge the two, as it will make anonymous enums unhappy.
16897  static AssertionResult Compare(const char* expected_expression,
16898                                 const char* actual_expression,
16899                                 BiggestInt expected,
16900                                 BiggestInt actual) {
16901    return CmpHelperEQ(expected_expression, actual_expression, expected,
16902                       actual);
16903  }
16904};
16905
16906// This specialization is used when the first argument to ASSERT_EQ()
16907// is a null pointer literal.
16908template <>
16909class EqHelper<true> {
16910 public:
16911  // We define two overloaded versions of Compare().  The first
16912  // version will be picked when the second argument to ASSERT_EQ() is
16913  // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
16914  // EXPECT_EQ(false, a_bool).
16915  template <typename T1, typename T2>
16916  static AssertionResult Compare(const char* expected_expression,
16917                                 const char* actual_expression,
16918                                 const T1& expected,
16919                                 const T2& actual) {
16920    return CmpHelperEQ(expected_expression, actual_expression, expected,
16921                       actual);
16922  }
16923
16924  // This version will be picked when the second argument to
16925  // ASSERT_EQ() is a pointer, e.g. ASSERT_EQ(NULL, a_pointer).
16926  template <typename T1, typename T2>
16927  static AssertionResult Compare(const char* expected_expression,
16928                                 const char* actual_expression,
16929                                 const T1& /* expected */,
16930                                 T2* actual) {
16931    // We already know that 'expected' is a null pointer.
16932    return CmpHelperEQ(expected_expression, actual_expression,
16933                       static_cast<T2*>(NULL), actual);
16934  }
16935};
16936
16937// A macro for implementing the helper functions needed to implement
16938// ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste
16939// of similar code.
16940//
16941// For each templatized helper function, we also define an overloaded
16942// version for BiggestInt in order to reduce code bloat and allow
16943// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
16944// with gcc 4.
16945//
16946// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
16947#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
16948template <typename T1, typename T2>\
16949AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
16950                                   const T1& val1, const T2& val2) {\
16951  if (val1 op val2) {\
16952    return AssertionSuccess();\
16953  } else {\
16954    Message msg;\
16955    msg << "Expected: (" << expr1 << ") " #op " (" << expr2\
16956        << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
16957        << " vs " << FormatForComparisonFailureMessage(val2, val1);\
16958    return AssertionFailure(msg);\
16959  }\
16960}\
16961GTEST_API_ AssertionResult CmpHelper##op_name(\
16962    const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
16963
16964// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
16965
16966// Implements the helper function for {ASSERT|EXPECT}_NE
16967GTEST_IMPL_CMP_HELPER_(NE, !=);
16968// Implements the helper function for {ASSERT|EXPECT}_LE
16969GTEST_IMPL_CMP_HELPER_(LE, <=);
16970// Implements the helper function for {ASSERT|EXPECT}_LT
16971GTEST_IMPL_CMP_HELPER_(LT, < );
16972// Implements the helper function for {ASSERT|EXPECT}_GE
16973GTEST_IMPL_CMP_HELPER_(GE, >=);
16974// Implements the helper function for {ASSERT|EXPECT}_GT
16975GTEST_IMPL_CMP_HELPER_(GT, > );
16976
16977#undef GTEST_IMPL_CMP_HELPER_
16978
16979// The helper function for {ASSERT|EXPECT}_STREQ.
16980//
16981// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
16982GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
16983                                          const char* actual_expression,
16984                                          const char* expected,
16985                                          const char* actual);
16986
16987// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
16988//
16989// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
16990GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
16991                                              const char* actual_expression,
16992                                              const char* expected,
16993                                              const char* actual);
16994
16995// The helper function for {ASSERT|EXPECT}_STRNE.
16996//
16997// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
16998GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
16999                                          const char* s2_expression,
17000                                          const char* s1,
17001                                          const char* s2);
17002
17003// The helper function for {ASSERT|EXPECT}_STRCASENE.
17004//
17005// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
17006GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
17007                                              const char* s2_expression,
17008                                              const char* s1,
17009                                              const char* s2);
17010
17011
17012// Helper function for *_STREQ on wide strings.
17013//
17014// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
17015GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
17016                                          const char* actual_expression,
17017                                          const wchar_t* expected,
17018                                          const wchar_t* actual);
17019
17020// Helper function for *_STRNE on wide strings.
17021//
17022// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
17023GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
17024                                          const char* s2_expression,
17025                                          const wchar_t* s1,
17026                                          const wchar_t* s2);
17027
17028}  // namespace internal
17029
17030// IsSubstring() and IsNotSubstring() are intended to be used as the
17031// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
17032// themselves.  They check whether needle is a substring of haystack
17033// (NULL is considered a substring of itself only), and return an
17034// appropriate error message when they fail.
17035//
17036// The {needle,haystack}_expr arguments are the stringified
17037// expressions that generated the two real arguments.
17038GTEST_API_ AssertionResult IsSubstring(
17039    const char* needle_expr, const char* haystack_expr,
17040    const char* needle, const char* haystack);
17041GTEST_API_ AssertionResult IsSubstring(
17042    const char* needle_expr, const char* haystack_expr,
17043    const wchar_t* needle, const wchar_t* haystack);
17044GTEST_API_ AssertionResult IsNotSubstring(
17045    const char* needle_expr, const char* haystack_expr,
17046    const char* needle, const char* haystack);
17047GTEST_API_ AssertionResult IsNotSubstring(
17048    const char* needle_expr, const char* haystack_expr,
17049    const wchar_t* needle, const wchar_t* haystack);
17050GTEST_API_ AssertionResult IsSubstring(
17051    const char* needle_expr, const char* haystack_expr,
17052    const ::std::string& needle, const ::std::string& haystack);
17053GTEST_API_ AssertionResult IsNotSubstring(
17054    const char* needle_expr, const char* haystack_expr,
17055    const ::std::string& needle, const ::std::string& haystack);
17056
17057#if GTEST_HAS_STD_WSTRING
17058GTEST_API_ AssertionResult IsSubstring(
17059    const char* needle_expr, const char* haystack_expr,
17060    const ::std::wstring& needle, const ::std::wstring& haystack);
17061GTEST_API_ AssertionResult IsNotSubstring(
17062    const char* needle_expr, const char* haystack_expr,
17063    const ::std::wstring& needle, const ::std::wstring& haystack);
17064#endif  // GTEST_HAS_STD_WSTRING
17065
17066namespace internal {
17067
17068// Helper template function for comparing floating-points.
17069//
17070// Template parameter:
17071//
17072//   RawType: the raw floating-point type (either float or double)
17073//
17074// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
17075template <typename RawType>
17076AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
17077                                         const char* actual_expression,
17078                                         RawType expected,
17079                                         RawType actual) {
17080  const FloatingPoint<RawType> lhs(expected), rhs(actual);
17081
17082  if (lhs.AlmostEquals(rhs)) {
17083    return AssertionSuccess();
17084  }
17085
17086  StrStream expected_ss;
17087  expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
17088              << expected;
17089
17090  StrStream actual_ss;
17091  actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
17092            << actual;
17093
17094  return EqFailure(expected_expression,
17095                   actual_expression,
17096                   StrStreamToString(&expected_ss),
17097                   StrStreamToString(&actual_ss),
17098                   false);
17099}
17100
17101// Helper function for implementing ASSERT_NEAR.
17102//
17103// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
17104GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
17105                                                const char* expr2,
17106                                                const char* abs_error_expr,
17107                                                double val1,
17108                                                double val2,
17109                                                double abs_error);
17110
17111// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17112// A class that enables one to stream messages to assertion macros
17113class GTEST_API_ AssertHelper {
17114 public:
17115  // Constructor.
17116  AssertHelper(TestPartResult::Type type,
17117               const char* file,
17118               int line,
17119               const char* message);
17120  ~AssertHelper();
17121
17122  // Message assignment is a semantic trick to enable assertion
17123  // streaming; see the GTEST_MESSAGE_ macro below.
17124  void operator=(const Message& message) const;
17125
17126 private:
17127  // We put our data in a struct so that the size of the AssertHelper class can
17128  // be as small as possible.  This is important because gcc is incapable of
17129  // re-using stack space even for temporary variables, so every EXPECT_EQ
17130  // reserves stack space for another AssertHelper.
17131  struct AssertHelperData {
17132    AssertHelperData(TestPartResult::Type t,
17133                     const char* srcfile,
17134                     int line_num,
17135                     const char* msg)
17136        : type(t), file(srcfile), line(line_num), message(msg) { }
17137
17138    TestPartResult::Type const type;
17139    const char*        const file;
17140    int                const line;
17141    String             const message;
17142
17143   private:
17144    GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
17145  };
17146
17147  AssertHelperData* const data_;
17148
17149  GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
17150};
17151
17152}  // namespace internal
17153
17154#if GTEST_HAS_PARAM_TEST
17155// The abstract base class that all value-parameterized tests inherit from.
17156//
17157// This class adds support for accessing the test parameter value via
17158// the GetParam() method.
17159//
17160// Use it with one of the parameter generator defining functions, like Range(),
17161// Values(), ValuesIn(), Bool(), and Combine().
17162//
17163// class FooTest : public ::testing::TestWithParam<int> {
17164//  protected:
17165//   FooTest() {
17166//     // Can use GetParam() here.
17167//   }
17168//   virtual ~FooTest() {
17169//     // Can use GetParam() here.
17170//   }
17171//   virtual void SetUp() {
17172//     // Can use GetParam() here.
17173//   }
17174//   virtual void TearDown {
17175//     // Can use GetParam() here.
17176//   }
17177// };
17178// TEST_P(FooTest, DoesBar) {
17179//   // Can use GetParam() method here.
17180//   Foo foo;
17181//   ASSERT_TRUE(foo.DoesBar(GetParam()));
17182// }
17183// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
17184
17185template <typename T>
17186class TestWithParam : public Test {
17187 public:
17188  typedef T ParamType;
17189
17190  // The current parameter value. Is also available in the test fixture's
17191  // constructor.
17192  const ParamType& GetParam() const { return *parameter_; }
17193
17194 private:
17195  // Sets parameter value. The caller is responsible for making sure the value
17196  // remains alive and unchanged throughout the current test.
17197  static void SetParam(const ParamType* parameter) {
17198    parameter_ = parameter;
17199  }
17200
17201  // Static value used for accessing parameter during a test lifetime.
17202  static const ParamType* parameter_;
17203
17204  // TestClass must be a subclass of TestWithParam<T>.
17205  template <class TestClass> friend class internal::ParameterizedTestFactory;
17206};
17207
17208template <typename T>
17209const T* TestWithParam<T>::parameter_ = NULL;
17210
17211#endif  // GTEST_HAS_PARAM_TEST
17212
17213// Macros for indicating success/failure in test code.
17214
17215// ADD_FAILURE unconditionally adds a failure to the current test.
17216// SUCCEED generates a success - it doesn't automatically make the
17217// current test successful, as a test is only successful when it has
17218// no failure.
17219//
17220// EXPECT_* verifies that a certain condition is satisfied.  If not,
17221// it behaves like ADD_FAILURE.  In particular:
17222//
17223//   EXPECT_TRUE  verifies that a Boolean condition is true.
17224//   EXPECT_FALSE verifies that a Boolean condition is false.
17225//
17226// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
17227// that they will also abort the current function on failure.  People
17228// usually want the fail-fast behavior of FAIL and ASSERT_*, but those
17229// writing data-driven tests often find themselves using ADD_FAILURE
17230// and EXPECT_* more.
17231//
17232// Examples:
17233//
17234//   EXPECT_TRUE(server.StatusIsOK());
17235//   ASSERT_FALSE(server.HasPendingRequest(port))
17236//       << "There are still pending requests " << "on port " << port;
17237
17238// Generates a nonfatal failure with a generic message.
17239#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
17240
17241// Generates a fatal failure with a generic message.
17242#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
17243
17244// Define this macro to 1 to omit the definition of FAIL(), which is a
17245// generic name and clashes with some other libraries.
17246#if !GTEST_DONT_DEFINE_FAIL
17247#define FAIL() GTEST_FAIL()
17248#endif
17249
17250// Generates a success with a generic message.
17251#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
17252
17253// Define this macro to 1 to omit the definition of SUCCEED(), which
17254// is a generic name and clashes with some other libraries.
17255#if !GTEST_DONT_DEFINE_SUCCEED
17256#define SUCCEED() GTEST_SUCCEED()
17257#endif
17258
17259// Macros for testing exceptions.
17260//
17261//    * {ASSERT|EXPECT}_THROW(statement, expected_exception):
17262//         Tests that the statement throws the expected exception.
17263//    * {ASSERT|EXPECT}_NO_THROW(statement):
17264//         Tests that the statement doesn't throw any exception.
17265//    * {ASSERT|EXPECT}_ANY_THROW(statement):
17266//         Tests that the statement throws an exception.
17267
17268#define EXPECT_THROW(statement, expected_exception) \
17269  GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
17270#define EXPECT_NO_THROW(statement) \
17271  GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
17272#define EXPECT_ANY_THROW(statement) \
17273  GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
17274#define ASSERT_THROW(statement, expected_exception) \
17275  GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
17276#define ASSERT_NO_THROW(statement) \
17277  GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
17278#define ASSERT_ANY_THROW(statement) \
17279  GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
17280
17281// Boolean assertions. Condition can be either a Boolean expression or an
17282// AssertionResult. For more information on how to use AssertionResult with
17283// these macros see comments on that class.
17284#define EXPECT_TRUE(condition) \
17285  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
17286                      GTEST_NONFATAL_FAILURE_)
17287#define EXPECT_FALSE(condition) \
17288  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
17289                      GTEST_NONFATAL_FAILURE_)
17290#define ASSERT_TRUE(condition) \
17291  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
17292                      GTEST_FATAL_FAILURE_)
17293#define ASSERT_FALSE(condition) \
17294  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
17295                      GTEST_FATAL_FAILURE_)
17296
17297// Includes the auto-generated header that implements a family of
17298// generic predicate assertion macros.
17299// Copyright 2006, Google Inc.
17300// All rights reserved.
17301//
17302// Redistribution and use in source and binary forms, with or without
17303// modification, are permitted provided that the following conditions are
17304// met:
17305//
17306//     * Redistributions of source code must retain the above copyright
17307// notice, this list of conditions and the following disclaimer.
17308//     * Redistributions in binary form must reproduce the above
17309// copyright notice, this list of conditions and the following disclaimer
17310// in the documentation and/or other materials provided with the
17311// distribution.
17312//     * Neither the name of Google Inc. nor the names of its
17313// contributors may be used to endorse or promote products derived from
17314// this software without specific prior written permission.
17315//
17316// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17317// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17318// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17319// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17320// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17321// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17322// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17323// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17324// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17325// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17326// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17327
17328// This file is AUTOMATICALLY GENERATED on 10/02/2008 by command
17329// 'gen_gtest_pred_impl.py 5'.  DO NOT EDIT BY HAND!
17330//
17331// Implements a family of generic predicate assertion macros.
17332
17333#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
17334#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
17335
17336// Makes sure this header is not included before gtest.h.
17337#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
17338#error Do not include gtest_pred_impl.h directly.  Include gtest.h instead.
17339#endif  // GTEST_INCLUDE_GTEST_GTEST_H_
17340
17341// This header implements a family of generic predicate assertion
17342// macros:
17343//
17344//   ASSERT_PRED_FORMAT1(pred_format, v1)
17345//   ASSERT_PRED_FORMAT2(pred_format, v1, v2)
17346//   ...
17347//
17348// where pred_format is a function or functor that takes n (in the
17349// case of ASSERT_PRED_FORMATn) values and their source expression
17350// text, and returns a testing::AssertionResult.  See the definition
17351// of ASSERT_EQ in gtest.h for an example.
17352//
17353// If you don't care about formatting, you can use the more
17354// restrictive version:
17355//
17356//   ASSERT_PRED1(pred, v1)
17357//   ASSERT_PRED2(pred, v1, v2)
17358//   ...
17359//
17360// where pred is an n-ary function or functor that returns bool,
17361// and the values v1, v2, ..., must support the << operator for
17362// streaming to std::ostream.
17363//
17364// We also define the EXPECT_* variations.
17365//
17366// For now we only support predicates whose arity is at most 5.
17367// Please email googletestframework@googlegroups.com if you need
17368// support for higher arities.
17369
17370// GTEST_ASSERT_ is the basic statement to which all of the assertions
17371// in this file reduce.  Don't use this in your code.
17372
17373#define GTEST_ASSERT_(expression, on_failure) \
17374  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
17375  if (const ::testing::AssertionResult gtest_ar = (expression)) \
17376    ; \
17377  else \
17378    on_failure(gtest_ar.failure_message())
17379
17380
17381// Helper function for implementing {EXPECT|ASSERT}_PRED1.  Don't use
17382// this in your code.
17383template <typename Pred,
17384          typename T1>
17385AssertionResult AssertPred1Helper(const char* pred_text,
17386                                  const char* e1,
17387                                  Pred pred,
17388                                  const T1& v1) {
17389  if (pred(v1)) return AssertionSuccess();
17390
17391  Message msg;
17392  msg << pred_text << "("
17393      << e1 << ") evaluates to false, where"
17394      << "\n" << e1 << " evaluates to " << v1;
17395  return AssertionFailure(msg);
17396}
17397
17398// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
17399// Don't use this in your code.
17400#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
17401  GTEST_ASSERT_(pred_format(#v1, v1),\
17402                on_failure)
17403
17404// Internal macro for implementing {EXPECT|ASSERT}_PRED1.  Don't use
17405// this in your code.
17406#define GTEST_PRED1_(pred, v1, on_failure)\
17407  GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
17408                                             #v1, \
17409                                             pred, \
17410                                             v1), on_failure)
17411
17412// Unary predicate assertion macros.
17413#define EXPECT_PRED_FORMAT1(pred_format, v1) \
17414  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
17415#define EXPECT_PRED1(pred, v1) \
17416  GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
17417#define ASSERT_PRED_FORMAT1(pred_format, v1) \
17418  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
17419#define ASSERT_PRED1(pred, v1) \
17420  GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
17421
17422
17423
17424// Helper function for implementing {EXPECT|ASSERT}_PRED2.  Don't use
17425// this in your code.
17426template <typename Pred,
17427          typename T1,
17428          typename T2>
17429AssertionResult AssertPred2Helper(const char* pred_text,
17430                                  const char* e1,
17431                                  const char* e2,
17432                                  Pred pred,
17433                                  const T1& v1,
17434                                  const T2& v2) {
17435  if (pred(v1, v2)) return AssertionSuccess();
17436
17437  Message msg;
17438  msg << pred_text << "("
17439      << e1 << ", "
17440      << e2 << ") evaluates to false, where"
17441      << "\n" << e1 << " evaluates to " << v1
17442      << "\n" << e2 << " evaluates to " << v2;
17443  return AssertionFailure(msg);
17444}
17445
17446// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
17447// Don't use this in your code.
17448#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
17449  GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2),\
17450                on_failure)
17451
17452// Internal macro for implementing {EXPECT|ASSERT}_PRED2.  Don't use
17453// this in your code.
17454#define GTEST_PRED2_(pred, v1, v2, on_failure)\
17455  GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
17456                                             #v1, \
17457                                             #v2, \
17458                                             pred, \
17459                                             v1, \
17460                                             v2), on_failure)
17461
17462// Binary predicate assertion macros.
17463#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
17464  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
17465#define EXPECT_PRED2(pred, v1, v2) \
17466  GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
17467#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
17468  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
17469#define ASSERT_PRED2(pred, v1, v2) \
17470  GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
17471
17472
17473
17474// Helper function for implementing {EXPECT|ASSERT}_PRED3.  Don't use
17475// this in your code.
17476template <typename Pred,
17477          typename T1,
17478          typename T2,
17479          typename T3>
17480AssertionResult AssertPred3Helper(const char* pred_text,
17481                                  const char* e1,
17482                                  const char* e2,
17483                                  const char* e3,
17484                                  Pred pred,
17485                                  const T1& v1,
17486                                  const T2& v2,
17487                                  const T3& v3) {
17488  if (pred(v1, v2, v3)) return AssertionSuccess();
17489
17490  Message msg;
17491  msg << pred_text << "("
17492      << e1 << ", "
17493      << e2 << ", "
17494      << e3 << ") evaluates to false, where"
17495      << "\n" << e1 << " evaluates to " << v1
17496      << "\n" << e2 << " evaluates to " << v2
17497      << "\n" << e3 << " evaluates to " << v3;
17498  return AssertionFailure(msg);
17499}
17500
17501// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
17502// Don't use this in your code.
17503#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
17504  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3),\
17505                on_failure)
17506
17507// Internal macro for implementing {EXPECT|ASSERT}_PRED3.  Don't use
17508// this in your code.
17509#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
17510  GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
17511                                             #v1, \
17512                                             #v2, \
17513                                             #v3, \
17514                                             pred, \
17515                                             v1, \
17516                                             v2, \
17517                                             v3), on_failure)
17518
17519// Ternary predicate assertion macros.
17520#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
17521  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
17522#define EXPECT_PRED3(pred, v1, v2, v3) \
17523  GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
17524#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
17525  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
17526#define ASSERT_PRED3(pred, v1, v2, v3) \
17527  GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
17528
17529
17530
17531// Helper function for implementing {EXPECT|ASSERT}_PRED4.  Don't use
17532// this in your code.
17533template <typename Pred,
17534          typename T1,
17535          typename T2,
17536          typename T3,
17537          typename T4>
17538AssertionResult AssertPred4Helper(const char* pred_text,
17539                                  const char* e1,
17540                                  const char* e2,
17541                                  const char* e3,
17542                                  const char* e4,
17543                                  Pred pred,
17544                                  const T1& v1,
17545                                  const T2& v2,
17546                                  const T3& v3,
17547                                  const T4& v4) {
17548  if (pred(v1, v2, v3, v4)) return AssertionSuccess();
17549
17550  Message msg;
17551  msg << pred_text << "("
17552      << e1 << ", "
17553      << e2 << ", "
17554      << e3 << ", "
17555      << e4 << ") evaluates to false, where"
17556      << "\n" << e1 << " evaluates to " << v1
17557      << "\n" << e2 << " evaluates to " << v2
17558      << "\n" << e3 << " evaluates to " << v3
17559      << "\n" << e4 << " evaluates to " << v4;
17560  return AssertionFailure(msg);
17561}
17562
17563// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
17564// Don't use this in your code.
17565#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
17566  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4),\
17567                on_failure)
17568
17569// Internal macro for implementing {EXPECT|ASSERT}_PRED4.  Don't use
17570// this in your code.
17571#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
17572  GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
17573                                             #v1, \
17574                                             #v2, \
17575                                             #v3, \
17576                                             #v4, \
17577                                             pred, \
17578                                             v1, \
17579                                             v2, \
17580                                             v3, \
17581                                             v4), on_failure)
17582
17583// 4-ary predicate assertion macros.
17584#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
17585  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
17586#define EXPECT_PRED4(pred, v1, v2, v3, v4) \
17587  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
17588#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
17589  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
17590#define ASSERT_PRED4(pred, v1, v2, v3, v4) \
17591  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
17592
17593
17594
17595// Helper function for implementing {EXPECT|ASSERT}_PRED5.  Don't use
17596// this in your code.
17597template <typename Pred,
17598          typename T1,
17599          typename T2,
17600          typename T3,
17601          typename T4,
17602          typename T5>
17603AssertionResult AssertPred5Helper(const char* pred_text,
17604                                  const char* e1,
17605                                  const char* e2,
17606                                  const char* e3,
17607                                  const char* e4,
17608                                  const char* e5,
17609                                  Pred pred,
17610                                  const T1& v1,
17611                                  const T2& v2,
17612                                  const T3& v3,
17613                                  const T4& v4,
17614                                  const T5& v5) {
17615  if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
17616
17617  Message msg;
17618  msg << pred_text << "("
17619      << e1 << ", "
17620      << e2 << ", "
17621      << e3 << ", "
17622      << e4 << ", "
17623      << e5 << ") evaluates to false, where"
17624      << "\n" << e1 << " evaluates to " << v1
17625      << "\n" << e2 << " evaluates to " << v2
17626      << "\n" << e3 << " evaluates to " << v3
17627      << "\n" << e4 << " evaluates to " << v4
17628      << "\n" << e5 << " evaluates to " << v5;
17629  return AssertionFailure(msg);
17630}
17631
17632// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
17633// Don't use this in your code.
17634#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
17635  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5),\
17636                on_failure)
17637
17638// Internal macro for implementing {EXPECT|ASSERT}_PRED5.  Don't use
17639// this in your code.
17640#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
17641  GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
17642                                             #v1, \
17643                                             #v2, \
17644                                             #v3, \
17645                                             #v4, \
17646                                             #v5, \
17647                                             pred, \
17648                                             v1, \
17649                                             v2, \
17650                                             v3, \
17651                                             v4, \
17652                                             v5), on_failure)
17653
17654// 5-ary predicate assertion macros.
17655#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
17656  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
17657#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
17658  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
17659#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
17660  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
17661#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
17662  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
17663
17664
17665
17666#endif  // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
17667
17668// Macros for testing equalities and inequalities.
17669//
17670//    * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
17671//    * {ASSERT|EXPECT}_NE(v1, v2):           Tests that v1 != v2
17672//    * {ASSERT|EXPECT}_LT(v1, v2):           Tests that v1 < v2
17673//    * {ASSERT|EXPECT}_LE(v1, v2):           Tests that v1 <= v2
17674//    * {ASSERT|EXPECT}_GT(v1, v2):           Tests that v1 > v2
17675//    * {ASSERT|EXPECT}_GE(v1, v2):           Tests that v1 >= v2
17676//
17677// When they are not, Google Test prints both the tested expressions and
17678// their actual values.  The values must be compatible built-in types,
17679// or you will get a compiler error.  By "compatible" we mean that the
17680// values can be compared by the respective operator.
17681//
17682// Note:
17683//
17684//   1. It is possible to make a user-defined type work with
17685//   {ASSERT|EXPECT}_??(), but that requires overloading the
17686//   comparison operators and is thus discouraged by the Google C++
17687//   Usage Guide.  Therefore, you are advised to use the
17688//   {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
17689//   equal.
17690//
17691//   2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
17692//   pointers (in particular, C strings).  Therefore, if you use it
17693//   with two C strings, you are testing how their locations in memory
17694//   are related, not how their content is related.  To compare two C
17695//   strings by content, use {ASSERT|EXPECT}_STR*().
17696//
17697//   3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
17698//   {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
17699//   what the actual value is when it fails, and similarly for the
17700//   other comparisons.
17701//
17702//   4. Do not depend on the order in which {ASSERT|EXPECT}_??()
17703//   evaluate their arguments, which is undefined.
17704//
17705//   5. These macros evaluate their arguments exactly once.
17706//
17707// Examples:
17708//
17709//   EXPECT_NE(5, Foo());
17710//   EXPECT_EQ(NULL, a_pointer);
17711//   ASSERT_LT(i, array_size);
17712//   ASSERT_GT(records.size(), 0) << "There is no record left.";
17713
17714#define EXPECT_EQ(expected, actual) \
17715  EXPECT_PRED_FORMAT2(::testing::internal:: \
17716                      EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
17717                      expected, actual)
17718#define EXPECT_NE(expected, actual) \
17719  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
17720#define EXPECT_LE(val1, val2) \
17721  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
17722#define EXPECT_LT(val1, val2) \
17723  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
17724#define EXPECT_GE(val1, val2) \
17725  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
17726#define EXPECT_GT(val1, val2) \
17727  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
17728
17729#define ASSERT_EQ(expected, actual) \
17730  ASSERT_PRED_FORMAT2(::testing::internal:: \
17731                      EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
17732                      expected, actual)
17733#define ASSERT_NE(val1, val2) \
17734  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
17735#define ASSERT_LE(val1, val2) \
17736  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
17737#define ASSERT_LT(val1, val2) \
17738  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
17739#define ASSERT_GE(val1, val2) \
17740  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
17741#define ASSERT_GT(val1, val2) \
17742  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
17743
17744// C String Comparisons.  All tests treat NULL and any non-NULL string
17745// as different.  Two NULLs are equal.
17746//
17747//    * {ASSERT|EXPECT}_STREQ(s1, s2):     Tests that s1 == s2
17748//    * {ASSERT|EXPECT}_STRNE(s1, s2):     Tests that s1 != s2
17749//    * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
17750//    * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
17751//
17752// For wide or narrow string objects, you can use the
17753// {ASSERT|EXPECT}_??() macros.
17754//
17755// Don't depend on the order in which the arguments are evaluated,
17756// which is undefined.
17757//
17758// These macros evaluate their arguments exactly once.
17759
17760#define EXPECT_STREQ(expected, actual) \
17761  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
17762#define EXPECT_STRNE(s1, s2) \
17763  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
17764#define EXPECT_STRCASEEQ(expected, actual) \
17765  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
17766#define EXPECT_STRCASENE(s1, s2)\
17767  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
17768
17769#define ASSERT_STREQ(expected, actual) \
17770  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
17771#define ASSERT_STRNE(s1, s2) \
17772  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
17773#define ASSERT_STRCASEEQ(expected, actual) \
17774  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
17775#define ASSERT_STRCASENE(s1, s2)\
17776  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
17777
17778// Macros for comparing floating-point numbers.
17779//
17780//    * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
17781//         Tests that two float values are almost equal.
17782//    * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
17783//         Tests that two double values are almost equal.
17784//    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
17785//         Tests that v1 and v2 are within the given distance to each other.
17786//
17787// Google Test uses ULP-based comparison to automatically pick a default
17788// error bound that is appropriate for the operands.  See the
17789// FloatingPoint template class in gtest-internal.h if you are
17790// interested in the implementation details.
17791
17792#define EXPECT_FLOAT_EQ(expected, actual)\
17793  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
17794                      expected, actual)
17795
17796#define EXPECT_DOUBLE_EQ(expected, actual)\
17797  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
17798                      expected, actual)
17799
17800#define ASSERT_FLOAT_EQ(expected, actual)\
17801  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
17802                      expected, actual)
17803
17804#define ASSERT_DOUBLE_EQ(expected, actual)\
17805  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
17806                      expected, actual)
17807
17808#define EXPECT_NEAR(val1, val2, abs_error)\
17809  EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
17810                      val1, val2, abs_error)
17811
17812#define ASSERT_NEAR(val1, val2, abs_error)\
17813  ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
17814                      val1, val2, abs_error)
17815
17816// These predicate format functions work on floating-point values, and
17817// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
17818//
17819//   EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
17820
17821// Asserts that val1 is less than, or almost equal to, val2.  Fails
17822// otherwise.  In particular, it fails if either val1 or val2 is NaN.
17823GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
17824                                   float val1, float val2);
17825GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
17826                                    double val1, double val2);
17827
17828
17829#if GTEST_OS_WINDOWS
17830
17831// Macros that test for HRESULT failure and success, these are only useful
17832// on Windows, and rely on Windows SDK macros and APIs to compile.
17833//
17834//    * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
17835//
17836// When expr unexpectedly fails or succeeds, Google Test prints the
17837// expected result and the actual result with both a human-readable
17838// string representation of the error, if available, as well as the
17839// hex result code.
17840#define EXPECT_HRESULT_SUCCEEDED(expr) \
17841    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
17842
17843#define ASSERT_HRESULT_SUCCEEDED(expr) \
17844    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
17845
17846#define EXPECT_HRESULT_FAILED(expr) \
17847    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
17848
17849#define ASSERT_HRESULT_FAILED(expr) \
17850    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
17851
17852#endif  // GTEST_OS_WINDOWS
17853
17854// Macros that execute statement and check that it doesn't generate new fatal
17855// failures in the current thread.
17856//
17857//   * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
17858//
17859// Examples:
17860//
17861//   EXPECT_NO_FATAL_FAILURE(Process());
17862//   ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
17863//
17864#define ASSERT_NO_FATAL_FAILURE(statement) \
17865    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
17866#define EXPECT_NO_FATAL_FAILURE(statement) \
17867    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
17868
17869// Causes a trace (including the source file path, the current line
17870// number, and the given message) to be included in every test failure
17871// message generated by code in the current scope.  The effect is
17872// undone when the control leaves the current scope.
17873//
17874// The message argument can be anything streamable to std::ostream.
17875//
17876// In the implementation, we include the current line number as part
17877// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
17878// to appear in the same block - as long as they are on different
17879// lines.
17880#define SCOPED_TRACE(message) \
17881  ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
17882    __FILE__, __LINE__, ::testing::Message() << (message))
17883
17884namespace internal {
17885
17886// This template is declared, but intentionally undefined.
17887template <typename T1, typename T2>
17888struct StaticAssertTypeEqHelper;
17889
17890template <typename T>
17891struct StaticAssertTypeEqHelper<T, T> {};
17892
17893}  // namespace internal
17894
17895// Compile-time assertion for type equality.
17896// StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
17897// the same type.  The value it returns is not interesting.
17898//
17899// Instead of making StaticAssertTypeEq a class template, we make it a
17900// function template that invokes a helper class template.  This
17901// prevents a user from misusing StaticAssertTypeEq<T1, T2> by
17902// defining objects of that type.
17903//
17904// CAVEAT:
17905//
17906// When used inside a method of a class template,
17907// StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
17908// instantiated.  For example, given:
17909//
17910//   template <typename T> class Foo {
17911//    public:
17912//     void Bar() { testing::StaticAssertTypeEq<int, T>(); }
17913//   };
17914//
17915// the code:
17916//
17917//   void Test1() { Foo<bool> foo; }
17918//
17919// will NOT generate a compiler error, as Foo<bool>::Bar() is never
17920// actually instantiated.  Instead, you need:
17921//
17922//   void Test2() { Foo<bool> foo; foo.Bar(); }
17923//
17924// to cause a compiler error.
17925template <typename T1, typename T2>
17926bool StaticAssertTypeEq() {
17927  internal::StaticAssertTypeEqHelper<T1, T2>();
17928  return true;
17929}
17930
17931// Defines a test.
17932//
17933// The first parameter is the name of the test case, and the second
17934// parameter is the name of the test within the test case.
17935//
17936// The convention is to end the test case name with "Test".  For
17937// example, a test case for the Foo class can be named FooTest.
17938//
17939// The user should put his test code between braces after using this
17940// macro.  Example:
17941//
17942//   TEST(FooTest, InitializesCorrectly) {
17943//     Foo foo;
17944//     EXPECT_TRUE(foo.StatusIsOK());
17945//   }
17946
17947// Note that we call GetTestTypeId() instead of GetTypeId<
17948// ::testing::Test>() here to get the type ID of testing::Test.  This
17949// is to work around a suspected linker bug when using Google Test as
17950// a framework on Mac OS X.  The bug causes GetTypeId<
17951// ::testing::Test>() to return different values depending on whether
17952// the call is from the Google Test framework itself or from user test
17953// code.  GetTestTypeId() is guaranteed to always return the same
17954// value, as it always calls GetTypeId<>() from the Google Test
17955// framework.
17956#define GTEST_TEST(test_case_name, test_name)\
17957  GTEST_TEST_(test_case_name, test_name, \
17958              ::testing::Test, ::testing::internal::GetTestTypeId())
17959
17960// Define this macro to 1 to omit the definition of TEST(), which
17961// is a generic name and clashes with some other libraries.
17962#if !GTEST_DONT_DEFINE_TEST
17963#define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
17964#endif
17965
17966// Defines a test that uses a test fixture.
17967//
17968// The first parameter is the name of the test fixture class, which
17969// also doubles as the test case name.  The second parameter is the
17970// name of the test within the test case.
17971//
17972// A test fixture class must be declared earlier.  The user should put
17973// his test code between braces after using this macro.  Example:
17974//
17975//   class FooTest : public testing::Test {
17976//    protected:
17977//     virtual void SetUp() { b_.AddElement(3); }
17978//
17979//     Foo a_;
17980//     Foo b_;
17981//   };
17982//
17983//   TEST_F(FooTest, InitializesCorrectly) {
17984//     EXPECT_TRUE(a_.StatusIsOK());
17985//   }
17986//
17987//   TEST_F(FooTest, ReturnsElementCountCorrectly) {
17988//     EXPECT_EQ(0, a_.size());
17989//     EXPECT_EQ(1, b_.size());
17990//   }
17991
17992#define TEST_F(test_fixture, test_name)\
17993  GTEST_TEST_(test_fixture, test_name, test_fixture, \
17994              ::testing::internal::GetTypeId<test_fixture>())
17995
17996// Use this macro in main() to run all tests.  It returns 0 if all
17997// tests are successful, or 1 otherwise.
17998//
17999// RUN_ALL_TESTS() should be invoked after the command line has been
18000// parsed by InitGoogleTest().
18001
18002#define RUN_ALL_TESTS()\
18003  (::testing::UnitTest::GetInstance()->Run())
18004
18005}  // namespace testing
18006
18007#endif  // GTEST_INCLUDE_GTEST_GTEST_H_
18008