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 <ostream>
56#include <vector>
57
58// Copyright 2005, Google Inc.
59// All rights reserved.
60//
61// Redistribution and use in source and binary forms, with or without
62// modification, are permitted provided that the following conditions are
63// met:
64//
65//     * Redistributions of source code must retain the above copyright
66// notice, this list of conditions and the following disclaimer.
67//     * Redistributions in binary form must reproduce the above
68// copyright notice, this list of conditions and the following disclaimer
69// in the documentation and/or other materials provided with the
70// distribution.
71//     * Neither the name of Google Inc. nor the names of its
72// contributors may be used to endorse or promote products derived from
73// this software without specific prior written permission.
74//
75// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
76// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
77// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
78// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
79// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
80// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
81// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
82// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
83// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
84// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
85// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
86//
87// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
88//
89// The Google C++ Testing Framework (Google Test)
90//
91// This header file declares functions and macros used internally by
92// Google Test.  They are subject to change without notice.
93
94#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
95#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
96
97// Copyright 2005, Google Inc.
98// All rights reserved.
99//
100// Redistribution and use in source and binary forms, with or without
101// modification, are permitted provided that the following conditions are
102// met:
103//
104//     * Redistributions of source code must retain the above copyright
105// notice, this list of conditions and the following disclaimer.
106//     * Redistributions in binary form must reproduce the above
107// copyright notice, this list of conditions and the following disclaimer
108// in the documentation and/or other materials provided with the
109// distribution.
110//     * Neither the name of Google Inc. nor the names of its
111// contributors may be used to endorse or promote products derived from
112// this software without specific prior written permission.
113//
114// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
115// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
116// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
117// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
118// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
119// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
120// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
121// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
122// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
123// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
124// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
125//
126// Authors: wan@google.com (Zhanyong Wan)
127//
128// Low-level types and utilities for porting Google Test to various
129// platforms.  They are subject to change without notice.  DO NOT USE
130// THEM IN USER CODE.
131//
132// This file is fundamental to Google Test.  All other Google Test source
133// files are expected to #include this.  Therefore, it cannot #include
134// any other Google Test header.
135
136#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
137#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
138
139// The user can define the following macros in the build script to
140// control Google Test's behavior.  If the user doesn't define a macro
141// in this list, Google Test will define it.
142//
143//   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)
144//                              is/isn't available.
145//   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions
146//                              are enabled.
147//   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string
148//                              is/isn't available (some systems define
149//                              ::string, which is different to std::string).
150//   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
151//                              is/isn't available (some systems define
152//                              ::wstring, which is different to std::wstring).
153//   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular
154//                              expressions are/aren't available.
155//   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>
156//                              is/isn't available.
157//   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't
158//                              enabled.
159//   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that
160//                              std::wstring does/doesn't work (Google Test can
161//                              be used where std::wstring is unavailable).
162//   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple
163//                              is/isn't available.
164//   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the
165//                              compiler supports Microsoft's "Structured
166//                              Exception Handling".
167//   GTEST_HAS_STREAM_REDIRECTION
168//                            - Define it to 1/0 to indicate whether the
169//                              platform supports I/O stream redirection using
170//                              dup() and dup2().
171//   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google
172//                              Test's own tr1 tuple implementation should be
173//                              used.  Unused when the user sets
174//                              GTEST_HAS_TR1_TUPLE to 0.
175//   GTEST_LANG_CXX11         - Define it to 1/0 to indicate that Google Test
176//                              is building in C++11/C++98 mode.
177//   GTEST_LINKED_AS_SHARED_LIBRARY
178//                            - Define to 1 when compiling tests that use
179//                              Google Test as a shared library (known as
180//                              DLL on Windows).
181//   GTEST_CREATE_SHARED_LIBRARY
182//                            - Define to 1 when compiling Google Test itself
183//                              as a shared library.
184
185// This header defines the following utilities:
186//
187// Macros indicating the current platform (defined to 1 if compiled on
188// the given platform; otherwise undefined):
189//   GTEST_OS_AIX      - IBM AIX
190//   GTEST_OS_CYGWIN   - Cygwin
191//   GTEST_OS_HPUX     - HP-UX
192//   GTEST_OS_LINUX    - Linux
193//     GTEST_OS_LINUX_ANDROID - Google Android
194//   GTEST_OS_MAC      - Mac OS X
195//     GTEST_OS_IOS    - iOS
196//       GTEST_OS_IOS_SIMULATOR - iOS simulator
197//   GTEST_OS_NACL     - Google Native Client (NaCl)
198//   GTEST_OS_OPENBSD  - OpenBSD
199//   GTEST_OS_QNX      - QNX
200//   GTEST_OS_SOLARIS  - Sun Solaris
201//   GTEST_OS_SYMBIAN  - Symbian
202//   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)
203//     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
204//     GTEST_OS_WINDOWS_MINGW    - MinGW
205//     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile
206//   GTEST_OS_ZOS      - z/OS
207//
208// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
209// most stable support.  Since core members of the Google Test project
210// don't have access to other platforms, support for them may be less
211// stable.  If you notice any problems on your platform, please notify
212// googletestframework@googlegroups.com (patches for fixing them are
213// even more welcome!).
214//
215// Note that it is possible that none of the GTEST_OS_* macros are defined.
216//
217// Macros indicating available Google Test features (defined to 1 if
218// the corresponding feature is supported; otherwise undefined):
219//   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized
220//                            tests)
221//   GTEST_HAS_DEATH_TEST   - death tests
222//   GTEST_HAS_PARAM_TEST   - value-parameterized tests
223//   GTEST_HAS_TYPED_TEST   - typed tests
224//   GTEST_HAS_TYPED_TEST_P - type-parameterized tests
225//   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with
226//                            GTEST_HAS_POSIX_RE (see above) which users can
227//                            define themselves.
228//   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
229//                            the above two are mutually exclusive.
230//   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
231//
232// Macros for basic C++ coding:
233//   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
234//   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a
235//                              variable don't have to be used.
236//   GTEST_DISALLOW_ASSIGN_   - disables operator=.
237//   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
238//   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.
239//
240// Synchronization:
241//   Mutex, MutexLock, ThreadLocal, GetThreadCount()
242//                  - synchronization primitives.
243//   GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
244//                         synchronization primitives have real implementations
245//                         and Google Test is thread-safe; or 0 otherwise.
246//
247// Template meta programming:
248//   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.
249//   IteratorTraits - partial implementation of std::iterator_traits, which
250//                    is not available in libCstd when compiled with Sun C++.
251//
252// Smart pointers:
253//   scoped_ptr     - as in TR2.
254//
255// Regular expressions:
256//   RE             - a simple regular expression class using the POSIX
257//                    Extended Regular Expression syntax on UNIX-like
258//                    platforms, or a reduced regular exception syntax on
259//                    other platforms, including Windows.
260//
261// Logging:
262//   GTEST_LOG_()   - logs messages at the specified severity level.
263//   LogToStderr()  - directs all log messages to stderr.
264//   FlushInfoLog() - flushes informational log messages.
265//
266// Stdout and stderr capturing:
267//   CaptureStdout()     - starts capturing stdout.
268//   GetCapturedStdout() - stops capturing stdout and returns the captured
269//                         string.
270//   CaptureStderr()     - starts capturing stderr.
271//   GetCapturedStderr() - stops capturing stderr and returns the captured
272//                         string.
273//
274// Integer types:
275//   TypeWithSize   - maps an integer to a int type.
276//   Int32, UInt32, Int64, UInt64, TimeInMillis
277//                  - integers of known sizes.
278//   BiggestInt     - the biggest signed integer type.
279//
280// Command-line utilities:
281//   GTEST_FLAG()       - references a flag.
282//   GTEST_DECLARE_*()  - declares a flag.
283//   GTEST_DEFINE_*()   - defines a flag.
284//   GetInjectableArgvs() - returns the command line as a vector of strings.
285//
286// Environment variable utilities:
287//   GetEnv()             - gets the value of an environment variable.
288//   BoolFromGTestEnv()   - parses a bool environment variable.
289//   Int32FromGTestEnv()  - parses an Int32 environment variable.
290//   StringFromGTestEnv() - parses a string environment variable.
291
292#include <ctype.h>   // for isspace, etc
293#include <stddef.h>  // for ptrdiff_t
294#include <stdlib.h>
295#include <stdio.h>
296#include <string.h>
297#ifndef _WIN32_WCE
298# include <sys/types.h>
299# include <sys/stat.h>
300#endif  // !_WIN32_WCE
301
302#if defined __APPLE__
303# include <AvailabilityMacros.h>
304# include <TargetConditionals.h>
305#endif
306
307#include <iostream>  // NOLINT
308#include <sstream>  // NOLINT
309#include <string>  // NOLINT
310
311#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
312#define GTEST_FLAG_PREFIX_ "gtest_"
313#define GTEST_FLAG_PREFIX_DASH_ "gtest-"
314#define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
315#define GTEST_NAME_ "Google Test"
316#define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
317
318// Determines the version of gcc that is used to compile this.
319#ifdef __GNUC__
320// 40302 means version 4.3.2.
321# define GTEST_GCC_VER_ \
322    (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
323#endif  // __GNUC__
324
325// Determines the platform on which Google Test is compiled.
326#ifdef __CYGWIN__
327# define GTEST_OS_CYGWIN 1
328#elif defined __SYMBIAN32__
329# define GTEST_OS_SYMBIAN 1
330#elif defined _WIN32
331# define GTEST_OS_WINDOWS 1
332# ifdef _WIN32_WCE
333#  define GTEST_OS_WINDOWS_MOBILE 1
334# elif defined(__MINGW__) || defined(__MINGW32__)
335#  define GTEST_OS_WINDOWS_MINGW 1
336# else
337#  define GTEST_OS_WINDOWS_DESKTOP 1
338# endif  // _WIN32_WCE
339#elif defined __APPLE__
340# define GTEST_OS_MAC 1
341# if TARGET_OS_IPHONE
342#  define GTEST_OS_IOS 1
343#  if TARGET_IPHONE_SIMULATOR
344#   define GTEST_OS_IOS_SIMULATOR 1
345#  endif
346# endif
347#elif defined __linux__
348# define GTEST_OS_LINUX 1
349# if defined __ANDROID__
350#  define GTEST_OS_LINUX_ANDROID 1
351# endif
352#elif defined __MVS__
353# define GTEST_OS_ZOS 1
354#elif defined(__sun) && defined(__SVR4)
355# define GTEST_OS_SOLARIS 1
356#elif defined(_AIX)
357# define GTEST_OS_AIX 1
358#elif defined(__hpux)
359# define GTEST_OS_HPUX 1
360#elif defined __native_client__
361# define GTEST_OS_NACL 1
362#elif defined __OpenBSD__
363# define GTEST_OS_OPENBSD 1
364#elif defined __QNX__
365# define GTEST_OS_QNX 1
366#endif  // __CYGWIN__
367
368#ifndef GTEST_LANG_CXX11
369// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
370// -std={c,gnu}++{0x,11} is passed.  The C++11 standard specifies a
371// value for __cplusplus, and recent versions of clang, gcc, and
372// probably other compilers set that too in C++11 mode.
373# if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
374// Compiling in at least C++11 mode.
375#  define GTEST_LANG_CXX11 1
376# else
377#  define GTEST_LANG_CXX11 0
378# endif
379#endif
380
381// Brings in definitions for functions used in the testing::internal::posix
382// namespace (read, write, close, chdir, isatty, stat). We do not currently
383// use them on Windows Mobile.
384#if !GTEST_OS_WINDOWS
385// This assumes that non-Windows OSes provide unistd.h. For OSes where this
386// is not the case, we need to include headers that provide the functions
387// mentioned above.
388# include <unistd.h>
389# include <strings.h>
390#elif !GTEST_OS_WINDOWS_MOBILE
391# include <direct.h>
392# include <io.h>
393#endif
394
395#if GTEST_OS_LINUX_ANDROID
396// Used to define __ANDROID_API__ matching the target NDK API level.
397#  include <android/api-level.h>  // NOLINT
398#endif
399
400// Defines this to true iff Google Test can use POSIX regular expressions.
401#ifndef GTEST_HAS_POSIX_RE
402# if GTEST_OS_LINUX_ANDROID
403// On Android, <regex.h> is only available starting with Gingerbread.
404#  define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
405# else
406#  define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
407# endif
408#endif
409
410#if GTEST_HAS_POSIX_RE
411
412// On some platforms, <regex.h> needs someone to define size_t, and
413// won't compile otherwise.  We can #include it here as we already
414// included <stdlib.h>, which is guaranteed to define size_t through
415// <stddef.h>.
416# include <regex.h>  // NOLINT
417
418# define GTEST_USES_POSIX_RE 1
419
420#elif GTEST_OS_WINDOWS
421
422// <regex.h> is not available on Windows.  Use our own simple regex
423// implementation instead.
424# define GTEST_USES_SIMPLE_RE 1
425
426#else
427
428// <regex.h> may not be available on this platform.  Use our own
429// simple regex implementation instead.
430# define GTEST_USES_SIMPLE_RE 1
431
432#endif  // GTEST_HAS_POSIX_RE
433
434#ifndef GTEST_HAS_EXCEPTIONS
435// The user didn't tell us whether exceptions are enabled, so we need
436// to figure it out.
437# if defined(_MSC_VER) || defined(__BORLANDC__)
438// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
439// macro to enable exceptions, so we'll do the same.
440// Assumes that exceptions are enabled by default.
441#  ifndef _HAS_EXCEPTIONS
442#   define _HAS_EXCEPTIONS 1
443#  endif  // _HAS_EXCEPTIONS
444#  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
445# elif defined(__GNUC__) && __EXCEPTIONS
446// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
447#  define GTEST_HAS_EXCEPTIONS 1
448# elif defined(__SUNPRO_CC)
449// Sun Pro CC supports exceptions.  However, there is no compile-time way of
450// detecting whether they are enabled or not.  Therefore, we assume that
451// they are enabled unless the user tells us otherwise.
452#  define GTEST_HAS_EXCEPTIONS 1
453# elif defined(__IBMCPP__) && __EXCEPTIONS
454// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
455#  define GTEST_HAS_EXCEPTIONS 1
456# elif defined(__HP_aCC)
457// Exception handling is in effect by default in HP aCC compiler. It has to
458// be turned of by +noeh compiler option if desired.
459#  define GTEST_HAS_EXCEPTIONS 1
460# else
461// For other compilers, we assume exceptions are disabled to be
462// conservative.
463#  define GTEST_HAS_EXCEPTIONS 0
464# endif  // defined(_MSC_VER) || defined(__BORLANDC__)
465#endif  // GTEST_HAS_EXCEPTIONS
466
467#if !defined(GTEST_HAS_STD_STRING)
468// Even though we don't use this macro any longer, we keep it in case
469// some clients still depend on it.
470# define GTEST_HAS_STD_STRING 1
471#elif !GTEST_HAS_STD_STRING
472// The user told us that ::std::string isn't available.
473# error "Google Test cannot be used where ::std::string isn't available."
474#endif  // !defined(GTEST_HAS_STD_STRING)
475
476#ifndef GTEST_HAS_GLOBAL_STRING
477// The user didn't tell us whether ::string is available, so we need
478// to figure it out.
479
480# define GTEST_HAS_GLOBAL_STRING 0
481
482#endif  // GTEST_HAS_GLOBAL_STRING
483
484#ifndef GTEST_HAS_STD_WSTRING
485// The user didn't tell us whether ::std::wstring is available, so we need
486// to figure it out.
487// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
488//   is available.
489
490// Cygwin 1.7 and below doesn't support ::std::wstring.
491// Solaris' libc++ doesn't support it either.  Android has
492// no support for it at least as recent as Froyo (2.2).
493# define GTEST_HAS_STD_WSTRING \
494    (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
495
496#endif  // GTEST_HAS_STD_WSTRING
497
498#ifndef GTEST_HAS_GLOBAL_WSTRING
499// The user didn't tell us whether ::wstring is available, so we need
500// to figure it out.
501# define GTEST_HAS_GLOBAL_WSTRING \
502    (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
503#endif  // GTEST_HAS_GLOBAL_WSTRING
504
505// Determines whether RTTI is available.
506#ifndef GTEST_HAS_RTTI
507// The user didn't tell us whether RTTI is enabled, so we need to
508// figure it out.
509
510# ifdef _MSC_VER
511
512#  ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.
513#   define GTEST_HAS_RTTI 1
514#  else
515#   define GTEST_HAS_RTTI 0
516#  endif
517
518// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
519# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
520
521#  ifdef __GXX_RTTI
522// When building against STLport with the Android NDK and with
523// -frtti -fno-exceptions, the build fails at link time with undefined
524// references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
525// so disable RTTI when detected.
526#   if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
527       !defined(__EXCEPTIONS)
528#    define GTEST_HAS_RTTI 0
529#   else
530#    define GTEST_HAS_RTTI 1
531#   endif  // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
532#  else
533#   define GTEST_HAS_RTTI 0
534#  endif  // __GXX_RTTI
535
536// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
537// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
538// first version with C++ support.
539# elif defined(__clang__)
540
541#  define GTEST_HAS_RTTI __has_feature(cxx_rtti)
542
543// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
544// both the typeid and dynamic_cast features are present.
545# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
546
547#  ifdef __RTTI_ALL__
548#   define GTEST_HAS_RTTI 1
549#  else
550#   define GTEST_HAS_RTTI 0
551#  endif
552
553# else
554
555// For all other compilers, we assume RTTI is enabled.
556#  define GTEST_HAS_RTTI 1
557
558# endif  // _MSC_VER
559
560#endif  // GTEST_HAS_RTTI
561
562// It's this header's responsibility to #include <typeinfo> when RTTI
563// is enabled.
564#if GTEST_HAS_RTTI
565# include <typeinfo>
566#endif
567
568// Determines whether Google Test can use the pthreads library.
569#ifndef GTEST_HAS_PTHREAD
570// The user didn't tell us explicitly, so we assume pthreads support is
571// available on Linux and Mac.
572//
573// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
574// to your compiler flags.
575# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
576    || GTEST_OS_QNX)
577#endif  // GTEST_HAS_PTHREAD
578
579#if GTEST_HAS_PTHREAD
580// gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
581// true.
582# include <pthread.h>  // NOLINT
583
584// For timespec and nanosleep, used below.
585# include <time.h>  // NOLINT
586#endif
587
588// Determines whether Google Test can use tr1/tuple.  You can define
589// this macro to 0 to prevent Google Test from using tuple (any
590// feature depending on tuple with be disabled in this mode).
591#ifndef GTEST_HAS_TR1_TUPLE
592# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
593// STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
594#  define GTEST_HAS_TR1_TUPLE 0
595# else
596// The user didn't tell us not to do it, so we assume it's OK.
597#  define GTEST_HAS_TR1_TUPLE 1
598# endif
599#endif  // GTEST_HAS_TR1_TUPLE
600
601// Determines whether Google Test's own tr1 tuple implementation
602// should be used.
603#ifndef GTEST_USE_OWN_TR1_TUPLE
604// The user didn't tell us, so we need to figure it out.
605
606// We use our own TR1 tuple if we aren't sure the user has an
607// implementation of it already.  At this time, libstdc++ 4.0.0+ and
608// MSVC 2010 are the only mainstream standard libraries that come
609// with a TR1 tuple implementation.  NVIDIA's CUDA NVCC compiler
610// pretends to be GCC by defining __GNUC__ and friends, but cannot
611// compile GCC's tuple implementation.  MSVC 2008 (9.0) provides TR1
612// tuple in a 323 MB Feature Pack download, which we cannot assume the
613// user has.  QNX's QCC compiler is a modified GCC but it doesn't
614// support TR1 tuple.  libc++ only provides std::tuple, in C++11 mode,
615// and it can be used with some compilers that define __GNUC__.
616# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
617      && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600
618#  define GTEST_ENV_HAS_TR1_TUPLE_ 1
619# endif
620
621// C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
622// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
623// can build with clang but need to use gcc4.2's libstdc++).
624# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
625#  define GTEST_ENV_HAS_STD_TUPLE_ 1
626# endif
627
628# if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
629#  define GTEST_USE_OWN_TR1_TUPLE 0
630# else
631#  define GTEST_USE_OWN_TR1_TUPLE 1
632# endif
633
634#endif  // GTEST_USE_OWN_TR1_TUPLE
635
636// To avoid conditional compilation everywhere, we make it
637// gtest-port.h's responsibility to #include the header implementing
638// tr1/tuple.
639#if GTEST_HAS_TR1_TUPLE
640
641# if GTEST_USE_OWN_TR1_TUPLE
642// This file was GENERATED by command:
643//     pump.py gtest-tuple.h.pump
644// DO NOT EDIT BY HAND!!!
645
646// Copyright 2009 Google Inc.
647// All Rights Reserved.
648//
649// Redistribution and use in source and binary forms, with or without
650// modification, are permitted provided that the following conditions are
651// met:
652//
653//     * Redistributions of source code must retain the above copyright
654// notice, this list of conditions and the following disclaimer.
655//     * Redistributions in binary form must reproduce the above
656// copyright notice, this list of conditions and the following disclaimer
657// in the documentation and/or other materials provided with the
658// distribution.
659//     * Neither the name of Google Inc. nor the names of its
660// contributors may be used to endorse or promote products derived from
661// this software without specific prior written permission.
662//
663// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
664// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
665// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
666// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
667// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
668// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
669// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
670// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
671// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
672// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
673// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
674//
675// Author: wan@google.com (Zhanyong Wan)
676
677// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
678
679#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
680#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
681
682#include <utility>  // For ::std::pair.
683
684// The compiler used in Symbian has a bug that prevents us from declaring the
685// tuple template as a friend (it complains that tuple is redefined).  This
686// hack bypasses the bug by declaring the members that should otherwise be
687// private as public.
688// Sun Studio versions < 12 also have the above bug.
689#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
690# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
691#else
692# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
693    template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
694   private:
695#endif
696
697// GTEST_n_TUPLE_(T) is the type of an n-tuple.
698#define GTEST_0_TUPLE_(T) tuple<>
699#define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
700    void, void, void>
701#define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
702    void, void, void>
703#define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
704    void, void, void>
705#define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
706    void, void, void>
707#define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
708    void, void, void>
709#define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
710    void, void, void>
711#define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
712    void, void, void>
713#define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
714    T##7, void, void>
715#define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
716    T##7, T##8, void>
717#define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
718    T##7, T##8, T##9>
719
720// GTEST_n_TYPENAMES_(T) declares a list of n typenames.
721#define GTEST_0_TYPENAMES_(T)
722#define GTEST_1_TYPENAMES_(T) typename T##0
723#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
724#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
725#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
726    typename T##3
727#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
728    typename T##3, typename T##4
729#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
730    typename T##3, typename T##4, typename T##5
731#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
732    typename T##3, typename T##4, typename T##5, typename T##6
733#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
734    typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
735#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
736    typename T##3, typename T##4, typename T##5, typename T##6, \
737    typename T##7, typename T##8
738#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
739    typename T##3, typename T##4, typename T##5, typename T##6, \
740    typename T##7, typename T##8, typename T##9
741
742// In theory, defining stuff in the ::std namespace is undefined
743// behavior.  We can do this as we are playing the role of a standard
744// library vendor.
745namespace std {
746namespace tr1 {
747
748template <typename T0 = void, typename T1 = void, typename T2 = void,
749    typename T3 = void, typename T4 = void, typename T5 = void,
750    typename T6 = void, typename T7 = void, typename T8 = void,
751    typename T9 = void>
752class tuple;
753
754// Anything in namespace gtest_internal is Google Test's INTERNAL
755// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
756namespace gtest_internal {
757
758// ByRef<T>::type is T if T is a reference; otherwise it's const T&.
759template <typename T>
760struct ByRef { typedef const T& type; };  // NOLINT
761template <typename T>
762struct ByRef<T&> { typedef T& type; };  // NOLINT
763
764// A handy wrapper for ByRef.
765#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
766
767// AddRef<T>::type is T if T is a reference; otherwise it's T&.  This
768// is the same as tr1::add_reference<T>::type.
769template <typename T>
770struct AddRef { typedef T& type; };  // NOLINT
771template <typename T>
772struct AddRef<T&> { typedef T& type; };  // NOLINT
773
774// A handy wrapper for AddRef.
775#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
776
777// A helper for implementing get<k>().
778template <int k> class Get;
779
780// A helper for implementing tuple_element<k, T>.  kIndexValid is true
781// iff k < the number of fields in tuple type T.
782template <bool kIndexValid, int kIndex, class Tuple>
783struct TupleElement;
784
785template <GTEST_10_TYPENAMES_(T)>
786struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
787  typedef T0 type;
788};
789
790template <GTEST_10_TYPENAMES_(T)>
791struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
792  typedef T1 type;
793};
794
795template <GTEST_10_TYPENAMES_(T)>
796struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
797  typedef T2 type;
798};
799
800template <GTEST_10_TYPENAMES_(T)>
801struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
802  typedef T3 type;
803};
804
805template <GTEST_10_TYPENAMES_(T)>
806struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
807  typedef T4 type;
808};
809
810template <GTEST_10_TYPENAMES_(T)>
811struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
812  typedef T5 type;
813};
814
815template <GTEST_10_TYPENAMES_(T)>
816struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
817  typedef T6 type;
818};
819
820template <GTEST_10_TYPENAMES_(T)>
821struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
822  typedef T7 type;
823};
824
825template <GTEST_10_TYPENAMES_(T)>
826struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
827  typedef T8 type;
828};
829
830template <GTEST_10_TYPENAMES_(T)>
831struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
832  typedef T9 type;
833};
834
835}  // namespace gtest_internal
836
837template <>
838class tuple<> {
839 public:
840  tuple() {}
841  tuple(const tuple& /* t */)  {}
842  tuple& operator=(const tuple& /* t */) { return *this; }
843};
844
845template <GTEST_1_TYPENAMES_(T)>
846class GTEST_1_TUPLE_(T) {
847 public:
848  template <int k> friend class gtest_internal::Get;
849
850  tuple() : f0_() {}
851
852  explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
853
854  tuple(const tuple& t) : f0_(t.f0_) {}
855
856  template <GTEST_1_TYPENAMES_(U)>
857  tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
858
859  tuple& operator=(const tuple& t) { return CopyFrom(t); }
860
861  template <GTEST_1_TYPENAMES_(U)>
862  tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
863    return CopyFrom(t);
864  }
865
866  GTEST_DECLARE_TUPLE_AS_FRIEND_
867
868  template <GTEST_1_TYPENAMES_(U)>
869  tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
870    f0_ = t.f0_;
871    return *this;
872  }
873
874  T0 f0_;
875};
876
877template <GTEST_2_TYPENAMES_(T)>
878class GTEST_2_TUPLE_(T) {
879 public:
880  template <int k> friend class gtest_internal::Get;
881
882  tuple() : f0_(), f1_() {}
883
884  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
885      f1_(f1) {}
886
887  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
888
889  template <GTEST_2_TYPENAMES_(U)>
890  tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
891  template <typename U0, typename U1>
892  tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
893
894  tuple& operator=(const tuple& t) { return CopyFrom(t); }
895
896  template <GTEST_2_TYPENAMES_(U)>
897  tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
898    return CopyFrom(t);
899  }
900  template <typename U0, typename U1>
901  tuple& operator=(const ::std::pair<U0, U1>& p) {
902    f0_ = p.first;
903    f1_ = p.second;
904    return *this;
905  }
906
907  GTEST_DECLARE_TUPLE_AS_FRIEND_
908
909  template <GTEST_2_TYPENAMES_(U)>
910  tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
911    f0_ = t.f0_;
912    f1_ = t.f1_;
913    return *this;
914  }
915
916  T0 f0_;
917  T1 f1_;
918};
919
920template <GTEST_3_TYPENAMES_(T)>
921class GTEST_3_TUPLE_(T) {
922 public:
923  template <int k> friend class gtest_internal::Get;
924
925  tuple() : f0_(), f1_(), f2_() {}
926
927  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
928      GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
929
930  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
931
932  template <GTEST_3_TYPENAMES_(U)>
933  tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
934
935  tuple& operator=(const tuple& t) { return CopyFrom(t); }
936
937  template <GTEST_3_TYPENAMES_(U)>
938  tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
939    return CopyFrom(t);
940  }
941
942  GTEST_DECLARE_TUPLE_AS_FRIEND_
943
944  template <GTEST_3_TYPENAMES_(U)>
945  tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
946    f0_ = t.f0_;
947    f1_ = t.f1_;
948    f2_ = t.f2_;
949    return *this;
950  }
951
952  T0 f0_;
953  T1 f1_;
954  T2 f2_;
955};
956
957template <GTEST_4_TYPENAMES_(T)>
958class GTEST_4_TUPLE_(T) {
959 public:
960  template <int k> friend class gtest_internal::Get;
961
962  tuple() : f0_(), f1_(), f2_(), f3_() {}
963
964  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
965      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
966      f3_(f3) {}
967
968  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
969
970  template <GTEST_4_TYPENAMES_(U)>
971  tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
972      f3_(t.f3_) {}
973
974  tuple& operator=(const tuple& t) { return CopyFrom(t); }
975
976  template <GTEST_4_TYPENAMES_(U)>
977  tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
978    return CopyFrom(t);
979  }
980
981  GTEST_DECLARE_TUPLE_AS_FRIEND_
982
983  template <GTEST_4_TYPENAMES_(U)>
984  tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
985    f0_ = t.f0_;
986    f1_ = t.f1_;
987    f2_ = t.f2_;
988    f3_ = t.f3_;
989    return *this;
990  }
991
992  T0 f0_;
993  T1 f1_;
994  T2 f2_;
995  T3 f3_;
996};
997
998template <GTEST_5_TYPENAMES_(T)>
999class GTEST_5_TUPLE_(T) {
1000 public:
1001  template <int k> friend class gtest_internal::Get;
1002
1003  tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
1004
1005  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1006      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
1007      GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
1008
1009  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1010      f4_(t.f4_) {}
1011
1012  template <GTEST_5_TYPENAMES_(U)>
1013  tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1014      f3_(t.f3_), f4_(t.f4_) {}
1015
1016  tuple& operator=(const tuple& t) { return CopyFrom(t); }
1017
1018  template <GTEST_5_TYPENAMES_(U)>
1019  tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
1020    return CopyFrom(t);
1021  }
1022
1023  GTEST_DECLARE_TUPLE_AS_FRIEND_
1024
1025  template <GTEST_5_TYPENAMES_(U)>
1026  tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
1027    f0_ = t.f0_;
1028    f1_ = t.f1_;
1029    f2_ = t.f2_;
1030    f3_ = t.f3_;
1031    f4_ = t.f4_;
1032    return *this;
1033  }
1034
1035  T0 f0_;
1036  T1 f1_;
1037  T2 f2_;
1038  T3 f3_;
1039  T4 f4_;
1040};
1041
1042template <GTEST_6_TYPENAMES_(T)>
1043class GTEST_6_TUPLE_(T) {
1044 public:
1045  template <int k> friend class gtest_internal::Get;
1046
1047  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
1048
1049  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1050      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1051      GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1052      f5_(f5) {}
1053
1054  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1055      f4_(t.f4_), f5_(t.f5_) {}
1056
1057  template <GTEST_6_TYPENAMES_(U)>
1058  tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1059      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
1060
1061  tuple& operator=(const tuple& t) { return CopyFrom(t); }
1062
1063  template <GTEST_6_TYPENAMES_(U)>
1064  tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
1065    return CopyFrom(t);
1066  }
1067
1068  GTEST_DECLARE_TUPLE_AS_FRIEND_
1069
1070  template <GTEST_6_TYPENAMES_(U)>
1071  tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
1072    f0_ = t.f0_;
1073    f1_ = t.f1_;
1074    f2_ = t.f2_;
1075    f3_ = t.f3_;
1076    f4_ = t.f4_;
1077    f5_ = t.f5_;
1078    return *this;
1079  }
1080
1081  T0 f0_;
1082  T1 f1_;
1083  T2 f2_;
1084  T3 f3_;
1085  T4 f4_;
1086  T5 f5_;
1087};
1088
1089template <GTEST_7_TYPENAMES_(T)>
1090class GTEST_7_TUPLE_(T) {
1091 public:
1092  template <int k> friend class gtest_internal::Get;
1093
1094  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
1095
1096  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1097      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1098      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
1099      f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
1100
1101  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1102      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1103
1104  template <GTEST_7_TYPENAMES_(U)>
1105  tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1106      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1107
1108  tuple& operator=(const tuple& t) { return CopyFrom(t); }
1109
1110  template <GTEST_7_TYPENAMES_(U)>
1111  tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
1112    return CopyFrom(t);
1113  }
1114
1115  GTEST_DECLARE_TUPLE_AS_FRIEND_
1116
1117  template <GTEST_7_TYPENAMES_(U)>
1118  tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
1119    f0_ = t.f0_;
1120    f1_ = t.f1_;
1121    f2_ = t.f2_;
1122    f3_ = t.f3_;
1123    f4_ = t.f4_;
1124    f5_ = t.f5_;
1125    f6_ = t.f6_;
1126    return *this;
1127  }
1128
1129  T0 f0_;
1130  T1 f1_;
1131  T2 f2_;
1132  T3 f3_;
1133  T4 f4_;
1134  T5 f5_;
1135  T6 f6_;
1136};
1137
1138template <GTEST_8_TYPENAMES_(T)>
1139class GTEST_8_TUPLE_(T) {
1140 public:
1141  template <int k> friend class gtest_internal::Get;
1142
1143  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
1144
1145  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1146      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1147      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
1148      GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1149      f5_(f5), f6_(f6), f7_(f7) {}
1150
1151  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1152      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1153
1154  template <GTEST_8_TYPENAMES_(U)>
1155  tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1156      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1157
1158  tuple& operator=(const tuple& t) { return CopyFrom(t); }
1159
1160  template <GTEST_8_TYPENAMES_(U)>
1161  tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
1162    return CopyFrom(t);
1163  }
1164
1165  GTEST_DECLARE_TUPLE_AS_FRIEND_
1166
1167  template <GTEST_8_TYPENAMES_(U)>
1168  tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
1169    f0_ = t.f0_;
1170    f1_ = t.f1_;
1171    f2_ = t.f2_;
1172    f3_ = t.f3_;
1173    f4_ = t.f4_;
1174    f5_ = t.f5_;
1175    f6_ = t.f6_;
1176    f7_ = t.f7_;
1177    return *this;
1178  }
1179
1180  T0 f0_;
1181  T1 f1_;
1182  T2 f2_;
1183  T3 f3_;
1184  T4 f4_;
1185  T5 f5_;
1186  T6 f6_;
1187  T7 f7_;
1188};
1189
1190template <GTEST_9_TYPENAMES_(T)>
1191class GTEST_9_TUPLE_(T) {
1192 public:
1193  template <int k> friend class gtest_internal::Get;
1194
1195  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
1196
1197  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1198      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1199      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1200      GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1201      f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
1202
1203  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1204      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1205
1206  template <GTEST_9_TYPENAMES_(U)>
1207  tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1208      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1209
1210  tuple& operator=(const tuple& t) { return CopyFrom(t); }
1211
1212  template <GTEST_9_TYPENAMES_(U)>
1213  tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
1214    return CopyFrom(t);
1215  }
1216
1217  GTEST_DECLARE_TUPLE_AS_FRIEND_
1218
1219  template <GTEST_9_TYPENAMES_(U)>
1220  tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
1221    f0_ = t.f0_;
1222    f1_ = t.f1_;
1223    f2_ = t.f2_;
1224    f3_ = t.f3_;
1225    f4_ = t.f4_;
1226    f5_ = t.f5_;
1227    f6_ = t.f6_;
1228    f7_ = t.f7_;
1229    f8_ = t.f8_;
1230    return *this;
1231  }
1232
1233  T0 f0_;
1234  T1 f1_;
1235  T2 f2_;
1236  T3 f3_;
1237  T4 f4_;
1238  T5 f5_;
1239  T6 f6_;
1240  T7 f7_;
1241  T8 f8_;
1242};
1243
1244template <GTEST_10_TYPENAMES_(T)>
1245class tuple {
1246 public:
1247  template <int k> friend class gtest_internal::Get;
1248
1249  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
1250      f9_() {}
1251
1252  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1253      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1254      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1255      GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
1256      f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
1257
1258  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1259      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
1260
1261  template <GTEST_10_TYPENAMES_(U)>
1262  tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1263      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
1264      f9_(t.f9_) {}
1265
1266  tuple& operator=(const tuple& t) { return CopyFrom(t); }
1267
1268  template <GTEST_10_TYPENAMES_(U)>
1269  tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
1270    return CopyFrom(t);
1271  }
1272
1273  GTEST_DECLARE_TUPLE_AS_FRIEND_
1274
1275  template <GTEST_10_TYPENAMES_(U)>
1276  tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
1277    f0_ = t.f0_;
1278    f1_ = t.f1_;
1279    f2_ = t.f2_;
1280    f3_ = t.f3_;
1281    f4_ = t.f4_;
1282    f5_ = t.f5_;
1283    f6_ = t.f6_;
1284    f7_ = t.f7_;
1285    f8_ = t.f8_;
1286    f9_ = t.f9_;
1287    return *this;
1288  }
1289
1290  T0 f0_;
1291  T1 f1_;
1292  T2 f2_;
1293  T3 f3_;
1294  T4 f4_;
1295  T5 f5_;
1296  T6 f6_;
1297  T7 f7_;
1298  T8 f8_;
1299  T9 f9_;
1300};
1301
1302// 6.1.3.2 Tuple creation functions.
1303
1304// Known limitations: we don't support passing an
1305// std::tr1::reference_wrapper<T> to make_tuple().  And we don't
1306// implement tie().
1307
1308inline tuple<> make_tuple() { return tuple<>(); }
1309
1310template <GTEST_1_TYPENAMES_(T)>
1311inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
1312  return GTEST_1_TUPLE_(T)(f0);
1313}
1314
1315template <GTEST_2_TYPENAMES_(T)>
1316inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
1317  return GTEST_2_TUPLE_(T)(f0, f1);
1318}
1319
1320template <GTEST_3_TYPENAMES_(T)>
1321inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
1322  return GTEST_3_TUPLE_(T)(f0, f1, f2);
1323}
1324
1325template <GTEST_4_TYPENAMES_(T)>
1326inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1327    const T3& f3) {
1328  return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
1329}
1330
1331template <GTEST_5_TYPENAMES_(T)>
1332inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1333    const T3& f3, const T4& f4) {
1334  return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
1335}
1336
1337template <GTEST_6_TYPENAMES_(T)>
1338inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1339    const T3& f3, const T4& f4, const T5& f5) {
1340  return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
1341}
1342
1343template <GTEST_7_TYPENAMES_(T)>
1344inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1345    const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
1346  return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
1347}
1348
1349template <GTEST_8_TYPENAMES_(T)>
1350inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1351    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
1352  return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
1353}
1354
1355template <GTEST_9_TYPENAMES_(T)>
1356inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1357    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1358    const T8& f8) {
1359  return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
1360}
1361
1362template <GTEST_10_TYPENAMES_(T)>
1363inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1364    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1365    const T8& f8, const T9& f9) {
1366  return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
1367}
1368
1369// 6.1.3.3 Tuple helper classes.
1370
1371template <typename Tuple> struct tuple_size;
1372
1373template <GTEST_0_TYPENAMES_(T)>
1374struct tuple_size<GTEST_0_TUPLE_(T) > {
1375  static const int value = 0;
1376};
1377
1378template <GTEST_1_TYPENAMES_(T)>
1379struct tuple_size<GTEST_1_TUPLE_(T) > {
1380  static const int value = 1;
1381};
1382
1383template <GTEST_2_TYPENAMES_(T)>
1384struct tuple_size<GTEST_2_TUPLE_(T) > {
1385  static const int value = 2;
1386};
1387
1388template <GTEST_3_TYPENAMES_(T)>
1389struct tuple_size<GTEST_3_TUPLE_(T) > {
1390  static const int value = 3;
1391};
1392
1393template <GTEST_4_TYPENAMES_(T)>
1394struct tuple_size<GTEST_4_TUPLE_(T) > {
1395  static const int value = 4;
1396};
1397
1398template <GTEST_5_TYPENAMES_(T)>
1399struct tuple_size<GTEST_5_TUPLE_(T) > {
1400  static const int value = 5;
1401};
1402
1403template <GTEST_6_TYPENAMES_(T)>
1404struct tuple_size<GTEST_6_TUPLE_(T) > {
1405  static const int value = 6;
1406};
1407
1408template <GTEST_7_TYPENAMES_(T)>
1409struct tuple_size<GTEST_7_TUPLE_(T) > {
1410  static const int value = 7;
1411};
1412
1413template <GTEST_8_TYPENAMES_(T)>
1414struct tuple_size<GTEST_8_TUPLE_(T) > {
1415  static const int value = 8;
1416};
1417
1418template <GTEST_9_TYPENAMES_(T)>
1419struct tuple_size<GTEST_9_TUPLE_(T) > {
1420  static const int value = 9;
1421};
1422
1423template <GTEST_10_TYPENAMES_(T)>
1424struct tuple_size<GTEST_10_TUPLE_(T) > {
1425  static const int value = 10;
1426};
1427
1428template <int k, class Tuple>
1429struct tuple_element {
1430  typedef typename gtest_internal::TupleElement<
1431      k < (tuple_size<Tuple>::value), k, Tuple>::type type;
1432};
1433
1434#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
1435
1436// 6.1.3.4 Element access.
1437
1438namespace gtest_internal {
1439
1440template <>
1441class Get<0> {
1442 public:
1443  template <class Tuple>
1444  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1445  Field(Tuple& t) { return t.f0_; }  // NOLINT
1446
1447  template <class Tuple>
1448  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1449  ConstField(const Tuple& t) { return t.f0_; }
1450};
1451
1452template <>
1453class Get<1> {
1454 public:
1455  template <class Tuple>
1456  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1457  Field(Tuple& t) { return t.f1_; }  // NOLINT
1458
1459  template <class Tuple>
1460  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1461  ConstField(const Tuple& t) { return t.f1_; }
1462};
1463
1464template <>
1465class Get<2> {
1466 public:
1467  template <class Tuple>
1468  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1469  Field(Tuple& t) { return t.f2_; }  // NOLINT
1470
1471  template <class Tuple>
1472  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1473  ConstField(const Tuple& t) { return t.f2_; }
1474};
1475
1476template <>
1477class Get<3> {
1478 public:
1479  template <class Tuple>
1480  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1481  Field(Tuple& t) { return t.f3_; }  // NOLINT
1482
1483  template <class Tuple>
1484  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1485  ConstField(const Tuple& t) { return t.f3_; }
1486};
1487
1488template <>
1489class Get<4> {
1490 public:
1491  template <class Tuple>
1492  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1493  Field(Tuple& t) { return t.f4_; }  // NOLINT
1494
1495  template <class Tuple>
1496  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1497  ConstField(const Tuple& t) { return t.f4_; }
1498};
1499
1500template <>
1501class Get<5> {
1502 public:
1503  template <class Tuple>
1504  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1505  Field(Tuple& t) { return t.f5_; }  // NOLINT
1506
1507  template <class Tuple>
1508  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1509  ConstField(const Tuple& t) { return t.f5_; }
1510};
1511
1512template <>
1513class Get<6> {
1514 public:
1515  template <class Tuple>
1516  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1517  Field(Tuple& t) { return t.f6_; }  // NOLINT
1518
1519  template <class Tuple>
1520  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1521  ConstField(const Tuple& t) { return t.f6_; }
1522};
1523
1524template <>
1525class Get<7> {
1526 public:
1527  template <class Tuple>
1528  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1529  Field(Tuple& t) { return t.f7_; }  // NOLINT
1530
1531  template <class Tuple>
1532  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1533  ConstField(const Tuple& t) { return t.f7_; }
1534};
1535
1536template <>
1537class Get<8> {
1538 public:
1539  template <class Tuple>
1540  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1541  Field(Tuple& t) { return t.f8_; }  // NOLINT
1542
1543  template <class Tuple>
1544  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1545  ConstField(const Tuple& t) { return t.f8_; }
1546};
1547
1548template <>
1549class Get<9> {
1550 public:
1551  template <class Tuple>
1552  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1553  Field(Tuple& t) { return t.f9_; }  // NOLINT
1554
1555  template <class Tuple>
1556  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1557  ConstField(const Tuple& t) { return t.f9_; }
1558};
1559
1560}  // namespace gtest_internal
1561
1562template <int k, GTEST_10_TYPENAMES_(T)>
1563GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1564get(GTEST_10_TUPLE_(T)& t) {
1565  return gtest_internal::Get<k>::Field(t);
1566}
1567
1568template <int k, GTEST_10_TYPENAMES_(T)>
1569GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))
1570get(const GTEST_10_TUPLE_(T)& t) {
1571  return gtest_internal::Get<k>::ConstField(t);
1572}
1573
1574// 6.1.3.5 Relational operators
1575
1576// We only implement == and !=, as we don't have a need for the rest yet.
1577
1578namespace gtest_internal {
1579
1580// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
1581// first k fields of t1 equals the first k fields of t2.
1582// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
1583// k1 != k2.
1584template <int kSize1, int kSize2>
1585struct SameSizeTuplePrefixComparator;
1586
1587template <>
1588struct SameSizeTuplePrefixComparator<0, 0> {
1589  template <class Tuple1, class Tuple2>
1590  static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
1591    return true;
1592  }
1593};
1594
1595template <int k>
1596struct SameSizeTuplePrefixComparator<k, k> {
1597  template <class Tuple1, class Tuple2>
1598  static bool Eq(const Tuple1& t1, const Tuple2& t2) {
1599    return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
1600        ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
1601  }
1602};
1603
1604}  // namespace gtest_internal
1605
1606template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1607inline bool operator==(const GTEST_10_TUPLE_(T)& t,
1608                       const GTEST_10_TUPLE_(U)& u) {
1609  return gtest_internal::SameSizeTuplePrefixComparator<
1610      tuple_size<GTEST_10_TUPLE_(T) >::value,
1611      tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
1612}
1613
1614template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1615inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
1616                       const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
1617
1618// 6.1.4 Pairs.
1619// Unimplemented.
1620
1621}  // namespace tr1
1622}  // namespace std
1623
1624#undef GTEST_0_TUPLE_
1625#undef GTEST_1_TUPLE_
1626#undef GTEST_2_TUPLE_
1627#undef GTEST_3_TUPLE_
1628#undef GTEST_4_TUPLE_
1629#undef GTEST_5_TUPLE_
1630#undef GTEST_6_TUPLE_
1631#undef GTEST_7_TUPLE_
1632#undef GTEST_8_TUPLE_
1633#undef GTEST_9_TUPLE_
1634#undef GTEST_10_TUPLE_
1635
1636#undef GTEST_0_TYPENAMES_
1637#undef GTEST_1_TYPENAMES_
1638#undef GTEST_2_TYPENAMES_
1639#undef GTEST_3_TYPENAMES_
1640#undef GTEST_4_TYPENAMES_
1641#undef GTEST_5_TYPENAMES_
1642#undef GTEST_6_TYPENAMES_
1643#undef GTEST_7_TYPENAMES_
1644#undef GTEST_8_TYPENAMES_
1645#undef GTEST_9_TYPENAMES_
1646#undef GTEST_10_TYPENAMES_
1647
1648#undef GTEST_DECLARE_TUPLE_AS_FRIEND_
1649#undef GTEST_BY_REF_
1650#undef GTEST_ADD_REF_
1651#undef GTEST_TUPLE_ELEMENT_
1652
1653#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1654# elif GTEST_ENV_HAS_STD_TUPLE_
1655#  include <tuple>
1656// C++11 puts its tuple into the ::std namespace rather than
1657// ::std::tr1.  gtest expects tuple to live in ::std::tr1, so put it there.
1658// This causes undefined behavior, but supported compilers react in
1659// the way we intend.
1660namespace std {
1661namespace tr1 {
1662using ::std::get;
1663using ::std::make_tuple;
1664using ::std::tuple;
1665using ::std::tuple_element;
1666using ::std::tuple_size;
1667}
1668}
1669
1670# elif GTEST_OS_SYMBIAN
1671
1672// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
1673// use STLport's tuple implementation, which unfortunately doesn't
1674// work as the copy of STLport distributed with Symbian is incomplete.
1675// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
1676// use its own tuple implementation.
1677#  ifdef BOOST_HAS_TR1_TUPLE
1678#   undef BOOST_HAS_TR1_TUPLE
1679#  endif  // BOOST_HAS_TR1_TUPLE
1680
1681// This prevents <boost/tr1/detail/config.hpp>, which defines
1682// BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
1683#  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
1684#  include <tuple>
1685
1686# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
1687// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does
1688// not conform to the TR1 spec, which requires the header to be <tuple>.
1689
1690#  if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1691// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
1692// which is #included by <tr1/tuple>, to not compile when RTTI is
1693// disabled.  _TR1_FUNCTIONAL is the header guard for
1694// <tr1/functional>.  Hence the following #define is a hack to prevent
1695// <tr1/functional> from being included.
1696#   define _TR1_FUNCTIONAL 1
1697#   include <tr1/tuple>
1698#   undef _TR1_FUNCTIONAL  // Allows the user to #include
1699                        // <tr1/functional> if he chooses to.
1700#  else
1701#   include <tr1/tuple>  // NOLINT
1702#  endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1703
1704# else
1705// If the compiler is not GCC 4.0+, we assume the user is using a
1706// spec-conforming TR1 implementation.
1707#  include <tuple>  // NOLINT
1708# endif  // GTEST_USE_OWN_TR1_TUPLE
1709
1710#endif  // GTEST_HAS_TR1_TUPLE
1711
1712// Determines whether clone(2) is supported.
1713// Usually it will only be available on Linux, excluding
1714// Linux on the Itanium architecture.
1715// Also see http://linux.die.net/man/2/clone.
1716#ifndef GTEST_HAS_CLONE
1717// The user didn't tell us, so we need to figure it out.
1718
1719# if GTEST_OS_LINUX && !defined(__ia64__)
1720#  if GTEST_OS_LINUX_ANDROID
1721// On Android, clone() is only available on ARM starting with Gingerbread.
1722#    if defined(__arm__) && __ANDROID_API__ >= 9
1723#     define GTEST_HAS_CLONE 1
1724#    else
1725#     define GTEST_HAS_CLONE 0
1726#    endif
1727#  else
1728#   define GTEST_HAS_CLONE 1
1729#  endif
1730# else
1731#  define GTEST_HAS_CLONE 0
1732# endif  // GTEST_OS_LINUX && !defined(__ia64__)
1733
1734#endif  // GTEST_HAS_CLONE
1735
1736// Determines whether to support stream redirection. This is used to test
1737// output correctness and to implement death tests.
1738#ifndef GTEST_HAS_STREAM_REDIRECTION
1739// By default, we assume that stream redirection is supported on all
1740// platforms except known mobile ones.
1741# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
1742#  define GTEST_HAS_STREAM_REDIRECTION 0
1743# else
1744#  define GTEST_HAS_STREAM_REDIRECTION 1
1745# endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
1746#endif  // GTEST_HAS_STREAM_REDIRECTION
1747
1748// Determines whether to support death tests.
1749// Google Test does not support death tests for VC 7.1 and earlier as
1750// abort() in a VC 7.1 application compiled as GUI in debug config
1751// pops up a dialog window that cannot be suppressed programmatically.
1752#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
1753     (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \
1754     (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
1755     GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
1756     GTEST_OS_OPENBSD || GTEST_OS_QNX)
1757# define GTEST_HAS_DEATH_TEST 1
1758# include <vector>  // NOLINT
1759#endif
1760
1761// We don't support MSVC 7.1 with exceptions disabled now.  Therefore
1762// all the compilers we care about are adequate for supporting
1763// value-parameterized tests.
1764#define GTEST_HAS_PARAM_TEST 1
1765
1766// Determines whether to support type-driven tests.
1767
1768// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
1769// Sun Pro CC, IBM Visual Age, and HP aCC support.
1770#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
1771    defined(__IBMCPP__) || defined(__HP_aCC)
1772# define GTEST_HAS_TYPED_TEST 1
1773# define GTEST_HAS_TYPED_TEST_P 1
1774#endif
1775
1776// Determines whether to support Combine(). This only makes sense when
1777// value-parameterized tests are enabled.  The implementation doesn't
1778// work on Sun Studio since it doesn't understand templated conversion
1779// operators.
1780#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
1781# define GTEST_HAS_COMBINE 1
1782#endif
1783
1784// Determines whether the system compiler uses UTF-16 for encoding wide strings.
1785#define GTEST_WIDE_STRING_USES_UTF16_ \
1786    (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
1787
1788// Determines whether test results can be streamed to a socket.
1789#if GTEST_OS_LINUX
1790# define GTEST_CAN_STREAM_RESULTS_ 1
1791#endif
1792
1793// Defines some utility macros.
1794
1795// The GNU compiler emits a warning if nested "if" statements are followed by
1796// an "else" statement and braces are not used to explicitly disambiguate the
1797// "else" binding.  This leads to problems with code like:
1798//
1799//   if (gate)
1800//     ASSERT_*(condition) << "Some message";
1801//
1802// The "switch (0) case 0:" idiom is used to suppress this.
1803#ifdef __INTEL_COMPILER
1804# define GTEST_AMBIGUOUS_ELSE_BLOCKER_
1805#else
1806# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default:  // NOLINT
1807#endif
1808
1809// Use this annotation at the end of a struct/class definition to
1810// prevent the compiler from optimizing away instances that are never
1811// used.  This is useful when all interesting logic happens inside the
1812// c'tor and / or d'tor.  Example:
1813//
1814//   struct Foo {
1815//     Foo() { ... }
1816//   } GTEST_ATTRIBUTE_UNUSED_;
1817//
1818// Also use it after a variable or parameter declaration to tell the
1819// compiler the variable/parameter does not have to be used.
1820#if defined(__GNUC__) && !defined(COMPILER_ICC)
1821# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
1822#else
1823# define GTEST_ATTRIBUTE_UNUSED_
1824#endif
1825
1826// A macro to disallow operator=
1827// This should be used in the private: declarations for a class.
1828#define GTEST_DISALLOW_ASSIGN_(type)\
1829  void operator=(type const &)
1830
1831// A macro to disallow copy constructor and operator=
1832// This should be used in the private: declarations for a class.
1833#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
1834  type(type const &);\
1835  GTEST_DISALLOW_ASSIGN_(type)
1836
1837// Tell the compiler to warn about unused return values for functions declared
1838// with this macro.  The macro should be used on function declarations
1839// following the argument list:
1840//
1841//   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
1842#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
1843# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
1844#else
1845# define GTEST_MUST_USE_RESULT_
1846#endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
1847
1848// Determine whether the compiler supports Microsoft's Structured Exception
1849// Handling.  This is supported by several Windows compilers but generally
1850// does not exist on any other system.
1851#ifndef GTEST_HAS_SEH
1852// The user didn't tell us, so we need to figure it out.
1853
1854# if defined(_MSC_VER) || defined(__BORLANDC__)
1855// These two compilers are known to support SEH.
1856#  define GTEST_HAS_SEH 1
1857# else
1858// Assume no SEH.
1859#  define GTEST_HAS_SEH 0
1860# endif
1861
1862#endif  // GTEST_HAS_SEH
1863
1864#ifdef _MSC_VER
1865
1866# if GTEST_LINKED_AS_SHARED_LIBRARY
1867#  define GTEST_API_ __declspec(dllimport)
1868# elif GTEST_CREATE_SHARED_LIBRARY
1869#  define GTEST_API_ __declspec(dllexport)
1870# endif
1871
1872#endif  // _MSC_VER
1873
1874#ifndef GTEST_API_
1875# define GTEST_API_
1876#endif
1877
1878#ifdef __GNUC__
1879// Ask the compiler to never inline a given function.
1880# define GTEST_NO_INLINE_ __attribute__((noinline))
1881#else
1882# define GTEST_NO_INLINE_
1883#endif
1884
1885// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
1886#if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
1887# define GTEST_HAS_CXXABI_H_ 1
1888#else
1889# define GTEST_HAS_CXXABI_H_ 0
1890#endif
1891
1892namespace testing {
1893
1894class Message;
1895
1896namespace internal {
1897
1898// A secret type that Google Test users don't know about.  It has no
1899// definition on purpose.  Therefore it's impossible to create a
1900// Secret object, which is what we want.
1901class Secret;
1902
1903// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
1904// expression is true. For example, you could use it to verify the
1905// size of a static array:
1906//
1907//   GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
1908//                         content_type_names_incorrect_size);
1909//
1910// or to make sure a struct is smaller than a certain size:
1911//
1912//   GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
1913//
1914// The second argument to the macro is the name of the variable. If
1915// the expression is false, most compilers will issue a warning/error
1916// containing the name of the variable.
1917
1918template <bool>
1919struct CompileAssert {
1920};
1921
1922#define GTEST_COMPILE_ASSERT_(expr, msg) \
1923  typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
1924      msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
1925
1926// Implementation details of GTEST_COMPILE_ASSERT_:
1927//
1928// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
1929//   elements (and thus is invalid) when the expression is false.
1930//
1931// - The simpler definition
1932//
1933//    #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
1934//
1935//   does not work, as gcc supports variable-length arrays whose sizes
1936//   are determined at run-time (this is gcc's extension and not part
1937//   of the C++ standard).  As a result, gcc fails to reject the
1938//   following code with the simple definition:
1939//
1940//     int foo;
1941//     GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
1942//                                      // not a compile-time constant.
1943//
1944// - By using the type CompileAssert<(bool(expr))>, we ensures that
1945//   expr is a compile-time constant.  (Template arguments must be
1946//   determined at compile-time.)
1947//
1948// - The outter parentheses in CompileAssert<(bool(expr))> are necessary
1949//   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written
1950//
1951//     CompileAssert<bool(expr)>
1952//
1953//   instead, these compilers will refuse to compile
1954//
1955//     GTEST_COMPILE_ASSERT_(5 > 0, some_message);
1956//
1957//   (They seem to think the ">" in "5 > 0" marks the end of the
1958//   template argument list.)
1959//
1960// - The array size is (bool(expr) ? 1 : -1), instead of simply
1961//
1962//     ((expr) ? 1 : -1).
1963//
1964//   This is to avoid running into a bug in MS VC 7.1, which
1965//   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
1966
1967// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
1968//
1969// This template is declared, but intentionally undefined.
1970template <typename T1, typename T2>
1971struct StaticAssertTypeEqHelper;
1972
1973template <typename T>
1974struct StaticAssertTypeEqHelper<T, T> {};
1975
1976#if GTEST_HAS_GLOBAL_STRING
1977typedef ::string string;
1978#else
1979typedef ::std::string string;
1980#endif  // GTEST_HAS_GLOBAL_STRING
1981
1982#if GTEST_HAS_GLOBAL_WSTRING
1983typedef ::wstring wstring;
1984#elif GTEST_HAS_STD_WSTRING
1985typedef ::std::wstring wstring;
1986#endif  // GTEST_HAS_GLOBAL_WSTRING
1987
1988// A helper for suppressing warnings on constant condition.  It just
1989// returns 'condition'.
1990GTEST_API_ bool IsTrue(bool condition);
1991
1992// Defines scoped_ptr.
1993
1994// This implementation of scoped_ptr is PARTIAL - it only contains
1995// enough stuff to satisfy Google Test's need.
1996template <typename T>
1997class scoped_ptr {
1998 public:
1999  typedef T element_type;
2000
2001  explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
2002  ~scoped_ptr() { reset(); }
2003
2004  T& operator*() const { return *ptr_; }
2005  T* operator->() const { return ptr_; }
2006  T* get() const { return ptr_; }
2007
2008  T* release() {
2009    T* const ptr = ptr_;
2010    ptr_ = NULL;
2011    return ptr;
2012  }
2013
2014  void reset(T* p = NULL) {
2015    if (p != ptr_) {
2016      if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.
2017        delete ptr_;
2018      }
2019      ptr_ = p;
2020    }
2021  }
2022
2023 private:
2024  T* ptr_;
2025
2026  GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
2027};
2028
2029// Defines RE.
2030
2031// A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended
2032// Regular Expression syntax.
2033class GTEST_API_ RE {
2034 public:
2035  // A copy constructor is required by the Standard to initialize object
2036  // references from r-values.
2037  RE(const RE& other) { Init(other.pattern()); }
2038
2039  // Constructs an RE from a string.
2040  RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT
2041
2042#if GTEST_HAS_GLOBAL_STRING
2043
2044  RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT
2045
2046#endif  // GTEST_HAS_GLOBAL_STRING
2047
2048  RE(const char* regex) { Init(regex); }  // NOLINT
2049  ~RE();
2050
2051  // Returns the string representation of the regex.
2052  const char* pattern() const { return pattern_; }
2053
2054  // FullMatch(str, re) returns true iff regular expression re matches
2055  // the entire str.
2056  // PartialMatch(str, re) returns true iff regular expression re
2057  // matches a substring of str (including str itself).
2058  //
2059  // TODO(wan@google.com): make FullMatch() and PartialMatch() work
2060  // when str contains NUL characters.
2061  static bool FullMatch(const ::std::string& str, const RE& re) {
2062    return FullMatch(str.c_str(), re);
2063  }
2064  static bool PartialMatch(const ::std::string& str, const RE& re) {
2065    return PartialMatch(str.c_str(), re);
2066  }
2067
2068#if GTEST_HAS_GLOBAL_STRING
2069
2070  static bool FullMatch(const ::string& str, const RE& re) {
2071    return FullMatch(str.c_str(), re);
2072  }
2073  static bool PartialMatch(const ::string& str, const RE& re) {
2074    return PartialMatch(str.c_str(), re);
2075  }
2076
2077#endif  // GTEST_HAS_GLOBAL_STRING
2078
2079  static bool FullMatch(const char* str, const RE& re);
2080  static bool PartialMatch(const char* str, const RE& re);
2081
2082 private:
2083  void Init(const char* regex);
2084
2085  // We use a const char* instead of an std::string, as Google Test used to be
2086  // used where std::string is not available.  TODO(wan@google.com): change to
2087  // std::string.
2088  const char* pattern_;
2089  bool is_valid_;
2090
2091#if GTEST_USES_POSIX_RE
2092
2093  regex_t full_regex_;     // For FullMatch().
2094  regex_t partial_regex_;  // For PartialMatch().
2095
2096#else  // GTEST_USES_SIMPLE_RE
2097
2098  const char* full_pattern_;  // For FullMatch();
2099
2100#endif
2101
2102  GTEST_DISALLOW_ASSIGN_(RE);
2103};
2104
2105// Formats a source file path and a line number as they would appear
2106// in an error message from the compiler used to compile this code.
2107GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
2108
2109// Formats a file location for compiler-independent XML output.
2110// Although this function is not platform dependent, we put it next to
2111// FormatFileLocation in order to contrast the two functions.
2112GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
2113                                                               int line);
2114
2115// Defines logging utilities:
2116//   GTEST_LOG_(severity) - logs messages at the specified severity level. The
2117//                          message itself is streamed into the macro.
2118//   LogToStderr()  - directs all log messages to stderr.
2119//   FlushInfoLog() - flushes informational log messages.
2120
2121enum GTestLogSeverity {
2122  GTEST_INFO,
2123  GTEST_WARNING,
2124  GTEST_ERROR,
2125  GTEST_FATAL
2126};
2127
2128// Formats log entry severity, provides a stream object for streaming the
2129// log message, and terminates the message with a newline when going out of
2130// scope.
2131class GTEST_API_ GTestLog {
2132 public:
2133  GTestLog(GTestLogSeverity severity, const char* file, int line);
2134
2135  // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
2136  ~GTestLog();
2137
2138  ::std::ostream& GetStream() { return ::std::cerr; }
2139
2140 private:
2141  const GTestLogSeverity severity_;
2142
2143  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
2144};
2145
2146#define GTEST_LOG_(severity) \
2147    ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
2148                                  __FILE__, __LINE__).GetStream()
2149
2150inline void LogToStderr() {}
2151inline void FlushInfoLog() { fflush(NULL); }
2152
2153// INTERNAL IMPLEMENTATION - DO NOT USE.
2154//
2155// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
2156// is not satisfied.
2157//  Synopsys:
2158//    GTEST_CHECK_(boolean_condition);
2159//     or
2160//    GTEST_CHECK_(boolean_condition) << "Additional message";
2161//
2162//    This checks the condition and if the condition is not satisfied
2163//    it prints message about the condition violation, including the
2164//    condition itself, plus additional message streamed into it, if any,
2165//    and then it aborts the program. It aborts the program irrespective of
2166//    whether it is built in the debug mode or not.
2167#define GTEST_CHECK_(condition) \
2168    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
2169    if (::testing::internal::IsTrue(condition)) \
2170      ; \
2171    else \
2172      GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
2173
2174// An all-mode assert to verify that the given POSIX-style function
2175// call returns 0 (indicating success).  Known limitation: this
2176// doesn't expand to a balanced 'if' statement, so enclose the macro
2177// in {} if you need to use it as the only statement in an 'if'
2178// branch.
2179#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
2180  if (const int gtest_error = (posix_call)) \
2181    GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
2182                      << gtest_error
2183
2184// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
2185//
2186// Use ImplicitCast_ as a safe version of static_cast for upcasting in
2187// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
2188// const Foo*).  When you use ImplicitCast_, the compiler checks that
2189// the cast is safe.  Such explicit ImplicitCast_s are necessary in
2190// surprisingly many situations where C++ demands an exact type match
2191// instead of an argument type convertable to a target type.
2192//
2193// The syntax for using ImplicitCast_ is the same as for static_cast:
2194//
2195//   ImplicitCast_<ToType>(expr)
2196//
2197// ImplicitCast_ would have been part of the C++ standard library,
2198// but the proposal was submitted too late.  It will probably make
2199// its way into the language in the future.
2200//
2201// This relatively ugly name is intentional. It prevents clashes with
2202// similar functions users may have (e.g., implicit_cast). The internal
2203// namespace alone is not enough because the function can be found by ADL.
2204template<typename To>
2205inline To ImplicitCast_(To x) { return x; }
2206
2207// When you upcast (that is, cast a pointer from type Foo to type
2208// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
2209// always succeed.  When you downcast (that is, cast a pointer from
2210// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
2211// how do you know the pointer is really of type SubclassOfFoo?  It
2212// could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,
2213// when you downcast, you should use this macro.  In debug mode, we
2214// use dynamic_cast<> to double-check the downcast is legal (we die
2215// if it's not).  In normal mode, we do the efficient static_cast<>
2216// instead.  Thus, it's important to test in debug mode to make sure
2217// the cast is legal!
2218//    This is the only place in the code we should use dynamic_cast<>.
2219// In particular, you SHOULDN'T be using dynamic_cast<> in order to
2220// do RTTI (eg code like this:
2221//    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
2222//    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
2223// You should design the code some other way not to need this.
2224//
2225// This relatively ugly name is intentional. It prevents clashes with
2226// similar functions users may have (e.g., down_cast). The internal
2227// namespace alone is not enough because the function can be found by ADL.
2228template<typename To, typename From>  // use like this: DownCast_<T*>(foo);
2229inline To DownCast_(From* f) {  // so we only accept pointers
2230  // Ensures that To is a sub-type of From *.  This test is here only
2231  // for compile-time type checking, and has no overhead in an
2232  // optimized build at run-time, as it will be optimized away
2233  // completely.
2234  if (false) {
2235    const To to = NULL;
2236    ::testing::internal::ImplicitCast_<From*>(to);
2237  }
2238
2239#if GTEST_HAS_RTTI
2240  // RTTI: debug mode only!
2241  GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
2242#endif
2243  return static_cast<To>(f);
2244}
2245
2246// Downcasts the pointer of type Base to Derived.
2247// Derived must be a subclass of Base. The parameter MUST
2248// point to a class of type Derived, not any subclass of it.
2249// When RTTI is available, the function performs a runtime
2250// check to enforce this.
2251template <class Derived, class Base>
2252Derived* CheckedDowncastToActualType(Base* base) {
2253#if GTEST_HAS_RTTI
2254  GTEST_CHECK_(typeid(*base) == typeid(Derived));
2255  return dynamic_cast<Derived*>(base);  // NOLINT
2256#else
2257  return static_cast<Derived*>(base);  // Poor man's downcast.
2258#endif
2259}
2260
2261#if GTEST_HAS_STREAM_REDIRECTION
2262
2263// Defines the stderr capturer:
2264//   CaptureStdout     - starts capturing stdout.
2265//   GetCapturedStdout - stops capturing stdout and returns the captured string.
2266//   CaptureStderr     - starts capturing stderr.
2267//   GetCapturedStderr - stops capturing stderr and returns the captured string.
2268//
2269GTEST_API_ void CaptureStdout();
2270GTEST_API_ std::string GetCapturedStdout();
2271GTEST_API_ void CaptureStderr();
2272GTEST_API_ std::string GetCapturedStderr();
2273
2274#endif  // GTEST_HAS_STREAM_REDIRECTION
2275
2276
2277#if GTEST_HAS_DEATH_TEST
2278
2279const ::std::vector<testing::internal::string>& GetInjectableArgvs();
2280void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
2281                             new_argvs);
2282
2283// A copy of all command line arguments.  Set by InitGoogleTest().
2284extern ::std::vector<testing::internal::string> g_argvs;
2285
2286#endif  // GTEST_HAS_DEATH_TEST
2287
2288// Defines synchronization primitives.
2289
2290#if GTEST_HAS_PTHREAD
2291
2292// Sleeps for (roughly) n milli-seconds.  This function is only for
2293// testing Google Test's own constructs.  Don't use it in user tests,
2294// either directly or indirectly.
2295inline void SleepMilliseconds(int n) {
2296  const timespec time = {
2297    0,                  // 0 seconds.
2298    n * 1000L * 1000L,  // And n ms.
2299  };
2300  nanosleep(&time, NULL);
2301}
2302
2303// Allows a controller thread to pause execution of newly created
2304// threads until notified.  Instances of this class must be created
2305// and destroyed in the controller thread.
2306//
2307// This class is only for testing Google Test's own constructs. Do not
2308// use it in user tests, either directly or indirectly.
2309class Notification {
2310 public:
2311  Notification() : notified_(false) {
2312    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2313  }
2314  ~Notification() {
2315    pthread_mutex_destroy(&mutex_);
2316  }
2317
2318  // Notifies all threads created with this notification to start. Must
2319  // be called from the controller thread.
2320  void Notify() {
2321    pthread_mutex_lock(&mutex_);
2322    notified_ = true;
2323    pthread_mutex_unlock(&mutex_);
2324  }
2325
2326  // Blocks until the controller thread notifies. Must be called from a test
2327  // thread.
2328  void WaitForNotification() {
2329    for (;;) {
2330      pthread_mutex_lock(&mutex_);
2331      const bool notified = notified_;
2332      pthread_mutex_unlock(&mutex_);
2333      if (notified)
2334        break;
2335      SleepMilliseconds(10);
2336    }
2337  }
2338
2339 private:
2340  pthread_mutex_t mutex_;
2341  bool notified_;
2342
2343  GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
2344};
2345
2346// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
2347// Consequently, it cannot select a correct instantiation of ThreadWithParam
2348// in order to call its Run(). Introducing ThreadWithParamBase as a
2349// non-templated base class for ThreadWithParam allows us to bypass this
2350// problem.
2351class ThreadWithParamBase {
2352 public:
2353  virtual ~ThreadWithParamBase() {}
2354  virtual void Run() = 0;
2355};
2356
2357// pthread_create() accepts a pointer to a function type with the C linkage.
2358// According to the Standard (7.5/1), function types with different linkages
2359// are different even if they are otherwise identical.  Some compilers (for
2360// example, SunStudio) treat them as different types.  Since class methods
2361// cannot be defined with C-linkage we need to define a free C-function to
2362// pass into pthread_create().
2363extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
2364  static_cast<ThreadWithParamBase*>(thread)->Run();
2365  return NULL;
2366}
2367
2368// Helper class for testing Google Test's multi-threading constructs.
2369// To use it, write:
2370//
2371//   void ThreadFunc(int param) { /* Do things with param */ }
2372//   Notification thread_can_start;
2373//   ...
2374//   // The thread_can_start parameter is optional; you can supply NULL.
2375//   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
2376//   thread_can_start.Notify();
2377//
2378// These classes are only for testing Google Test's own constructs. Do
2379// not use them in user tests, either directly or indirectly.
2380template <typename T>
2381class ThreadWithParam : public ThreadWithParamBase {
2382 public:
2383  typedef void (*UserThreadFunc)(T);
2384
2385  ThreadWithParam(
2386      UserThreadFunc func, T param, Notification* thread_can_start)
2387      : func_(func),
2388        param_(param),
2389        thread_can_start_(thread_can_start),
2390        finished_(false) {
2391    ThreadWithParamBase* const base = this;
2392    // The thread can be created only after all fields except thread_
2393    // have been initialized.
2394    GTEST_CHECK_POSIX_SUCCESS_(
2395        pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
2396  }
2397  ~ThreadWithParam() { Join(); }
2398
2399  void Join() {
2400    if (!finished_) {
2401      GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
2402      finished_ = true;
2403    }
2404  }
2405
2406  virtual void Run() {
2407    if (thread_can_start_ != NULL)
2408      thread_can_start_->WaitForNotification();
2409    func_(param_);
2410  }
2411
2412 private:
2413  const UserThreadFunc func_;  // User-supplied thread function.
2414  const T param_;  // User-supplied parameter to the thread function.
2415  // When non-NULL, used to block execution until the controller thread
2416  // notifies.
2417  Notification* const thread_can_start_;
2418  bool finished_;  // true iff we know that the thread function has finished.
2419  pthread_t thread_;  // The native thread object.
2420
2421  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
2422};
2423
2424// MutexBase and Mutex implement mutex on pthreads-based platforms. They
2425// are used in conjunction with class MutexLock:
2426//
2427//   Mutex mutex;
2428//   ...
2429//   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the end
2430//                            // of the current scope.
2431//
2432// MutexBase implements behavior for both statically and dynamically
2433// allocated mutexes.  Do not use MutexBase directly.  Instead, write
2434// the following to define a static mutex:
2435//
2436//   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
2437//
2438// You can forward declare a static mutex like this:
2439//
2440//   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
2441//
2442// To create a dynamic mutex, just define an object of type Mutex.
2443class MutexBase {
2444 public:
2445  // Acquires this mutex.
2446  void Lock() {
2447    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
2448    owner_ = pthread_self();
2449    has_owner_ = true;
2450  }
2451
2452  // Releases this mutex.
2453  void Unlock() {
2454    // Since the lock is being released the owner_ field should no longer be
2455    // considered valid. We don't protect writing to has_owner_ here, as it's
2456    // the caller's responsibility to ensure that the current thread holds the
2457    // mutex when this is called.
2458    has_owner_ = false;
2459    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
2460  }
2461
2462  // Does nothing if the current thread holds the mutex. Otherwise, crashes
2463  // with high probability.
2464  void AssertHeld() const {
2465    GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
2466        << "The current thread is not holding the mutex @" << this;
2467  }
2468
2469  // A static mutex may be used before main() is entered.  It may even
2470  // be used before the dynamic initialization stage.  Therefore we
2471  // must be able to initialize a static mutex object at link time.
2472  // This means MutexBase has to be a POD and its member variables
2473  // have to be public.
2474 public:
2475  pthread_mutex_t mutex_;  // The underlying pthread mutex.
2476  // has_owner_ indicates whether the owner_ field below contains a valid thread
2477  // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
2478  // accesses to the owner_ field should be protected by a check of this field.
2479  // An alternative might be to memset() owner_ to all zeros, but there's no
2480  // guarantee that a zero'd pthread_t is necessarily invalid or even different
2481  // from pthread_self().
2482  bool has_owner_;
2483  pthread_t owner_;  // The thread holding the mutex.
2484};
2485
2486// Forward-declares a static mutex.
2487# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2488    extern ::testing::internal::MutexBase mutex
2489
2490// Defines and statically (i.e. at link time) initializes a static mutex.
2491// The initialization list here does not explicitly initialize each field,
2492// instead relying on default initialization for the unspecified fields. In
2493// particular, the owner_ field (a pthread_t) is not explicitly initialized.
2494// This allows initialization to work whether pthread_t is a scalar or struct.
2495// The flag -Wmissing-field-initializers must not be specified for this to work.
2496# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
2497    ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
2498
2499// The Mutex class can only be used for mutexes created at runtime. It
2500// shares its API with MutexBase otherwise.
2501class Mutex : public MutexBase {
2502 public:
2503  Mutex() {
2504    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2505    has_owner_ = false;
2506  }
2507  ~Mutex() {
2508    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
2509  }
2510
2511 private:
2512  GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
2513};
2514
2515// We cannot name this class MutexLock as the ctor declaration would
2516// conflict with a macro named MutexLock, which is defined on some
2517// platforms.  Hence the typedef trick below.
2518class GTestMutexLock {
2519 public:
2520  explicit GTestMutexLock(MutexBase* mutex)
2521      : mutex_(mutex) { mutex_->Lock(); }
2522
2523  ~GTestMutexLock() { mutex_->Unlock(); }
2524
2525 private:
2526  MutexBase* const mutex_;
2527
2528  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
2529};
2530
2531typedef GTestMutexLock MutexLock;
2532
2533// Helpers for ThreadLocal.
2534
2535// pthread_key_create() requires DeleteThreadLocalValue() to have
2536// C-linkage.  Therefore it cannot be templatized to access
2537// ThreadLocal<T>.  Hence the need for class
2538// ThreadLocalValueHolderBase.
2539class ThreadLocalValueHolderBase {
2540 public:
2541  virtual ~ThreadLocalValueHolderBase() {}
2542};
2543
2544// Called by pthread to delete thread-local data stored by
2545// pthread_setspecific().
2546extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
2547  delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
2548}
2549
2550// Implements thread-local storage on pthreads-based systems.
2551//
2552//   // Thread 1
2553//   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.
2554//
2555//   // Thread 2
2556//   tl.set(150);  // Changes the value for thread 2 only.
2557//   EXPECT_EQ(150, tl.get());
2558//
2559//   // Thread 1
2560//   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.
2561//   tl.set(200);
2562//   EXPECT_EQ(200, tl.get());
2563//
2564// The template type argument T must have a public copy constructor.
2565// In addition, the default ThreadLocal constructor requires T to have
2566// a public default constructor.
2567//
2568// An object managed for a thread by a ThreadLocal instance is deleted
2569// when the thread exits.  Or, if the ThreadLocal instance dies in
2570// that thread, when the ThreadLocal dies.  It's the user's
2571// responsibility to ensure that all other threads using a ThreadLocal
2572// have exited when it dies, or the per-thread objects for those
2573// threads will not be deleted.
2574//
2575// Google Test only uses global ThreadLocal objects.  That means they
2576// will die after main() has returned.  Therefore, no per-thread
2577// object managed by Google Test will be leaked as long as all threads
2578// using Google Test have exited when main() returns.
2579template <typename T>
2580class ThreadLocal {
2581 public:
2582  ThreadLocal() : key_(CreateKey()),
2583                  default_() {}
2584  explicit ThreadLocal(const T& value) : key_(CreateKey()),
2585                                         default_(value) {}
2586
2587  ~ThreadLocal() {
2588    // Destroys the managed object for the current thread, if any.
2589    DeleteThreadLocalValue(pthread_getspecific(key_));
2590
2591    // Releases resources associated with the key.  This will *not*
2592    // delete managed objects for other threads.
2593    GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
2594  }
2595
2596  T* pointer() { return GetOrCreateValue(); }
2597  const T* pointer() const { return GetOrCreateValue(); }
2598  const T& get() const { return *pointer(); }
2599  void set(const T& value) { *pointer() = value; }
2600
2601 private:
2602  // Holds a value of type T.
2603  class ValueHolder : public ThreadLocalValueHolderBase {
2604   public:
2605    explicit ValueHolder(const T& value) : value_(value) {}
2606
2607    T* pointer() { return &value_; }
2608
2609   private:
2610    T value_;
2611    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
2612  };
2613
2614  static pthread_key_t CreateKey() {
2615    pthread_key_t key;
2616    // When a thread exits, DeleteThreadLocalValue() will be called on
2617    // the object managed for that thread.
2618    GTEST_CHECK_POSIX_SUCCESS_(
2619        pthread_key_create(&key, &DeleteThreadLocalValue));
2620    return key;
2621  }
2622
2623  T* GetOrCreateValue() const {
2624    ThreadLocalValueHolderBase* const holder =
2625        static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
2626    if (holder != NULL) {
2627      return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
2628    }
2629
2630    ValueHolder* const new_holder = new ValueHolder(default_);
2631    ThreadLocalValueHolderBase* const holder_base = new_holder;
2632    GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
2633    return new_holder->pointer();
2634  }
2635
2636  // A key pthreads uses for looking up per-thread values.
2637  const pthread_key_t key_;
2638  const T default_;  // The default value for each thread.
2639
2640  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
2641};
2642
2643# define GTEST_IS_THREADSAFE 1
2644
2645#else  // GTEST_HAS_PTHREAD
2646
2647// A dummy implementation of synchronization primitives (mutex, lock,
2648// and thread-local variable).  Necessary for compiling Google Test where
2649// mutex is not supported - using Google Test in multiple threads is not
2650// supported on such platforms.
2651
2652class Mutex {
2653 public:
2654  Mutex() {}
2655  void Lock() {}
2656  void Unlock() {}
2657  void AssertHeld() const {}
2658};
2659
2660# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2661  extern ::testing::internal::Mutex mutex
2662
2663# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
2664
2665class GTestMutexLock {
2666 public:
2667  explicit GTestMutexLock(Mutex*) {}  // NOLINT
2668};
2669
2670typedef GTestMutexLock MutexLock;
2671
2672template <typename T>
2673class ThreadLocal {
2674 public:
2675  ThreadLocal() : value_() {}
2676  explicit ThreadLocal(const T& value) : value_(value) {}
2677  T* pointer() { return &value_; }
2678  const T* pointer() const { return &value_; }
2679  const T& get() const { return value_; }
2680  void set(const T& value) { value_ = value; }
2681 private:
2682  T value_;
2683};
2684
2685// The above synchronization primitives have dummy implementations.
2686// Therefore Google Test is not thread-safe.
2687# define GTEST_IS_THREADSAFE 0
2688
2689#endif  // GTEST_HAS_PTHREAD
2690
2691// Returns the number of threads running in the process, or 0 to indicate that
2692// we cannot detect it.
2693GTEST_API_ size_t GetThreadCount();
2694
2695// Passing non-POD classes through ellipsis (...) crashes the ARM
2696// compiler and generates a warning in Sun Studio.  The Nokia Symbian
2697// and the IBM XL C/C++ compiler try to instantiate a copy constructor
2698// for objects passed through ellipsis (...), failing for uncopyable
2699// objects.  We define this to ensure that only POD is passed through
2700// ellipsis on these systems.
2701#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
2702// We lose support for NULL detection where the compiler doesn't like
2703// passing non-POD classes through ellipsis (...).
2704# define GTEST_ELLIPSIS_NEEDS_POD_ 1
2705#else
2706# define GTEST_CAN_COMPARE_NULL 1
2707#endif
2708
2709// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
2710// const T& and const T* in a function template.  These compilers
2711// _can_ decide between class template specializations for T and T*,
2712// so a tr1::type_traits-like is_pointer works.
2713#if defined(__SYMBIAN32__) || defined(__IBMCPP__)
2714# define GTEST_NEEDS_IS_POINTER_ 1
2715#endif
2716
2717template <bool bool_value>
2718struct bool_constant {
2719  typedef bool_constant<bool_value> type;
2720  static const bool value = bool_value;
2721};
2722template <bool bool_value> const bool bool_constant<bool_value>::value;
2723
2724typedef bool_constant<false> false_type;
2725typedef bool_constant<true> true_type;
2726
2727template <typename T>
2728struct is_pointer : public false_type {};
2729
2730template <typename T>
2731struct is_pointer<T*> : public true_type {};
2732
2733template <typename Iterator>
2734struct IteratorTraits {
2735  typedef typename Iterator::value_type value_type;
2736};
2737
2738template <typename T>
2739struct IteratorTraits<T*> {
2740  typedef T value_type;
2741};
2742
2743template <typename T>
2744struct IteratorTraits<const T*> {
2745  typedef T value_type;
2746};
2747
2748#if GTEST_OS_WINDOWS
2749# define GTEST_PATH_SEP_ "\\"
2750# define GTEST_HAS_ALT_PATH_SEP_ 1
2751// The biggest signed integer type the compiler supports.
2752typedef __int64 BiggestInt;
2753#else
2754# define GTEST_PATH_SEP_ "/"
2755# define GTEST_HAS_ALT_PATH_SEP_ 0
2756typedef long long BiggestInt;  // NOLINT
2757#endif  // GTEST_OS_WINDOWS
2758
2759// Utilities for char.
2760
2761// isspace(int ch) and friends accept an unsigned char or EOF.  char
2762// may be signed, depending on the compiler (or compiler flags).
2763// Therefore we need to cast a char to unsigned char before calling
2764// isspace(), etc.
2765
2766inline bool IsAlpha(char ch) {
2767  return isalpha(static_cast<unsigned char>(ch)) != 0;
2768}
2769inline bool IsAlNum(char ch) {
2770  return isalnum(static_cast<unsigned char>(ch)) != 0;
2771}
2772inline bool IsDigit(char ch) {
2773  return isdigit(static_cast<unsigned char>(ch)) != 0;
2774}
2775inline bool IsLower(char ch) {
2776  return islower(static_cast<unsigned char>(ch)) != 0;
2777}
2778inline bool IsSpace(char ch) {
2779  return isspace(static_cast<unsigned char>(ch)) != 0;
2780}
2781inline bool IsUpper(char ch) {
2782  return isupper(static_cast<unsigned char>(ch)) != 0;
2783}
2784inline bool IsXDigit(char ch) {
2785  return isxdigit(static_cast<unsigned char>(ch)) != 0;
2786}
2787inline bool IsXDigit(wchar_t ch) {
2788  const unsigned char low_byte = static_cast<unsigned char>(ch);
2789  return ch == low_byte && isxdigit(low_byte) != 0;
2790}
2791
2792inline char ToLower(char ch) {
2793  return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
2794}
2795inline char ToUpper(char ch) {
2796  return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
2797}
2798
2799// The testing::internal::posix namespace holds wrappers for common
2800// POSIX functions.  These wrappers hide the differences between
2801// Windows/MSVC and POSIX systems.  Since some compilers define these
2802// standard functions as macros, the wrapper cannot have the same name
2803// as the wrapped function.
2804
2805namespace posix {
2806
2807// Functions with a different name on Windows.
2808
2809#if GTEST_OS_WINDOWS
2810
2811typedef struct _stat StatStruct;
2812
2813# ifdef __BORLANDC__
2814inline int IsATTY(int fd) { return isatty(fd); }
2815inline int StrCaseCmp(const char* s1, const char* s2) {
2816  return stricmp(s1, s2);
2817}
2818inline char* StrDup(const char* src) { return strdup(src); }
2819# else  // !__BORLANDC__
2820#  if GTEST_OS_WINDOWS_MOBILE
2821inline int IsATTY(int /* fd */) { return 0; }
2822#  else
2823inline int IsATTY(int fd) { return _isatty(fd); }
2824#  endif  // GTEST_OS_WINDOWS_MOBILE
2825inline int StrCaseCmp(const char* s1, const char* s2) {
2826  return _stricmp(s1, s2);
2827}
2828inline char* StrDup(const char* src) { return _strdup(src); }
2829# endif  // __BORLANDC__
2830
2831# if GTEST_OS_WINDOWS_MOBILE
2832inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
2833// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
2834// time and thus not defined there.
2835# else
2836inline int FileNo(FILE* file) { return _fileno(file); }
2837inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
2838inline int RmDir(const char* dir) { return _rmdir(dir); }
2839inline bool IsDir(const StatStruct& st) {
2840  return (_S_IFDIR & st.st_mode) != 0;
2841}
2842# endif  // GTEST_OS_WINDOWS_MOBILE
2843
2844#else
2845
2846typedef struct stat StatStruct;
2847
2848inline int FileNo(FILE* file) { return fileno(file); }
2849inline int IsATTY(int fd) { return isatty(fd); }
2850inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
2851inline int StrCaseCmp(const char* s1, const char* s2) {
2852  return strcasecmp(s1, s2);
2853}
2854inline char* StrDup(const char* src) { return strdup(src); }
2855inline int RmDir(const char* dir) { return rmdir(dir); }
2856inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
2857
2858#endif  // GTEST_OS_WINDOWS
2859
2860// Functions deprecated by MSVC 8.0.
2861
2862#ifdef _MSC_VER
2863// Temporarily disable warning 4996 (deprecated function).
2864# pragma warning(push)
2865# pragma warning(disable:4996)
2866#endif
2867
2868inline const char* StrNCpy(char* dest, const char* src, size_t n) {
2869  return strncpy(dest, src, n);
2870}
2871
2872// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
2873// StrError() aren't needed on Windows CE at this time and thus not
2874// defined there.
2875
2876#if !GTEST_OS_WINDOWS_MOBILE
2877inline int ChDir(const char* dir) { return chdir(dir); }
2878#endif
2879inline FILE* FOpen(const char* path, const char* mode) {
2880  return fopen(path, mode);
2881}
2882#if !GTEST_OS_WINDOWS_MOBILE
2883inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
2884  return freopen(path, mode, stream);
2885}
2886inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
2887#endif
2888inline int FClose(FILE* fp) { return fclose(fp); }
2889#if !GTEST_OS_WINDOWS_MOBILE
2890inline int Read(int fd, void* buf, unsigned int count) {
2891  return static_cast<int>(read(fd, buf, count));
2892}
2893inline int Write(int fd, const void* buf, unsigned int count) {
2894  return static_cast<int>(write(fd, buf, count));
2895}
2896inline int Close(int fd) { return close(fd); }
2897inline const char* StrError(int errnum) { return strerror(errnum); }
2898#endif
2899inline const char* GetEnv(const char* name) {
2900#if GTEST_OS_WINDOWS_MOBILE
2901  // We are on Windows CE, which has no environment variables.
2902  return NULL;
2903#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
2904  // Environment variables which we programmatically clear will be set to the
2905  // empty string rather than unset (NULL).  Handle that case.
2906  const char* const env = getenv(name);
2907  return (env != NULL && env[0] != '\0') ? env : NULL;
2908#else
2909  return getenv(name);
2910#endif
2911}
2912
2913#ifdef _MSC_VER
2914# pragma warning(pop)  // Restores the warning state.
2915#endif
2916
2917#if GTEST_OS_WINDOWS_MOBILE
2918// Windows CE has no C library. The abort() function is used in
2919// several places in Google Test. This implementation provides a reasonable
2920// imitation of standard behaviour.
2921void Abort();
2922#else
2923inline void Abort() { abort(); }
2924#endif  // GTEST_OS_WINDOWS_MOBILE
2925
2926}  // namespace posix
2927
2928// MSVC "deprecates" snprintf and issues warnings wherever it is used.  In
2929// order to avoid these warnings, we need to use _snprintf or _snprintf_s on
2930// MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate
2931// function in order to achieve that.  We use macro definition here because
2932// snprintf is a variadic function.
2933#if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
2934// MSVC 2005 and above support variadic macros.
2935# define GTEST_SNPRINTF_(buffer, size, format, ...) \
2936     _snprintf_s(buffer, size, size, format, __VA_ARGS__)
2937#elif defined(_MSC_VER)
2938// Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
2939// complain about _snprintf.
2940# define GTEST_SNPRINTF_ _snprintf
2941#else
2942# define GTEST_SNPRINTF_ snprintf
2943#endif
2944
2945// The maximum number a BiggestInt can represent.  This definition
2946// works no matter BiggestInt is represented in one's complement or
2947// two's complement.
2948//
2949// We cannot rely on numeric_limits in STL, as __int64 and long long
2950// are not part of standard C++ and numeric_limits doesn't need to be
2951// defined for them.
2952const BiggestInt kMaxBiggestInt =
2953    ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
2954
2955// This template class serves as a compile-time function from size to
2956// type.  It maps a size in bytes to a primitive type with that
2957// size. e.g.
2958//
2959//   TypeWithSize<4>::UInt
2960//
2961// is typedef-ed to be unsigned int (unsigned integer made up of 4
2962// bytes).
2963//
2964// Such functionality should belong to STL, but I cannot find it
2965// there.
2966//
2967// Google Test uses this class in the implementation of floating-point
2968// comparison.
2969//
2970// For now it only handles UInt (unsigned int) as that's all Google Test
2971// needs.  Other types can be easily added in the future if need
2972// arises.
2973template <size_t size>
2974class TypeWithSize {
2975 public:
2976  // This prevents the user from using TypeWithSize<N> with incorrect
2977  // values of N.
2978  typedef void UInt;
2979};
2980
2981// The specialization for size 4.
2982template <>
2983class TypeWithSize<4> {
2984 public:
2985  // unsigned int has size 4 in both gcc and MSVC.
2986  //
2987  // As base/basictypes.h doesn't compile on Windows, we cannot use
2988  // uint32, uint64, and etc here.
2989  typedef int Int;
2990  typedef unsigned int UInt;
2991};
2992
2993// The specialization for size 8.
2994template <>
2995class TypeWithSize<8> {
2996 public:
2997#if GTEST_OS_WINDOWS
2998  typedef __int64 Int;
2999  typedef unsigned __int64 UInt;
3000#else
3001  typedef long long Int;  // NOLINT
3002  typedef unsigned long long UInt;  // NOLINT
3003#endif  // GTEST_OS_WINDOWS
3004};
3005
3006// Integer types of known sizes.
3007typedef TypeWithSize<4>::Int Int32;
3008typedef TypeWithSize<4>::UInt UInt32;
3009typedef TypeWithSize<8>::Int Int64;
3010typedef TypeWithSize<8>::UInt UInt64;
3011typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
3012
3013// Utilities for command line flags and environment variables.
3014
3015// Macro for referencing flags.
3016#define GTEST_FLAG(name) FLAGS_gtest_##name
3017
3018// Macros for declaring flags.
3019#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
3020#define GTEST_DECLARE_int32_(name) \
3021    GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
3022#define GTEST_DECLARE_string_(name) \
3023    GTEST_API_ extern ::std::string GTEST_FLAG(name)
3024
3025// Macros for defining flags.
3026#define GTEST_DEFINE_bool_(name, default_val, doc) \
3027    GTEST_API_ bool GTEST_FLAG(name) = (default_val)
3028#define GTEST_DEFINE_int32_(name, default_val, doc) \
3029    GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
3030#define GTEST_DEFINE_string_(name, default_val, doc) \
3031    GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
3032
3033// Thread annotations
3034#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
3035#define GTEST_LOCK_EXCLUDED_(locks)
3036
3037// Parses 'str' for a 32-bit signed integer.  If successful, writes the result
3038// to *value and returns true; otherwise leaves *value unchanged and returns
3039// false.
3040// TODO(chandlerc): Find a better way to refactor flag and environment parsing
3041// out of both gtest-port.cc and gtest.cc to avoid exporting this utility
3042// function.
3043bool ParseInt32(const Message& src_text, const char* str, Int32* value);
3044
3045// Parses a bool/Int32/string from the environment variable
3046// corresponding to the given Google Test flag.
3047bool BoolFromGTestEnv(const char* flag, bool default_val);
3048GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
3049const char* StringFromGTestEnv(const char* flag, const char* default_val);
3050
3051}  // namespace internal
3052}  // namespace testing
3053
3054#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
3055
3056#if GTEST_OS_LINUX
3057# include <stdlib.h>
3058# include <sys/types.h>
3059# include <sys/wait.h>
3060# include <unistd.h>
3061#endif  // GTEST_OS_LINUX
3062
3063#if GTEST_HAS_EXCEPTIONS
3064# include <stdexcept>
3065#endif
3066
3067#include <ctype.h>
3068#include <float.h>
3069#include <string.h>
3070#include <iomanip>
3071#include <limits>
3072#include <set>
3073
3074// Copyright 2005, Google Inc.
3075// All rights reserved.
3076//
3077// Redistribution and use in source and binary forms, with or without
3078// modification, are permitted provided that the following conditions are
3079// met:
3080//
3081//     * Redistributions of source code must retain the above copyright
3082// notice, this list of conditions and the following disclaimer.
3083//     * Redistributions in binary form must reproduce the above
3084// copyright notice, this list of conditions and the following disclaimer
3085// in the documentation and/or other materials provided with the
3086// distribution.
3087//     * Neither the name of Google Inc. nor the names of its
3088// contributors may be used to endorse or promote products derived from
3089// this software without specific prior written permission.
3090//
3091// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3092// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3093// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3094// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3095// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3096// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3097// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3098// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3099// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3100// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3101// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3102//
3103// Author: wan@google.com (Zhanyong Wan)
3104//
3105// The Google C++ Testing Framework (Google Test)
3106//
3107// This header file defines the Message class.
3108//
3109// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
3110// leave some internal implementation details in this header file.
3111// They are clearly marked by comments like this:
3112//
3113//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
3114//
3115// Such code is NOT meant to be used by a user directly, and is subject
3116// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
3117// program!
3118
3119#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3120#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3121
3122#include <limits>
3123
3124
3125// Ensures that there is at least one operator<< in the global namespace.
3126// See Message& operator<<(...) below for why.
3127void operator<<(const testing::internal::Secret&, int);
3128
3129namespace testing {
3130
3131// The Message class works like an ostream repeater.
3132//
3133// Typical usage:
3134//
3135//   1. You stream a bunch of values to a Message object.
3136//      It will remember the text in a stringstream.
3137//   2. Then you stream the Message object to an ostream.
3138//      This causes the text in the Message to be streamed
3139//      to the ostream.
3140//
3141// For example;
3142//
3143//   testing::Message foo;
3144//   foo << 1 << " != " << 2;
3145//   std::cout << foo;
3146//
3147// will print "1 != 2".
3148//
3149// Message is not intended to be inherited from.  In particular, its
3150// destructor is not virtual.
3151//
3152// Note that stringstream behaves differently in gcc and in MSVC.  You
3153// can stream a NULL char pointer to it in the former, but not in the
3154// latter (it causes an access violation if you do).  The Message
3155// class hides this difference by treating a NULL char pointer as
3156// "(null)".
3157class GTEST_API_ Message {
3158 private:
3159  // The type of basic IO manipulators (endl, ends, and flush) for
3160  // narrow streams.
3161  typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
3162
3163 public:
3164  // Constructs an empty Message.
3165  Message();
3166
3167  // Copy constructor.
3168  Message(const Message& msg) : ss_(new ::std::stringstream) {  // NOLINT
3169    *ss_ << msg.GetString();
3170  }
3171
3172  // Constructs a Message from a C-string.
3173  explicit Message(const char* str) : ss_(new ::std::stringstream) {
3174    *ss_ << str;
3175  }
3176
3177#if GTEST_OS_SYMBIAN
3178  // Streams a value (either a pointer or not) to this object.
3179  template <typename T>
3180  inline Message& operator <<(const T& value) {
3181    StreamHelper(typename internal::is_pointer<T>::type(), value);
3182    return *this;
3183  }
3184#else
3185  // Streams a non-pointer value to this object.
3186  template <typename T>
3187  inline Message& operator <<(const T& val) {
3188    // Some libraries overload << for STL containers.  These
3189    // overloads are defined in the global namespace instead of ::std.
3190    //
3191    // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
3192    // overloads are visible in either the std namespace or the global
3193    // namespace, but not other namespaces, including the testing
3194    // namespace which Google Test's Message class is in.
3195    //
3196    // To allow STL containers (and other types that has a << operator
3197    // defined in the global namespace) to be used in Google Test
3198    // assertions, testing::Message must access the custom << operator
3199    // from the global namespace.  With this using declaration,
3200    // overloads of << defined in the global namespace and those
3201    // visible via Koenig lookup are both exposed in this function.
3202    using ::operator <<;
3203    *ss_ << val;
3204    return *this;
3205  }
3206
3207  // Streams a pointer value to this object.
3208  //
3209  // This function is an overload of the previous one.  When you
3210  // stream a pointer to a Message, this definition will be used as it
3211  // is more specialized.  (The C++ Standard, section
3212  // [temp.func.order].)  If you stream a non-pointer, then the
3213  // previous definition will be used.
3214  //
3215  // The reason for this overload is that streaming a NULL pointer to
3216  // ostream is undefined behavior.  Depending on the compiler, you
3217  // may get "0", "(nil)", "(null)", or an access violation.  To
3218  // ensure consistent result across compilers, we always treat NULL
3219  // as "(null)".
3220  template <typename T>
3221  inline Message& operator <<(T* const& pointer) {  // NOLINT
3222    if (pointer == NULL) {
3223      *ss_ << "(null)";
3224    } else {
3225      *ss_ << pointer;
3226    }
3227    return *this;
3228  }
3229#endif  // GTEST_OS_SYMBIAN
3230
3231  // Since the basic IO manipulators are overloaded for both narrow
3232  // and wide streams, we have to provide this specialized definition
3233  // of operator <<, even though its body is the same as the
3234  // templatized version above.  Without this definition, streaming
3235  // endl or other basic IO manipulators to Message will confuse the
3236  // compiler.
3237  Message& operator <<(BasicNarrowIoManip val) {
3238    *ss_ << val;
3239    return *this;
3240  }
3241
3242  // Instead of 1/0, we want to see true/false for bool values.
3243  Message& operator <<(bool b) {
3244    return *this << (b ? "true" : "false");
3245  }
3246
3247  // These two overloads allow streaming a wide C string to a Message
3248  // using the UTF-8 encoding.
3249  Message& operator <<(const wchar_t* wide_c_str);
3250  Message& operator <<(wchar_t* wide_c_str);
3251
3252#if GTEST_HAS_STD_WSTRING
3253  // Converts the given wide string to a narrow string using the UTF-8
3254  // encoding, and streams the result to this Message object.
3255  Message& operator <<(const ::std::wstring& wstr);
3256#endif  // GTEST_HAS_STD_WSTRING
3257
3258#if GTEST_HAS_GLOBAL_WSTRING
3259  // Converts the given wide string to a narrow string using the UTF-8
3260  // encoding, and streams the result to this Message object.
3261  Message& operator <<(const ::wstring& wstr);
3262#endif  // GTEST_HAS_GLOBAL_WSTRING
3263
3264  // Gets the text streamed to this object so far as an std::string.
3265  // Each '\0' character in the buffer is replaced with "\\0".
3266  //
3267  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
3268  std::string GetString() const;
3269
3270 private:
3271
3272#if GTEST_OS_SYMBIAN
3273  // These are needed as the Nokia Symbian Compiler cannot decide between
3274  // const T& and const T* in a function template. The Nokia compiler _can_
3275  // decide between class template specializations for T and T*, so a
3276  // tr1::type_traits-like is_pointer works, and we can overload on that.
3277  template <typename T>
3278  inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
3279    if (pointer == NULL) {
3280      *ss_ << "(null)";
3281    } else {
3282      *ss_ << pointer;
3283    }
3284  }
3285  template <typename T>
3286  inline void StreamHelper(internal::false_type /*is_pointer*/,
3287                           const T& value) {
3288    // See the comments in Message& operator <<(const T&) above for why
3289    // we need this using statement.
3290    using ::operator <<;
3291    *ss_ << value;
3292  }
3293#endif  // GTEST_OS_SYMBIAN
3294
3295  // We'll hold the text streamed to this object here.
3296  const internal::scoped_ptr< ::std::stringstream> ss_;
3297
3298  // We declare (but don't implement) this to prevent the compiler
3299  // from implementing the assignment operator.
3300  void operator=(const Message&);
3301};
3302
3303// Streams a Message to an ostream.
3304inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
3305  return os << sb.GetString();
3306}
3307
3308namespace internal {
3309
3310// Converts a streamable value to an std::string.  A NULL pointer is
3311// converted to "(null)".  When the input value is a ::string,
3312// ::std::string, ::wstring, or ::std::wstring object, each NUL
3313// character in it is replaced with "\\0".
3314template <typename T>
3315std::string StreamableToString(const T& streamable) {
3316  return (Message() << streamable).GetString();
3317}
3318
3319}  // namespace internal
3320}  // namespace testing
3321
3322#endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3323// Copyright 2005, Google Inc.
3324// All rights reserved.
3325//
3326// Redistribution and use in source and binary forms, with or without
3327// modification, are permitted provided that the following conditions are
3328// met:
3329//
3330//     * Redistributions of source code must retain the above copyright
3331// notice, this list of conditions and the following disclaimer.
3332//     * Redistributions in binary form must reproduce the above
3333// copyright notice, this list of conditions and the following disclaimer
3334// in the documentation and/or other materials provided with the
3335// distribution.
3336//     * Neither the name of Google Inc. nor the names of its
3337// contributors may be used to endorse or promote products derived from
3338// this software without specific prior written permission.
3339//
3340// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3341// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3342// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3343// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3344// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3345// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3346// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3347// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3348// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3349// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3350// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3351//
3352// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
3353//
3354// The Google C++ Testing Framework (Google Test)
3355//
3356// This header file declares the String class and functions used internally by
3357// Google Test.  They are subject to change without notice. They should not used
3358// by code external to Google Test.
3359//
3360// This header file is #included by <gtest/internal/gtest-internal.h>.
3361// It should not be #included by other files.
3362
3363#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3364#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3365
3366#ifdef __BORLANDC__
3367// string.h is not guaranteed to provide strcpy on C++ Builder.
3368# include <mem.h>
3369#endif
3370
3371#include <string.h>
3372#include <string>
3373
3374
3375namespace testing {
3376namespace internal {
3377
3378// String - an abstract class holding static string utilities.
3379class GTEST_API_ String {
3380 public:
3381  // Static utility methods
3382
3383  // Clones a 0-terminated C string, allocating memory using new.  The
3384  // caller is responsible for deleting the return value using
3385  // delete[].  Returns the cloned string, or NULL if the input is
3386  // NULL.
3387  //
3388  // This is different from strdup() in string.h, which allocates
3389  // memory using malloc().
3390  static const char* CloneCString(const char* c_str);
3391
3392#if GTEST_OS_WINDOWS_MOBILE
3393  // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
3394  // able to pass strings to Win32 APIs on CE we need to convert them
3395  // to 'Unicode', UTF-16.
3396
3397  // Creates a UTF-16 wide string from the given ANSI string, allocating
3398  // memory using new. The caller is responsible for deleting the return
3399  // value using delete[]. Returns the wide string, or NULL if the
3400  // input is NULL.
3401  //
3402  // The wide string is created using the ANSI codepage (CP_ACP) to
3403  // match the behaviour of the ANSI versions of Win32 calls and the
3404  // C runtime.
3405  static LPCWSTR AnsiToUtf16(const char* c_str);
3406
3407  // Creates an ANSI string from the given wide string, allocating
3408  // memory using new. The caller is responsible for deleting the return
3409  // value using delete[]. Returns the ANSI string, or NULL if the
3410  // input is NULL.
3411  //
3412  // The returned string is created using the ANSI codepage (CP_ACP) to
3413  // match the behaviour of the ANSI versions of Win32 calls and the
3414  // C runtime.
3415  static const char* Utf16ToAnsi(LPCWSTR utf16_str);
3416#endif
3417
3418  // Compares two C strings.  Returns true iff they have the same content.
3419  //
3420  // Unlike strcmp(), this function can handle NULL argument(s).  A
3421  // NULL C string is considered different to any non-NULL C string,
3422  // including the empty string.
3423  static bool CStringEquals(const char* lhs, const char* rhs);
3424
3425  // Converts a wide C string to a String using the UTF-8 encoding.
3426  // NULL will be converted to "(null)".  If an error occurred during
3427  // the conversion, "(failed to convert from wide string)" is
3428  // returned.
3429  static std::string ShowWideCString(const wchar_t* wide_c_str);
3430
3431  // Compares two wide C strings.  Returns true iff they have the same
3432  // content.
3433  //
3434  // Unlike wcscmp(), this function can handle NULL argument(s).  A
3435  // NULL C string is considered different to any non-NULL C string,
3436  // including the empty string.
3437  static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
3438
3439  // Compares two C strings, ignoring case.  Returns true iff they
3440  // have the same content.
3441  //
3442  // Unlike strcasecmp(), this function can handle NULL argument(s).
3443  // A NULL C string is considered different to any non-NULL C string,
3444  // including the empty string.
3445  static bool CaseInsensitiveCStringEquals(const char* lhs,
3446                                           const char* rhs);
3447
3448  // Compares two wide C strings, ignoring case.  Returns true iff they
3449  // have the same content.
3450  //
3451  // Unlike wcscasecmp(), this function can handle NULL argument(s).
3452  // A NULL C string is considered different to any non-NULL wide C string,
3453  // including the empty string.
3454  // NB: The implementations on different platforms slightly differ.
3455  // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
3456  // environment variable. On GNU platform this method uses wcscasecmp
3457  // which compares according to LC_CTYPE category of the current locale.
3458  // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
3459  // current locale.
3460  static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
3461                                               const wchar_t* rhs);
3462
3463  // Returns true iff the given string ends with the given suffix, ignoring
3464  // case. Any string is considered to end with an empty suffix.
3465  static bool EndsWithCaseInsensitive(
3466      const std::string& str, const std::string& suffix);
3467
3468  // Formats an int value as "%02d".
3469  static std::string FormatIntWidth2(int value);  // "%02d" for width == 2
3470
3471  // Formats an int value as "%X".
3472  static std::string FormatHexInt(int value);
3473
3474  // Formats a byte as "%02X".
3475  static std::string FormatByte(unsigned char value);
3476
3477 private:
3478  String();  // Not meant to be instantiated.
3479};  // class String
3480
3481// Gets the content of the stringstream's buffer as an std::string.  Each '\0'
3482// character in the buffer is replaced with "\\0".
3483GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
3484
3485}  // namespace internal
3486}  // namespace testing
3487
3488#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3489// Copyright 2008, Google Inc.
3490// All rights reserved.
3491//
3492// Redistribution and use in source and binary forms, with or without
3493// modification, are permitted provided that the following conditions are
3494// met:
3495//
3496//     * Redistributions of source code must retain the above copyright
3497// notice, this list of conditions and the following disclaimer.
3498//     * Redistributions in binary form must reproduce the above
3499// copyright notice, this list of conditions and the following disclaimer
3500// in the documentation and/or other materials provided with the
3501// distribution.
3502//     * Neither the name of Google Inc. nor the names of its
3503// contributors may be used to endorse or promote products derived from
3504// this software without specific prior written permission.
3505//
3506// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3507// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3508// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3509// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3510// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3511// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3512// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3513// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3514// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3515// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3516// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3517//
3518// Author: keith.ray@gmail.com (Keith Ray)
3519//
3520// Google Test filepath utilities
3521//
3522// This header file declares classes and functions used internally by
3523// Google Test.  They are subject to change without notice.
3524//
3525// This file is #included in <gtest/internal/gtest-internal.h>.
3526// Do not include this header file separately!
3527
3528#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3529#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3530
3531
3532namespace testing {
3533namespace internal {
3534
3535// FilePath - a class for file and directory pathname manipulation which
3536// handles platform-specific conventions (like the pathname separator).
3537// Used for helper functions for naming files in a directory for xml output.
3538// Except for Set methods, all methods are const or static, which provides an
3539// "immutable value object" -- useful for peace of mind.
3540// A FilePath with a value ending in a path separator ("like/this/") represents
3541// a directory, otherwise it is assumed to represent a file. In either case,
3542// it may or may not represent an actual file or directory in the file system.
3543// Names are NOT checked for syntax correctness -- no checking for illegal
3544// characters, malformed paths, etc.
3545
3546class GTEST_API_ FilePath {
3547 public:
3548  FilePath() : pathname_("") { }
3549  FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
3550
3551  explicit FilePath(const std::string& pathname) : pathname_(pathname) {
3552    Normalize();
3553  }
3554
3555  FilePath& operator=(const FilePath& rhs) {
3556    Set(rhs);
3557    return *this;
3558  }
3559
3560  void Set(const FilePath& rhs) {
3561    pathname_ = rhs.pathname_;
3562  }
3563
3564  const std::string& string() const { return pathname_; }
3565  const char* c_str() const { return pathname_.c_str(); }
3566
3567  // Returns the current working directory, or "" if unsuccessful.
3568  static FilePath GetCurrentDir();
3569
3570  // Given directory = "dir", base_name = "test", number = 0,
3571  // extension = "xml", returns "dir/test.xml". If number is greater
3572  // than zero (e.g., 12), returns "dir/test_12.xml".
3573  // On Windows platform, uses \ as the separator rather than /.
3574  static FilePath MakeFileName(const FilePath& directory,
3575                               const FilePath& base_name,
3576                               int number,
3577                               const char* extension);
3578
3579  // Given directory = "dir", relative_path = "test.xml",
3580  // returns "dir/test.xml".
3581  // On Windows, uses \ as the separator rather than /.
3582  static FilePath ConcatPaths(const FilePath& directory,
3583                              const FilePath& relative_path);
3584
3585  // Returns a pathname for a file that does not currently exist. The pathname
3586  // will be directory/base_name.extension or
3587  // directory/base_name_<number>.extension if directory/base_name.extension
3588  // already exists. The number will be incremented until a pathname is found
3589  // that does not already exist.
3590  // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
3591  // There could be a race condition if two or more processes are calling this
3592  // function at the same time -- they could both pick the same filename.
3593  static FilePath GenerateUniqueFileName(const FilePath& directory,
3594                                         const FilePath& base_name,
3595                                         const char* extension);
3596
3597  // Returns true iff the path is "".
3598  bool IsEmpty() const { return pathname_.empty(); }
3599
3600  // If input name has a trailing separator character, removes it and returns
3601  // the name, otherwise return the name string unmodified.
3602  // On Windows platform, uses \ as the separator, other platforms use /.
3603  FilePath RemoveTrailingPathSeparator() const;
3604
3605  // Returns a copy of the FilePath with the directory part removed.
3606  // Example: FilePath("path/to/file").RemoveDirectoryName() returns
3607  // FilePath("file"). If there is no directory part ("just_a_file"), it returns
3608  // the FilePath unmodified. If there is no file part ("just_a_dir/") it
3609  // returns an empty FilePath ("").
3610  // On Windows platform, '\' is the path separator, otherwise it is '/'.
3611  FilePath RemoveDirectoryName() const;
3612
3613  // RemoveFileName returns the directory path with the filename removed.
3614  // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
3615  // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
3616  // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
3617  // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
3618  // On Windows platform, '\' is the path separator, otherwise it is '/'.
3619  FilePath RemoveFileName() const;
3620
3621  // Returns a copy of the FilePath with the case-insensitive extension removed.
3622  // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
3623  // FilePath("dir/file"). If a case-insensitive extension is not
3624  // found, returns a copy of the original FilePath.
3625  FilePath RemoveExtension(const char* extension) const;
3626
3627  // Creates directories so that path exists. Returns true if successful or if
3628  // the directories already exist; returns false if unable to create
3629  // directories for any reason. Will also return false if the FilePath does
3630  // not represent a directory (that is, it doesn't end with a path separator).
3631  bool CreateDirectoriesRecursively() const;
3632
3633  // Create the directory so that path exists. Returns true if successful or
3634  // if the directory already exists; returns false if unable to create the
3635  // directory for any reason, including if the parent directory does not
3636  // exist. Not named "CreateDirectory" because that's a macro on Windows.
3637  bool CreateFolder() const;
3638
3639  // Returns true if FilePath describes something in the file-system,
3640  // either a file, directory, or whatever, and that something exists.
3641  bool FileOrDirectoryExists() const;
3642
3643  // Returns true if pathname describes a directory in the file-system
3644  // that exists.
3645  bool DirectoryExists() const;
3646
3647  // Returns true if FilePath ends with a path separator, which indicates that
3648  // it is intended to represent a directory. Returns false otherwise.
3649  // This does NOT check that a directory (or file) actually exists.
3650  bool IsDirectory() const;
3651
3652  // Returns true if pathname describes a root directory. (Windows has one
3653  // root directory per disk drive.)
3654  bool IsRootDirectory() const;
3655
3656  // Returns true if pathname describes an absolute path.
3657  bool IsAbsolutePath() const;
3658
3659 private:
3660  // Replaces multiple consecutive separators with a single separator.
3661  // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
3662  // redundancies that might be in a pathname involving "." or "..".
3663  //
3664  // A pathname with multiple consecutive separators may occur either through
3665  // user error or as a result of some scripts or APIs that generate a pathname
3666  // with a trailing separator. On other platforms the same API or script
3667  // may NOT generate a pathname with a trailing "/". Then elsewhere that
3668  // pathname may have another "/" and pathname components added to it,
3669  // without checking for the separator already being there.
3670  // The script language and operating system may allow paths like "foo//bar"
3671  // but some of the functions in FilePath will not handle that correctly. In
3672  // particular, RemoveTrailingPathSeparator() only removes one separator, and
3673  // it is called in CreateDirectoriesRecursively() assuming that it will change
3674  // a pathname from directory syntax (trailing separator) to filename syntax.
3675  //
3676  // On Windows this method also replaces the alternate path separator '/' with
3677  // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
3678  // "bar\\foo".
3679
3680  void Normalize();
3681
3682  // Returns a pointer to the last occurence of a valid path separator in
3683  // the FilePath. On Windows, for example, both '/' and '\' are valid path
3684  // separators. Returns NULL if no path separator was found.
3685  const char* FindLastPathSeparator() const;
3686
3687  std::string pathname_;
3688};  // class FilePath
3689
3690}  // namespace internal
3691}  // namespace testing
3692
3693#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3694// This file was GENERATED by command:
3695//     pump.py gtest-type-util.h.pump
3696// DO NOT EDIT BY HAND!!!
3697
3698// Copyright 2008 Google Inc.
3699// All Rights Reserved.
3700//
3701// Redistribution and use in source and binary forms, with or without
3702// modification, are permitted provided that the following conditions are
3703// met:
3704//
3705//     * Redistributions of source code must retain the above copyright
3706// notice, this list of conditions and the following disclaimer.
3707//     * Redistributions in binary form must reproduce the above
3708// copyright notice, this list of conditions and the following disclaimer
3709// in the documentation and/or other materials provided with the
3710// distribution.
3711//     * Neither the name of Google Inc. nor the names of its
3712// contributors may be used to endorse or promote products derived from
3713// this software without specific prior written permission.
3714//
3715// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3716// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3717// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3718// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3719// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3720// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3721// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3722// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3723// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3724// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3725// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3726//
3727// Author: wan@google.com (Zhanyong Wan)
3728
3729// Type utilities needed for implementing typed and type-parameterized
3730// tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
3731//
3732// Currently we support at most 50 types in a list, and at most 50
3733// type-parameterized tests in one type-parameterized test case.
3734// Please contact googletestframework@googlegroups.com if you need
3735// more.
3736
3737#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3738#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3739
3740
3741// #ifdef __GNUC__ is too general here.  It is possible to use gcc without using
3742// libstdc++ (which is where cxxabi.h comes from).
3743# if GTEST_HAS_CXXABI_H_
3744#  include <cxxabi.h>
3745# elif defined(__HP_aCC)
3746#  include <acxx_demangle.h>
3747# endif  // GTEST_HASH_CXXABI_H_
3748
3749namespace testing {
3750namespace internal {
3751
3752// GetTypeName<T>() returns a human-readable name of type T.
3753// NB: This function is also used in Google Mock, so don't move it inside of
3754// the typed-test-only section below.
3755template <typename T>
3756std::string GetTypeName() {
3757# if GTEST_HAS_RTTI
3758
3759  const char* const name = typeid(T).name();
3760#  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
3761  int status = 0;
3762  // gcc's implementation of typeid(T).name() mangles the type name,
3763  // so we have to demangle it.
3764#   if GTEST_HAS_CXXABI_H_
3765  using abi::__cxa_demangle;
3766#   endif  // GTEST_HAS_CXXABI_H_
3767  char* const readable_name = __cxa_demangle(name, 0, 0, &status);
3768  const std::string name_str(status == 0 ? readable_name : name);
3769  free(readable_name);
3770  return name_str;
3771#  else
3772  return name;
3773#  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC
3774
3775# else
3776
3777  return "<type>";
3778
3779# endif  // GTEST_HAS_RTTI
3780}
3781
3782#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
3783
3784// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
3785// type.  This can be used as a compile-time assertion to ensure that
3786// two types are equal.
3787
3788template <typename T1, typename T2>
3789struct AssertTypeEq;
3790
3791template <typename T>
3792struct AssertTypeEq<T, T> {
3793  typedef bool type;
3794};
3795
3796// A unique type used as the default value for the arguments of class
3797// template Types.  This allows us to simulate variadic templates
3798// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
3799// support directly.
3800#undef None
3801struct None {};
3802
3803// The following family of struct and struct templates are used to
3804// represent type lists.  In particular, TypesN<T1, T2, ..., TN>
3805// represents a type list with N types (T1, T2, ..., and TN) in it.
3806// Except for Types0, every struct in the family has two member types:
3807// Head for the first type in the list, and Tail for the rest of the
3808// list.
3809
3810// The empty type list.
3811struct Types0 {};
3812
3813// Type lists of length 1, 2, 3, and so on.
3814
3815template <typename T1>
3816struct Types1 {
3817  typedef T1 Head;
3818  typedef Types0 Tail;
3819};
3820template <typename T1, typename T2>
3821struct Types2 {
3822  typedef T1 Head;
3823  typedef Types1<T2> Tail;
3824};
3825
3826template <typename T1, typename T2, typename T3>
3827struct Types3 {
3828  typedef T1 Head;
3829  typedef Types2<T2, T3> Tail;
3830};
3831
3832template <typename T1, typename T2, typename T3, typename T4>
3833struct Types4 {
3834  typedef T1 Head;
3835  typedef Types3<T2, T3, T4> Tail;
3836};
3837
3838template <typename T1, typename T2, typename T3, typename T4, typename T5>
3839struct Types5 {
3840  typedef T1 Head;
3841  typedef Types4<T2, T3, T4, T5> Tail;
3842};
3843
3844template <typename T1, typename T2, typename T3, typename T4, typename T5,
3845    typename T6>
3846struct Types6 {
3847  typedef T1 Head;
3848  typedef Types5<T2, T3, T4, T5, T6> Tail;
3849};
3850
3851template <typename T1, typename T2, typename T3, typename T4, typename T5,
3852    typename T6, typename T7>
3853struct Types7 {
3854  typedef T1 Head;
3855  typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
3856};
3857
3858template <typename T1, typename T2, typename T3, typename T4, typename T5,
3859    typename T6, typename T7, typename T8>
3860struct Types8 {
3861  typedef T1 Head;
3862  typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
3863};
3864
3865template <typename T1, typename T2, typename T3, typename T4, typename T5,
3866    typename T6, typename T7, typename T8, typename T9>
3867struct Types9 {
3868  typedef T1 Head;
3869  typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
3870};
3871
3872template <typename T1, typename T2, typename T3, typename T4, typename T5,
3873    typename T6, typename T7, typename T8, typename T9, typename T10>
3874struct Types10 {
3875  typedef T1 Head;
3876  typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
3877};
3878
3879template <typename T1, typename T2, typename T3, typename T4, typename T5,
3880    typename T6, typename T7, typename T8, typename T9, typename T10,
3881    typename T11>
3882struct Types11 {
3883  typedef T1 Head;
3884  typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
3885};
3886
3887template <typename T1, typename T2, typename T3, typename T4, typename T5,
3888    typename T6, typename T7, typename T8, typename T9, typename T10,
3889    typename T11, typename T12>
3890struct Types12 {
3891  typedef T1 Head;
3892  typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
3893};
3894
3895template <typename T1, typename T2, typename T3, typename T4, typename T5,
3896    typename T6, typename T7, typename T8, typename T9, typename T10,
3897    typename T11, typename T12, typename T13>
3898struct Types13 {
3899  typedef T1 Head;
3900  typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
3901};
3902
3903template <typename T1, typename T2, typename T3, typename T4, typename T5,
3904    typename T6, typename T7, typename T8, typename T9, typename T10,
3905    typename T11, typename T12, typename T13, typename T14>
3906struct Types14 {
3907  typedef T1 Head;
3908  typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
3909};
3910
3911template <typename T1, typename T2, typename T3, typename T4, typename T5,
3912    typename T6, typename T7, typename T8, typename T9, typename T10,
3913    typename T11, typename T12, typename T13, typename T14, typename T15>
3914struct Types15 {
3915  typedef T1 Head;
3916  typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
3917      T15> Tail;
3918};
3919
3920template <typename T1, typename T2, typename T3, typename T4, typename T5,
3921    typename T6, typename T7, typename T8, typename T9, typename T10,
3922    typename T11, typename T12, typename T13, typename T14, typename T15,
3923    typename T16>
3924struct Types16 {
3925  typedef T1 Head;
3926  typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3927      T16> Tail;
3928};
3929
3930template <typename T1, typename T2, typename T3, typename T4, typename T5,
3931    typename T6, typename T7, typename T8, typename T9, typename T10,
3932    typename T11, typename T12, typename T13, typename T14, typename T15,
3933    typename T16, typename T17>
3934struct Types17 {
3935  typedef T1 Head;
3936  typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3937      T16, T17> Tail;
3938};
3939
3940template <typename T1, typename T2, typename T3, typename T4, typename T5,
3941    typename T6, typename T7, typename T8, typename T9, typename T10,
3942    typename T11, typename T12, typename T13, typename T14, typename T15,
3943    typename T16, typename T17, typename T18>
3944struct Types18 {
3945  typedef T1 Head;
3946  typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3947      T16, T17, T18> Tail;
3948};
3949
3950template <typename T1, typename T2, typename T3, typename T4, typename T5,
3951    typename T6, typename T7, typename T8, typename T9, typename T10,
3952    typename T11, typename T12, typename T13, typename T14, typename T15,
3953    typename T16, typename T17, typename T18, typename T19>
3954struct Types19 {
3955  typedef T1 Head;
3956  typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3957      T16, T17, T18, T19> Tail;
3958};
3959
3960template <typename T1, typename T2, typename T3, typename T4, typename T5,
3961    typename T6, typename T7, typename T8, typename T9, typename T10,
3962    typename T11, typename T12, typename T13, typename T14, typename T15,
3963    typename T16, typename T17, typename T18, typename T19, typename T20>
3964struct Types20 {
3965  typedef T1 Head;
3966  typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3967      T16, T17, T18, T19, T20> Tail;
3968};
3969
3970template <typename T1, typename T2, typename T3, typename T4, typename T5,
3971    typename T6, typename T7, typename T8, typename T9, typename T10,
3972    typename T11, typename T12, typename T13, typename T14, typename T15,
3973    typename T16, typename T17, typename T18, typename T19, typename T20,
3974    typename T21>
3975struct Types21 {
3976  typedef T1 Head;
3977  typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3978      T16, T17, T18, T19, T20, T21> Tail;
3979};
3980
3981template <typename T1, typename T2, typename T3, typename T4, typename T5,
3982    typename T6, typename T7, typename T8, typename T9, typename T10,
3983    typename T11, typename T12, typename T13, typename T14, typename T15,
3984    typename T16, typename T17, typename T18, typename T19, typename T20,
3985    typename T21, typename T22>
3986struct Types22 {
3987  typedef T1 Head;
3988  typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3989      T16, T17, T18, T19, T20, T21, T22> Tail;
3990};
3991
3992template <typename T1, typename T2, typename T3, typename T4, typename T5,
3993    typename T6, typename T7, typename T8, typename T9, typename T10,
3994    typename T11, typename T12, typename T13, typename T14, typename T15,
3995    typename T16, typename T17, typename T18, typename T19, typename T20,
3996    typename T21, typename T22, typename T23>
3997struct Types23 {
3998  typedef T1 Head;
3999  typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4000      T16, T17, T18, T19, T20, T21, T22, T23> Tail;
4001};
4002
4003template <typename T1, typename T2, typename T3, typename T4, typename T5,
4004    typename T6, typename T7, typename T8, typename T9, typename T10,
4005    typename T11, typename T12, typename T13, typename T14, typename T15,
4006    typename T16, typename T17, typename T18, typename T19, typename T20,
4007    typename T21, typename T22, typename T23, typename T24>
4008struct Types24 {
4009  typedef T1 Head;
4010  typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4011      T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
4012};
4013
4014template <typename T1, typename T2, typename T3, typename T4, typename T5,
4015    typename T6, typename T7, typename T8, typename T9, typename T10,
4016    typename T11, typename T12, typename T13, typename T14, typename T15,
4017    typename T16, typename T17, typename T18, typename T19, typename T20,
4018    typename T21, typename T22, typename T23, typename T24, typename T25>
4019struct Types25 {
4020  typedef T1 Head;
4021  typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4022      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
4023};
4024
4025template <typename T1, typename T2, typename T3, typename T4, typename T5,
4026    typename T6, typename T7, typename T8, typename T9, typename T10,
4027    typename T11, typename T12, typename T13, typename T14, typename T15,
4028    typename T16, typename T17, typename T18, typename T19, typename T20,
4029    typename T21, typename T22, typename T23, typename T24, typename T25,
4030    typename T26>
4031struct Types26 {
4032  typedef T1 Head;
4033  typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4034      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
4035};
4036
4037template <typename T1, typename T2, typename T3, typename T4, typename T5,
4038    typename T6, typename T7, typename T8, typename T9, typename T10,
4039    typename T11, typename T12, typename T13, typename T14, typename T15,
4040    typename T16, typename T17, typename T18, typename T19, typename T20,
4041    typename T21, typename T22, typename T23, typename T24, typename T25,
4042    typename T26, typename T27>
4043struct Types27 {
4044  typedef T1 Head;
4045  typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4046      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
4047};
4048
4049template <typename T1, typename T2, typename T3, typename T4, typename T5,
4050    typename T6, typename T7, typename T8, typename T9, typename T10,
4051    typename T11, typename T12, typename T13, typename T14, typename T15,
4052    typename T16, typename T17, typename T18, typename T19, typename T20,
4053    typename T21, typename T22, typename T23, typename T24, typename T25,
4054    typename T26, typename T27, typename T28>
4055struct Types28 {
4056  typedef T1 Head;
4057  typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4058      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
4059};
4060
4061template <typename T1, typename T2, typename T3, typename T4, typename T5,
4062    typename T6, typename T7, typename T8, typename T9, typename T10,
4063    typename T11, typename T12, typename T13, typename T14, typename T15,
4064    typename T16, typename T17, typename T18, typename T19, typename T20,
4065    typename T21, typename T22, typename T23, typename T24, typename T25,
4066    typename T26, typename T27, typename T28, typename T29>
4067struct Types29 {
4068  typedef T1 Head;
4069  typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4070      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
4071      T29> Tail;
4072};
4073
4074template <typename T1, typename T2, typename T3, typename T4, typename T5,
4075    typename T6, typename T7, typename T8, typename T9, typename T10,
4076    typename T11, typename T12, typename T13, typename T14, typename T15,
4077    typename T16, typename T17, typename T18, typename T19, typename T20,
4078    typename T21, typename T22, typename T23, typename T24, typename T25,
4079    typename T26, typename T27, typename T28, typename T29, typename T30>
4080struct Types30 {
4081  typedef T1 Head;
4082  typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4083      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4084      T30> Tail;
4085};
4086
4087template <typename T1, typename T2, typename T3, typename T4, typename T5,
4088    typename T6, typename T7, typename T8, typename T9, typename T10,
4089    typename T11, typename T12, typename T13, typename T14, typename T15,
4090    typename T16, typename T17, typename T18, typename T19, typename T20,
4091    typename T21, typename T22, typename T23, typename T24, typename T25,
4092    typename T26, typename T27, typename T28, typename T29, typename T30,
4093    typename T31>
4094struct Types31 {
4095  typedef T1 Head;
4096  typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4097      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4098      T30, T31> Tail;
4099};
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, typename T15,
4104    typename T16, typename T17, typename T18, typename T19, typename T20,
4105    typename T21, typename T22, typename T23, typename T24, typename T25,
4106    typename T26, typename T27, typename T28, typename T29, typename T30,
4107    typename T31, typename T32>
4108struct Types32 {
4109  typedef T1 Head;
4110  typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4111      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4112      T30, T31, T32> Tail;
4113};
4114
4115template <typename T1, typename T2, typename T3, typename T4, typename T5,
4116    typename T6, typename T7, typename T8, typename T9, typename T10,
4117    typename T11, typename T12, typename T13, typename T14, typename T15,
4118    typename T16, typename T17, typename T18, typename T19, typename T20,
4119    typename T21, typename T22, typename T23, typename T24, typename T25,
4120    typename T26, typename T27, typename T28, typename T29, typename T30,
4121    typename T31, typename T32, typename T33>
4122struct Types33 {
4123  typedef T1 Head;
4124  typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4125      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4126      T30, T31, T32, T33> Tail;
4127};
4128
4129template <typename T1, typename T2, typename T3, typename T4, typename T5,
4130    typename T6, typename T7, typename T8, typename T9, typename T10,
4131    typename T11, typename T12, typename T13, typename T14, typename T15,
4132    typename T16, typename T17, typename T18, typename T19, typename T20,
4133    typename T21, typename T22, typename T23, typename T24, typename T25,
4134    typename T26, typename T27, typename T28, typename T29, typename T30,
4135    typename T31, typename T32, typename T33, typename T34>
4136struct Types34 {
4137  typedef T1 Head;
4138  typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4139      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4140      T30, T31, T32, T33, T34> Tail;
4141};
4142
4143template <typename T1, typename T2, typename T3, typename T4, typename T5,
4144    typename T6, typename T7, typename T8, typename T9, typename T10,
4145    typename T11, typename T12, typename T13, typename T14, typename T15,
4146    typename T16, typename T17, typename T18, typename T19, typename T20,
4147    typename T21, typename T22, typename T23, typename T24, typename T25,
4148    typename T26, typename T27, typename T28, typename T29, typename T30,
4149    typename T31, typename T32, typename T33, typename T34, typename T35>
4150struct Types35 {
4151  typedef T1 Head;
4152  typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4153      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4154      T30, T31, T32, T33, T34, T35> Tail;
4155};
4156
4157template <typename T1, typename T2, typename T3, typename T4, typename T5,
4158    typename T6, typename T7, typename T8, typename T9, typename T10,
4159    typename T11, typename T12, typename T13, typename T14, typename T15,
4160    typename T16, typename T17, typename T18, typename T19, typename T20,
4161    typename T21, typename T22, typename T23, typename T24, typename T25,
4162    typename T26, typename T27, typename T28, typename T29, typename T30,
4163    typename T31, typename T32, typename T33, typename T34, typename T35,
4164    typename T36>
4165struct Types36 {
4166  typedef T1 Head;
4167  typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4168      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4169      T30, T31, T32, T33, T34, T35, T36> Tail;
4170};
4171
4172template <typename T1, typename T2, typename T3, typename T4, typename T5,
4173    typename T6, typename T7, typename T8, typename T9, typename T10,
4174    typename T11, typename T12, typename T13, typename T14, typename T15,
4175    typename T16, typename T17, typename T18, typename T19, typename T20,
4176    typename T21, typename T22, typename T23, typename T24, typename T25,
4177    typename T26, typename T27, typename T28, typename T29, typename T30,
4178    typename T31, typename T32, typename T33, typename T34, typename T35,
4179    typename T36, typename T37>
4180struct Types37 {
4181  typedef T1 Head;
4182  typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4183      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4184      T30, T31, T32, T33, T34, T35, T36, T37> Tail;
4185};
4186
4187template <typename T1, typename T2, typename T3, typename T4, typename T5,
4188    typename T6, typename T7, typename T8, typename T9, typename T10,
4189    typename T11, typename T12, typename T13, typename T14, typename T15,
4190    typename T16, typename T17, typename T18, typename T19, typename T20,
4191    typename T21, typename T22, typename T23, typename T24, typename T25,
4192    typename T26, typename T27, typename T28, typename T29, typename T30,
4193    typename T31, typename T32, typename T33, typename T34, typename T35,
4194    typename T36, typename T37, typename T38>
4195struct Types38 {
4196  typedef T1 Head;
4197  typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4198      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4199      T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
4200};
4201
4202template <typename T1, typename T2, typename T3, typename T4, typename T5,
4203    typename T6, typename T7, typename T8, typename T9, typename T10,
4204    typename T11, typename T12, typename T13, typename T14, typename T15,
4205    typename T16, typename T17, typename T18, typename T19, typename T20,
4206    typename T21, typename T22, typename T23, typename T24, typename T25,
4207    typename T26, typename T27, typename T28, typename T29, typename T30,
4208    typename T31, typename T32, typename T33, typename T34, typename T35,
4209    typename T36, typename T37, typename T38, typename T39>
4210struct Types39 {
4211  typedef T1 Head;
4212  typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4213      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4214      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
4215};
4216
4217template <typename T1, typename T2, typename T3, typename T4, typename T5,
4218    typename T6, typename T7, typename T8, typename T9, typename T10,
4219    typename T11, typename T12, typename T13, typename T14, typename T15,
4220    typename T16, typename T17, typename T18, typename T19, typename T20,
4221    typename T21, typename T22, typename T23, typename T24, typename T25,
4222    typename T26, typename T27, typename T28, typename T29, typename T30,
4223    typename T31, typename T32, typename T33, typename T34, typename T35,
4224    typename T36, typename T37, typename T38, typename T39, typename T40>
4225struct Types40 {
4226  typedef T1 Head;
4227  typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4228      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4229      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
4230};
4231
4232template <typename T1, typename T2, typename T3, typename T4, typename T5,
4233    typename T6, typename T7, typename T8, typename T9, typename T10,
4234    typename T11, typename T12, typename T13, typename T14, typename T15,
4235    typename T16, typename T17, typename T18, typename T19, typename T20,
4236    typename T21, typename T22, typename T23, typename T24, typename T25,
4237    typename T26, typename T27, typename T28, typename T29, typename T30,
4238    typename T31, typename T32, typename T33, typename T34, typename T35,
4239    typename T36, typename T37, typename T38, typename T39, typename T40,
4240    typename T41>
4241struct Types41 {
4242  typedef T1 Head;
4243  typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4244      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4245      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
4246};
4247
4248template <typename T1, typename T2, typename T3, typename T4, typename T5,
4249    typename T6, typename T7, typename T8, typename T9, typename T10,
4250    typename T11, typename T12, typename T13, typename T14, typename T15,
4251    typename T16, typename T17, typename T18, typename T19, typename T20,
4252    typename T21, typename T22, typename T23, typename T24, typename T25,
4253    typename T26, typename T27, typename T28, typename T29, typename T30,
4254    typename T31, typename T32, typename T33, typename T34, typename T35,
4255    typename T36, typename T37, typename T38, typename T39, typename T40,
4256    typename T41, typename T42>
4257struct Types42 {
4258  typedef T1 Head;
4259  typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4260      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4261      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
4262};
4263
4264template <typename T1, typename T2, typename T3, typename T4, typename T5,
4265    typename T6, typename T7, typename T8, typename T9, typename T10,
4266    typename T11, typename T12, typename T13, typename T14, typename T15,
4267    typename T16, typename T17, typename T18, typename T19, typename T20,
4268    typename T21, typename T22, typename T23, typename T24, typename T25,
4269    typename T26, typename T27, typename T28, typename T29, typename T30,
4270    typename T31, typename T32, typename T33, typename T34, typename T35,
4271    typename T36, typename T37, typename T38, typename T39, typename T40,
4272    typename T41, typename T42, typename T43>
4273struct Types43 {
4274  typedef T1 Head;
4275  typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4276      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4277      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
4278      T43> Tail;
4279};
4280
4281template <typename T1, typename T2, typename T3, typename T4, typename T5,
4282    typename T6, typename T7, typename T8, typename T9, typename T10,
4283    typename T11, typename T12, typename T13, typename T14, typename T15,
4284    typename T16, typename T17, typename T18, typename T19, typename T20,
4285    typename T21, typename T22, typename T23, typename T24, typename T25,
4286    typename T26, typename T27, typename T28, typename T29, typename T30,
4287    typename T31, typename T32, typename T33, typename T34, typename T35,
4288    typename T36, typename T37, typename T38, typename T39, typename T40,
4289    typename T41, typename T42, typename T43, typename T44>
4290struct Types44 {
4291  typedef T1 Head;
4292  typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4293      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4294      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4295      T44> Tail;
4296};
4297
4298template <typename T1, typename T2, typename T3, typename T4, typename T5,
4299    typename T6, typename T7, typename T8, typename T9, typename T10,
4300    typename T11, typename T12, typename T13, typename T14, typename T15,
4301    typename T16, typename T17, typename T18, typename T19, typename T20,
4302    typename T21, typename T22, typename T23, typename T24, typename T25,
4303    typename T26, typename T27, typename T28, typename T29, typename T30,
4304    typename T31, typename T32, typename T33, typename T34, typename T35,
4305    typename T36, typename T37, typename T38, typename T39, typename T40,
4306    typename T41, typename T42, typename T43, typename T44, typename T45>
4307struct Types45 {
4308  typedef T1 Head;
4309  typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4310      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4311      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4312      T44, T45> Tail;
4313};
4314
4315template <typename T1, typename T2, typename T3, typename T4, typename T5,
4316    typename T6, typename T7, typename T8, typename T9, typename T10,
4317    typename T11, typename T12, typename T13, typename T14, typename T15,
4318    typename T16, typename T17, typename T18, typename T19, typename T20,
4319    typename T21, typename T22, typename T23, typename T24, typename T25,
4320    typename T26, typename T27, typename T28, typename T29, typename T30,
4321    typename T31, typename T32, typename T33, typename T34, typename T35,
4322    typename T36, typename T37, typename T38, typename T39, typename T40,
4323    typename T41, typename T42, typename T43, typename T44, typename T45,
4324    typename T46>
4325struct Types46 {
4326  typedef T1 Head;
4327  typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4328      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4329      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4330      T44, T45, T46> Tail;
4331};
4332
4333template <typename T1, typename T2, typename T3, typename T4, typename T5,
4334    typename T6, typename T7, typename T8, typename T9, typename T10,
4335    typename T11, typename T12, typename T13, typename T14, typename T15,
4336    typename T16, typename T17, typename T18, typename T19, typename T20,
4337    typename T21, typename T22, typename T23, typename T24, typename T25,
4338    typename T26, typename T27, typename T28, typename T29, typename T30,
4339    typename T31, typename T32, typename T33, typename T34, typename T35,
4340    typename T36, typename T37, typename T38, typename T39, typename T40,
4341    typename T41, typename T42, typename T43, typename T44, typename T45,
4342    typename T46, typename T47>
4343struct Types47 {
4344  typedef T1 Head;
4345  typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4346      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4347      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4348      T44, T45, T46, T47> Tail;
4349};
4350
4351template <typename T1, typename T2, typename T3, typename T4, typename T5,
4352    typename T6, typename T7, typename T8, typename T9, typename T10,
4353    typename T11, typename T12, typename T13, typename T14, typename T15,
4354    typename T16, typename T17, typename T18, typename T19, typename T20,
4355    typename T21, typename T22, typename T23, typename T24, typename T25,
4356    typename T26, typename T27, typename T28, typename T29, typename T30,
4357    typename T31, typename T32, typename T33, typename T34, typename T35,
4358    typename T36, typename T37, typename T38, typename T39, typename T40,
4359    typename T41, typename T42, typename T43, typename T44, typename T45,
4360    typename T46, typename T47, typename T48>
4361struct Types48 {
4362  typedef T1 Head;
4363  typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4364      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4365      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4366      T44, T45, T46, T47, T48> Tail;
4367};
4368
4369template <typename T1, typename T2, typename T3, typename T4, typename T5,
4370    typename T6, typename T7, typename T8, typename T9, typename T10,
4371    typename T11, typename T12, typename T13, typename T14, typename T15,
4372    typename T16, typename T17, typename T18, typename T19, typename T20,
4373    typename T21, typename T22, typename T23, typename T24, typename T25,
4374    typename T26, typename T27, typename T28, typename T29, typename T30,
4375    typename T31, typename T32, typename T33, typename T34, typename T35,
4376    typename T36, typename T37, typename T38, typename T39, typename T40,
4377    typename T41, typename T42, typename T43, typename T44, typename T45,
4378    typename T46, typename T47, typename T48, typename T49>
4379struct Types49 {
4380  typedef T1 Head;
4381  typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4382      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4383      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4384      T44, T45, T46, T47, T48, T49> Tail;
4385};
4386
4387template <typename T1, typename T2, typename T3, typename T4, typename T5,
4388    typename T6, typename T7, typename T8, typename T9, typename T10,
4389    typename T11, typename T12, typename T13, typename T14, typename T15,
4390    typename T16, typename T17, typename T18, typename T19, typename T20,
4391    typename T21, typename T22, typename T23, typename T24, typename T25,
4392    typename T26, typename T27, typename T28, typename T29, typename T30,
4393    typename T31, typename T32, typename T33, typename T34, typename T35,
4394    typename T36, typename T37, typename T38, typename T39, typename T40,
4395    typename T41, typename T42, typename T43, typename T44, typename T45,
4396    typename T46, typename T47, typename T48, typename T49, typename T50>
4397struct Types50 {
4398  typedef T1 Head;
4399  typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4400      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4401      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4402      T44, T45, T46, T47, T48, T49, T50> Tail;
4403};
4404
4405
4406}  // namespace internal
4407
4408// We don't want to require the users to write TypesN<...> directly,
4409// as that would require them to count the length.  Types<...> is much
4410// easier to write, but generates horrible messages when there is a
4411// compiler error, as gcc insists on printing out each template
4412// argument, even if it has the default value (this means Types<int>
4413// will appear as Types<int, None, None, ..., None> in the compiler
4414// errors).
4415//
4416// Our solution is to combine the best part of the two approaches: a
4417// user would write Types<T1, ..., TN>, and Google Test will translate
4418// that to TypesN<T1, ..., TN> internally to make error messages
4419// readable.  The translation is done by the 'type' member of the
4420// Types template.
4421template <typename T1 = internal::None, typename T2 = internal::None,
4422    typename T3 = internal::None, typename T4 = internal::None,
4423    typename T5 = internal::None, typename T6 = internal::None,
4424    typename T7 = internal::None, typename T8 = internal::None,
4425    typename T9 = internal::None, typename T10 = internal::None,
4426    typename T11 = internal::None, typename T12 = internal::None,
4427    typename T13 = internal::None, typename T14 = internal::None,
4428    typename T15 = internal::None, typename T16 = internal::None,
4429    typename T17 = internal::None, typename T18 = internal::None,
4430    typename T19 = internal::None, typename T20 = internal::None,
4431    typename T21 = internal::None, typename T22 = internal::None,
4432    typename T23 = internal::None, typename T24 = internal::None,
4433    typename T25 = internal::None, typename T26 = internal::None,
4434    typename T27 = internal::None, typename T28 = internal::None,
4435    typename T29 = internal::None, typename T30 = internal::None,
4436    typename T31 = internal::None, typename T32 = internal::None,
4437    typename T33 = internal::None, typename T34 = internal::None,
4438    typename T35 = internal::None, typename T36 = internal::None,
4439    typename T37 = internal::None, typename T38 = internal::None,
4440    typename T39 = internal::None, typename T40 = internal::None,
4441    typename T41 = internal::None, typename T42 = internal::None,
4442    typename T43 = internal::None, typename T44 = internal::None,
4443    typename T45 = internal::None, typename T46 = internal::None,
4444    typename T47 = internal::None, typename T48 = internal::None,
4445    typename T49 = internal::None, typename T50 = internal::None>
4446struct Types {
4447  typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4448      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4449      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4450      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
4451};
4452
4453template <>
4454struct Types<internal::None, internal::None, internal::None, internal::None,
4455    internal::None, internal::None, internal::None, internal::None,
4456    internal::None, internal::None, internal::None, internal::None,
4457    internal::None, internal::None, internal::None, internal::None,
4458    internal::None, internal::None, internal::None, internal::None,
4459    internal::None, internal::None, internal::None, internal::None,
4460    internal::None, internal::None, internal::None, internal::None,
4461    internal::None, internal::None, internal::None, internal::None,
4462    internal::None, internal::None, internal::None, internal::None,
4463    internal::None, internal::None, internal::None, internal::None,
4464    internal::None, internal::None, internal::None, internal::None,
4465    internal::None, internal::None, internal::None, internal::None,
4466    internal::None, internal::None> {
4467  typedef internal::Types0 type;
4468};
4469template <typename T1>
4470struct Types<T1, 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    internal::None, internal::None, internal::None, internal::None,
4475    internal::None, internal::None, internal::None, internal::None,
4476    internal::None, internal::None, internal::None, internal::None,
4477    internal::None, internal::None, internal::None, internal::None,
4478    internal::None, internal::None, internal::None, internal::None,
4479    internal::None, internal::None, internal::None, internal::None,
4480    internal::None, internal::None, internal::None, internal::None,
4481    internal::None, internal::None, internal::None, internal::None,
4482    internal::None, internal::None> {
4483  typedef internal::Types1<T1> type;
4484};
4485template <typename T1, typename T2>
4486struct Types<T1, T2, internal::None, internal::None, internal::None,
4487    internal::None, internal::None, internal::None, internal::None,
4488    internal::None, internal::None, 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    internal::None, internal::None, internal::None, internal::None,
4493    internal::None, internal::None, internal::None, internal::None,
4494    internal::None, internal::None, internal::None, internal::None,
4495    internal::None, internal::None, internal::None, internal::None,
4496    internal::None, internal::None, internal::None, internal::None,
4497    internal::None, internal::None, internal::None, internal::None,
4498    internal::None> {
4499  typedef internal::Types2<T1, T2> type;
4500};
4501template <typename T1, typename T2, typename T3>
4502struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
4503    internal::None, internal::None, internal::None, internal::None,
4504    internal::None, internal::None, internal::None, internal::None,
4505    internal::None, internal::None, internal::None, internal::None,
4506    internal::None, internal::None, 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, internal::None,
4510    internal::None, internal::None, internal::None, internal::None,
4511    internal::None, internal::None, internal::None, internal::None,
4512    internal::None, internal::None, internal::None, internal::None,
4513    internal::None, internal::None, internal::None, internal::None> {
4514  typedef internal::Types3<T1, T2, T3> type;
4515};
4516template <typename T1, typename T2, typename T3, typename T4>
4517struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
4518    internal::None, internal::None, internal::None, internal::None,
4519    internal::None, internal::None, internal::None, internal::None,
4520    internal::None, internal::None, internal::None, internal::None,
4521    internal::None, internal::None, internal::None, internal::None,
4522    internal::None, internal::None, internal::None, internal::None,
4523    internal::None, internal::None, internal::None, internal::None,
4524    internal::None, internal::None, 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, internal::None, internal::None,
4528    internal::None, internal::None, internal::None> {
4529  typedef internal::Types4<T1, T2, T3, T4> type;
4530};
4531template <typename T1, typename T2, typename T3, typename T4, typename T5>
4532struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
4533    internal::None, internal::None, internal::None, internal::None,
4534    internal::None, internal::None, internal::None, internal::None,
4535    internal::None, internal::None, internal::None, internal::None,
4536    internal::None, internal::None, internal::None, internal::None,
4537    internal::None, internal::None, internal::None, internal::None,
4538    internal::None, internal::None, internal::None, internal::None,
4539    internal::None, internal::None, internal::None, internal::None,
4540    internal::None, internal::None, internal::None, internal::None,
4541    internal::None, internal::None, internal::None, internal::None,
4542    internal::None, internal::None, internal::None, internal::None,
4543    internal::None, internal::None, internal::None> {
4544  typedef internal::Types5<T1, T2, T3, T4, T5> type;
4545};
4546template <typename T1, typename T2, typename T3, typename T4, typename T5,
4547    typename T6>
4548struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
4549    internal::None, internal::None, internal::None, internal::None,
4550    internal::None, internal::None, internal::None, internal::None,
4551    internal::None, internal::None, internal::None, internal::None,
4552    internal::None, internal::None, internal::None, internal::None,
4553    internal::None, internal::None, internal::None, internal::None,
4554    internal::None, internal::None, internal::None, internal::None,
4555    internal::None, internal::None, internal::None, internal::None,
4556    internal::None, internal::None, internal::None, internal::None,
4557    internal::None, internal::None, internal::None, internal::None,
4558    internal::None, internal::None, internal::None, internal::None,
4559    internal::None, internal::None> {
4560  typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
4561};
4562template <typename T1, typename T2, typename T3, typename T4, typename T5,
4563    typename T6, typename T7>
4564struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
4565    internal::None, internal::None, internal::None, internal::None,
4566    internal::None, internal::None, internal::None, internal::None,
4567    internal::None, internal::None, internal::None, internal::None,
4568    internal::None, internal::None, internal::None, internal::None,
4569    internal::None, internal::None, internal::None, internal::None,
4570    internal::None, internal::None, internal::None, internal::None,
4571    internal::None, internal::None, internal::None, internal::None,
4572    internal::None, internal::None, internal::None, internal::None,
4573    internal::None, internal::None, internal::None, internal::None,
4574    internal::None, internal::None, internal::None, internal::None,
4575    internal::None> {
4576  typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
4577};
4578template <typename T1, typename T2, typename T3, typename T4, typename T5,
4579    typename T6, typename T7, typename T8>
4580struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
4581    internal::None, internal::None, internal::None, internal::None,
4582    internal::None, internal::None, internal::None, internal::None,
4583    internal::None, internal::None, internal::None, internal::None,
4584    internal::None, internal::None, internal::None, internal::None,
4585    internal::None, internal::None, internal::None, internal::None,
4586    internal::None, internal::None, internal::None, internal::None,
4587    internal::None, internal::None, internal::None, internal::None,
4588    internal::None, internal::None, internal::None, internal::None,
4589    internal::None, internal::None, internal::None, internal::None,
4590    internal::None, internal::None, internal::None, internal::None> {
4591  typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
4592};
4593template <typename T1, typename T2, typename T3, typename T4, typename T5,
4594    typename T6, typename T7, typename T8, typename T9>
4595struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
4596    internal::None, internal::None, internal::None, internal::None,
4597    internal::None, internal::None, internal::None, internal::None,
4598    internal::None, internal::None, internal::None, internal::None,
4599    internal::None, internal::None, internal::None, internal::None,
4600    internal::None, internal::None, internal::None, internal::None,
4601    internal::None, internal::None, internal::None, internal::None,
4602    internal::None, internal::None, internal::None, internal::None,
4603    internal::None, internal::None, internal::None, internal::None,
4604    internal::None, internal::None, internal::None, internal::None,
4605    internal::None, internal::None, internal::None, internal::None> {
4606  typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
4607};
4608template <typename T1, typename T2, typename T3, typename T4, typename T5,
4609    typename T6, typename T7, typename T8, typename T9, typename T10>
4610struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
4611    internal::None, internal::None, internal::None, internal::None,
4612    internal::None, internal::None, internal::None, internal::None,
4613    internal::None, internal::None, internal::None, internal::None,
4614    internal::None, internal::None, internal::None, internal::None,
4615    internal::None, internal::None, internal::None, internal::None,
4616    internal::None, internal::None, internal::None, internal::None,
4617    internal::None, internal::None, internal::None, internal::None,
4618    internal::None, internal::None, internal::None, internal::None,
4619    internal::None, internal::None, internal::None, internal::None,
4620    internal::None, internal::None, internal::None> {
4621  typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
4622};
4623template <typename T1, typename T2, typename T3, typename T4, typename T5,
4624    typename T6, typename T7, typename T8, typename T9, typename T10,
4625    typename T11>
4626struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
4627    internal::None, internal::None, internal::None, internal::None,
4628    internal::None, internal::None, internal::None, internal::None,
4629    internal::None, internal::None, internal::None, internal::None,
4630    internal::None, internal::None, internal::None, internal::None,
4631    internal::None, internal::None, internal::None, internal::None,
4632    internal::None, internal::None, internal::None, internal::None,
4633    internal::None, internal::None, internal::None, internal::None,
4634    internal::None, internal::None, internal::None, internal::None,
4635    internal::None, internal::None, internal::None, internal::None,
4636    internal::None, internal::None> {
4637  typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
4638};
4639template <typename T1, typename T2, typename T3, typename T4, typename T5,
4640    typename T6, typename T7, typename T8, typename T9, typename T10,
4641    typename T11, typename T12>
4642struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
4643    internal::None, internal::None, internal::None, internal::None,
4644    internal::None, internal::None, internal::None, internal::None,
4645    internal::None, internal::None, internal::None, internal::None,
4646    internal::None, internal::None, internal::None, internal::None,
4647    internal::None, internal::None, internal::None, internal::None,
4648    internal::None, internal::None, internal::None, internal::None,
4649    internal::None, internal::None, internal::None, internal::None,
4650    internal::None, internal::None, internal::None, internal::None,
4651    internal::None, internal::None, internal::None, internal::None,
4652    internal::None> {
4653  typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
4654      T12> type;
4655};
4656template <typename T1, typename T2, typename T3, typename T4, typename T5,
4657    typename T6, typename T7, typename T8, typename T9, typename T10,
4658    typename T11, typename T12, typename T13>
4659struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
4660    internal::None, internal::None, internal::None, internal::None,
4661    internal::None, internal::None, internal::None, internal::None,
4662    internal::None, internal::None, internal::None, internal::None,
4663    internal::None, internal::None, internal::None, internal::None,
4664    internal::None, internal::None, internal::None, internal::None,
4665    internal::None, internal::None, internal::None, internal::None,
4666    internal::None, internal::None, internal::None, internal::None,
4667    internal::None, internal::None, internal::None, internal::None,
4668    internal::None, internal::None, internal::None, internal::None,
4669    internal::None> {
4670  typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4671      T13> type;
4672};
4673template <typename T1, typename T2, typename T3, typename T4, typename T5,
4674    typename T6, typename T7, typename T8, typename T9, typename T10,
4675    typename T11, typename T12, typename T13, typename T14>
4676struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4677    internal::None, internal::None, internal::None, internal::None,
4678    internal::None, internal::None, internal::None, internal::None,
4679    internal::None, internal::None, internal::None, internal::None,
4680    internal::None, internal::None, internal::None, internal::None,
4681    internal::None, internal::None, internal::None, internal::None,
4682    internal::None, internal::None, internal::None, internal::None,
4683    internal::None, internal::None, internal::None, internal::None,
4684    internal::None, internal::None, internal::None, internal::None,
4685    internal::None, internal::None, internal::None, internal::None> {
4686  typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4687      T13, T14> type;
4688};
4689template <typename T1, typename T2, typename T3, typename T4, typename T5,
4690    typename T6, typename T7, typename T8, typename T9, typename T10,
4691    typename T11, typename T12, typename T13, typename T14, typename T15>
4692struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4693    internal::None, internal::None, internal::None, internal::None,
4694    internal::None, internal::None, internal::None, internal::None,
4695    internal::None, internal::None, internal::None, internal::None,
4696    internal::None, internal::None, internal::None, internal::None,
4697    internal::None, internal::None, internal::None, internal::None,
4698    internal::None, internal::None, internal::None, internal::None,
4699    internal::None, internal::None, internal::None, internal::None,
4700    internal::None, internal::None, internal::None, internal::None,
4701    internal::None, internal::None, internal::None> {
4702  typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4703      T13, T14, T15> type;
4704};
4705template <typename T1, typename T2, typename T3, typename T4, typename T5,
4706    typename T6, typename T7, typename T8, typename T9, typename T10,
4707    typename T11, typename T12, typename T13, typename T14, typename T15,
4708    typename T16>
4709struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4710    T16, internal::None, internal::None, internal::None, internal::None,
4711    internal::None, internal::None, internal::None, internal::None,
4712    internal::None, internal::None, internal::None, internal::None,
4713    internal::None, internal::None, internal::None, internal::None,
4714    internal::None, internal::None, internal::None, internal::None,
4715    internal::None, internal::None, internal::None, internal::None,
4716    internal::None, internal::None, internal::None, internal::None,
4717    internal::None, internal::None, internal::None, internal::None,
4718    internal::None, internal::None> {
4719  typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4720      T13, T14, T15, T16> type;
4721};
4722template <typename T1, typename T2, typename T3, typename T4, typename T5,
4723    typename T6, typename T7, typename T8, typename T9, typename T10,
4724    typename T11, typename T12, typename T13, typename T14, typename T15,
4725    typename T16, typename T17>
4726struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4727    T16, T17, internal::None, internal::None, internal::None, internal::None,
4728    internal::None, internal::None, internal::None, internal::None,
4729    internal::None, internal::None, internal::None, internal::None,
4730    internal::None, internal::None, internal::None, internal::None,
4731    internal::None, internal::None, internal::None, internal::None,
4732    internal::None, internal::None, internal::None, internal::None,
4733    internal::None, internal::None, internal::None, internal::None,
4734    internal::None, internal::None, internal::None, internal::None,
4735    internal::None> {
4736  typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4737      T13, T14, T15, T16, T17> type;
4738};
4739template <typename T1, typename T2, typename T3, typename T4, typename T5,
4740    typename T6, typename T7, typename T8, typename T9, typename T10,
4741    typename T11, typename T12, typename T13, typename T14, typename T15,
4742    typename T16, typename T17, typename T18>
4743struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4744    T16, T17, T18, internal::None, internal::None, internal::None,
4745    internal::None, internal::None, internal::None, internal::None,
4746    internal::None, internal::None, internal::None, internal::None,
4747    internal::None, internal::None, internal::None, internal::None,
4748    internal::None, internal::None, internal::None, internal::None,
4749    internal::None, internal::None, internal::None, internal::None,
4750    internal::None, internal::None, internal::None, internal::None,
4751    internal::None, internal::None, internal::None, internal::None,
4752    internal::None> {
4753  typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4754      T13, T14, T15, T16, T17, T18> type;
4755};
4756template <typename T1, typename T2, typename T3, typename T4, typename T5,
4757    typename T6, typename T7, typename T8, typename T9, typename T10,
4758    typename T11, typename T12, typename T13, typename T14, typename T15,
4759    typename T16, typename T17, typename T18, typename T19>
4760struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4761    T16, T17, T18, T19, internal::None, internal::None, internal::None,
4762    internal::None, internal::None, internal::None, internal::None,
4763    internal::None, internal::None, internal::None, internal::None,
4764    internal::None, internal::None, internal::None, internal::None,
4765    internal::None, internal::None, internal::None, internal::None,
4766    internal::None, internal::None, internal::None, internal::None,
4767    internal::None, internal::None, internal::None, internal::None,
4768    internal::None, internal::None, internal::None, internal::None> {
4769  typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4770      T13, T14, T15, T16, T17, T18, T19> type;
4771};
4772template <typename T1, typename T2, typename T3, typename T4, typename T5,
4773    typename T6, typename T7, typename T8, typename T9, typename T10,
4774    typename T11, typename T12, typename T13, typename T14, typename T15,
4775    typename T16, typename T17, typename T18, typename T19, typename T20>
4776struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4777    T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
4778    internal::None, internal::None, internal::None, internal::None,
4779    internal::None, internal::None, internal::None, internal::None,
4780    internal::None, internal::None, internal::None, internal::None,
4781    internal::None, internal::None, internal::None, internal::None,
4782    internal::None, internal::None, internal::None, internal::None,
4783    internal::None, internal::None, internal::None, internal::None,
4784    internal::None, internal::None, internal::None> {
4785  typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4786      T13, T14, T15, T16, T17, T18, T19, T20> type;
4787};
4788template <typename T1, typename T2, typename T3, typename T4, typename T5,
4789    typename T6, typename T7, typename T8, typename T9, typename T10,
4790    typename T11, typename T12, typename T13, typename T14, typename T15,
4791    typename T16, typename T17, typename T18, typename T19, typename T20,
4792    typename T21>
4793struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4794    T16, T17, T18, T19, T20, T21, internal::None, internal::None,
4795    internal::None, internal::None, internal::None, internal::None,
4796    internal::None, internal::None, internal::None, internal::None,
4797    internal::None, internal::None, internal::None, internal::None,
4798    internal::None, internal::None, internal::None, internal::None,
4799    internal::None, internal::None, internal::None, internal::None,
4800    internal::None, internal::None, internal::None, internal::None,
4801    internal::None, internal::None, internal::None> {
4802  typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4803      T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
4804};
4805template <typename T1, typename T2, typename T3, typename T4, typename T5,
4806    typename T6, typename T7, typename T8, typename T9, typename T10,
4807    typename T11, typename T12, typename T13, typename T14, typename T15,
4808    typename T16, typename T17, typename T18, typename T19, typename T20,
4809    typename T21, typename T22>
4810struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4811    T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
4812    internal::None, internal::None, internal::None, internal::None,
4813    internal::None, internal::None, internal::None, internal::None,
4814    internal::None, internal::None, internal::None, internal::None,
4815    internal::None, internal::None, internal::None, internal::None,
4816    internal::None, internal::None, internal::None, internal::None,
4817    internal::None, internal::None, internal::None, internal::None,
4818    internal::None, internal::None> {
4819  typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4820      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
4821};
4822template <typename T1, typename T2, typename T3, typename T4, typename T5,
4823    typename T6, typename T7, typename T8, typename T9, typename T10,
4824    typename T11, typename T12, typename T13, typename T14, typename T15,
4825    typename T16, typename T17, typename T18, typename T19, typename T20,
4826    typename T21, typename T22, typename T23>
4827struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4828    T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
4829    internal::None, internal::None, internal::None, internal::None,
4830    internal::None, internal::None, internal::None, internal::None,
4831    internal::None, internal::None, internal::None, internal::None,
4832    internal::None, internal::None, internal::None, internal::None,
4833    internal::None, internal::None, internal::None, internal::None,
4834    internal::None, internal::None, internal::None, internal::None,
4835    internal::None> {
4836  typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4837      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
4838};
4839template <typename T1, typename T2, typename T3, typename T4, typename T5,
4840    typename T6, typename T7, typename T8, typename T9, typename T10,
4841    typename T11, typename T12, typename T13, typename T14, typename T15,
4842    typename T16, typename T17, typename T18, typename T19, typename T20,
4843    typename T21, typename T22, typename T23, typename T24>
4844struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4845    T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
4846    internal::None, internal::None, internal::None, internal::None,
4847    internal::None, internal::None, internal::None, internal::None,
4848    internal::None, internal::None, internal::None, internal::None,
4849    internal::None, internal::None, internal::None, internal::None,
4850    internal::None, internal::None, internal::None, internal::None,
4851    internal::None, internal::None, internal::None, internal::None,
4852    internal::None> {
4853  typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4854      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
4855};
4856template <typename T1, typename T2, typename T3, typename T4, typename T5,
4857    typename T6, typename T7, typename T8, typename T9, typename T10,
4858    typename T11, typename T12, typename T13, typename T14, typename T15,
4859    typename T16, typename T17, typename T18, typename T19, typename T20,
4860    typename T21, typename T22, typename T23, typename T24, typename T25>
4861struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4862    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
4863    internal::None, internal::None, internal::None, internal::None,
4864    internal::None, internal::None, internal::None, internal::None,
4865    internal::None, internal::None, internal::None, internal::None,
4866    internal::None, internal::None, internal::None, internal::None,
4867    internal::None, internal::None, internal::None, internal::None,
4868    internal::None, internal::None, internal::None, internal::None> {
4869  typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4870      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
4871};
4872template <typename T1, typename T2, typename T3, typename T4, typename T5,
4873    typename T6, typename T7, typename T8, typename T9, typename T10,
4874    typename T11, typename T12, typename T13, typename T14, typename T15,
4875    typename T16, typename T17, typename T18, typename T19, typename T20,
4876    typename T21, typename T22, typename T23, typename T24, typename T25,
4877    typename T26>
4878struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4879    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
4880    internal::None, internal::None, internal::None, internal::None,
4881    internal::None, internal::None, internal::None, internal::None,
4882    internal::None, internal::None, internal::None, internal::None,
4883    internal::None, internal::None, internal::None, internal::None,
4884    internal::None, internal::None, internal::None, internal::None,
4885    internal::None, internal::None, internal::None> {
4886  typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4887      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
4888      T26> type;
4889};
4890template <typename T1, typename T2, typename T3, typename T4, typename T5,
4891    typename T6, typename T7, typename T8, typename T9, typename T10,
4892    typename T11, typename T12, typename T13, typename T14, typename T15,
4893    typename T16, typename T17, typename T18, typename T19, typename T20,
4894    typename T21, typename T22, typename T23, typename T24, typename T25,
4895    typename T26, typename T27>
4896struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4897    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
4898    internal::None, internal::None, internal::None, internal::None,
4899    internal::None, internal::None, internal::None, internal::None,
4900    internal::None, internal::None, internal::None, internal::None,
4901    internal::None, internal::None, internal::None, internal::None,
4902    internal::None, internal::None, internal::None, internal::None,
4903    internal::None, internal::None> {
4904  typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4905      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4906      T27> type;
4907};
4908template <typename T1, typename T2, typename T3, typename T4, typename T5,
4909    typename T6, typename T7, typename T8, typename T9, typename T10,
4910    typename T11, typename T12, typename T13, typename T14, typename T15,
4911    typename T16, typename T17, typename T18, typename T19, typename T20,
4912    typename T21, typename T22, typename T23, typename T24, typename T25,
4913    typename T26, typename T27, typename T28>
4914struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4915    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
4916    internal::None, internal::None, internal::None, internal::None,
4917    internal::None, internal::None, internal::None, internal::None,
4918    internal::None, internal::None, internal::None, internal::None,
4919    internal::None, internal::None, internal::None, internal::None,
4920    internal::None, internal::None, internal::None, internal::None,
4921    internal::None, internal::None> {
4922  typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4923      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4924      T27, T28> type;
4925};
4926template <typename T1, typename T2, typename T3, typename T4, typename T5,
4927    typename T6, typename T7, typename T8, typename T9, typename T10,
4928    typename T11, typename T12, typename T13, typename T14, typename T15,
4929    typename T16, typename T17, typename T18, typename T19, typename T20,
4930    typename T21, typename T22, typename T23, typename T24, typename T25,
4931    typename T26, typename T27, typename T28, typename T29>
4932struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4933    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4934    internal::None, internal::None, internal::None, internal::None,
4935    internal::None, internal::None, internal::None, internal::None,
4936    internal::None, internal::None, internal::None, internal::None,
4937    internal::None, internal::None, internal::None, internal::None,
4938    internal::None, internal::None, internal::None, internal::None,
4939    internal::None> {
4940  typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4941      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4942      T27, T28, T29> type;
4943};
4944template <typename T1, typename T2, typename T3, typename T4, typename T5,
4945    typename T6, typename T7, typename T8, typename T9, typename T10,
4946    typename T11, typename T12, typename T13, typename T14, typename T15,
4947    typename T16, typename T17, typename T18, typename T19, typename T20,
4948    typename T21, typename T22, typename T23, typename T24, typename T25,
4949    typename T26, typename T27, typename T28, typename T29, typename T30>
4950struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4951    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4952    internal::None, internal::None, internal::None, internal::None,
4953    internal::None, internal::None, internal::None, internal::None,
4954    internal::None, internal::None, internal::None, internal::None,
4955    internal::None, internal::None, internal::None, internal::None,
4956    internal::None, internal::None, internal::None, internal::None> {
4957  typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4958      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4959      T27, T28, T29, T30> type;
4960};
4961template <typename T1, typename T2, typename T3, typename T4, typename T5,
4962    typename T6, typename T7, typename T8, typename T9, typename T10,
4963    typename T11, typename T12, typename T13, typename T14, typename T15,
4964    typename T16, typename T17, typename T18, typename T19, typename T20,
4965    typename T21, typename T22, typename T23, typename T24, typename T25,
4966    typename T26, typename T27, typename T28, typename T29, typename T30,
4967    typename T31>
4968struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4969    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4970    T31, internal::None, internal::None, internal::None, internal::None,
4971    internal::None, internal::None, internal::None, internal::None,
4972    internal::None, internal::None, internal::None, internal::None,
4973    internal::None, internal::None, internal::None, internal::None,
4974    internal::None, internal::None, internal::None> {
4975  typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4976      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4977      T27, T28, T29, T30, T31> type;
4978};
4979template <typename T1, typename T2, typename T3, typename T4, typename T5,
4980    typename T6, typename T7, typename T8, typename T9, typename T10,
4981    typename T11, typename T12, typename T13, typename T14, typename T15,
4982    typename T16, typename T17, typename T18, typename T19, typename T20,
4983    typename T21, typename T22, typename T23, typename T24, typename T25,
4984    typename T26, typename T27, typename T28, typename T29, typename T30,
4985    typename T31, typename T32>
4986struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4987    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4988    T31, T32, internal::None, internal::None, internal::None, internal::None,
4989    internal::None, internal::None, internal::None, internal::None,
4990    internal::None, internal::None, internal::None, internal::None,
4991    internal::None, internal::None, internal::None, internal::None,
4992    internal::None, internal::None> {
4993  typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4994      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4995      T27, T28, T29, T30, T31, T32> type;
4996};
4997template <typename T1, typename T2, typename T3, typename T4, typename T5,
4998    typename T6, typename T7, typename T8, typename T9, typename T10,
4999    typename T11, typename T12, typename T13, typename T14, typename T15,
5000    typename T16, typename T17, typename T18, typename T19, typename T20,
5001    typename T21, typename T22, typename T23, typename T24, typename T25,
5002    typename T26, typename T27, typename T28, typename T29, typename T30,
5003    typename T31, typename T32, typename T33>
5004struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5005    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5006    T31, T32, T33, internal::None, internal::None, internal::None,
5007    internal::None, internal::None, internal::None, internal::None,
5008    internal::None, internal::None, internal::None, internal::None,
5009    internal::None, internal::None, internal::None, internal::None,
5010    internal::None, internal::None> {
5011  typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5012      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5013      T27, T28, T29, T30, T31, T32, T33> type;
5014};
5015template <typename T1, typename T2, typename T3, typename T4, typename T5,
5016    typename T6, typename T7, typename T8, typename T9, typename T10,
5017    typename T11, typename T12, typename T13, typename T14, typename T15,
5018    typename T16, typename T17, typename T18, typename T19, typename T20,
5019    typename T21, typename T22, typename T23, typename T24, typename T25,
5020    typename T26, typename T27, typename T28, typename T29, typename T30,
5021    typename T31, typename T32, typename T33, typename T34>
5022struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5023    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5024    T31, T32, T33, T34, internal::None, internal::None, internal::None,
5025    internal::None, internal::None, internal::None, internal::None,
5026    internal::None, internal::None, internal::None, internal::None,
5027    internal::None, internal::None, internal::None, internal::None,
5028    internal::None> {
5029  typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5030      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5031      T27, T28, T29, T30, T31, T32, T33, T34> type;
5032};
5033template <typename T1, typename T2, typename T3, typename T4, typename T5,
5034    typename T6, typename T7, typename T8, typename T9, typename T10,
5035    typename T11, typename T12, typename T13, typename T14, typename T15,
5036    typename T16, typename T17, typename T18, typename T19, typename T20,
5037    typename T21, typename T22, typename T23, typename T24, typename T25,
5038    typename T26, typename T27, typename T28, typename T29, typename T30,
5039    typename T31, typename T32, typename T33, typename T34, typename T35>
5040struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5041    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5042    T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
5043    internal::None, internal::None, internal::None, internal::None,
5044    internal::None, internal::None, internal::None, internal::None,
5045    internal::None, internal::None, internal::None, internal::None> {
5046  typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5047      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5048      T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
5049};
5050template <typename T1, typename T2, typename T3, typename T4, typename T5,
5051    typename T6, typename T7, typename T8, typename T9, typename T10,
5052    typename T11, typename T12, typename T13, typename T14, typename T15,
5053    typename T16, typename T17, typename T18, typename T19, typename T20,
5054    typename T21, typename T22, typename T23, typename T24, typename T25,
5055    typename T26, typename T27, typename T28, typename T29, typename T30,
5056    typename T31, typename T32, typename T33, typename T34, typename T35,
5057    typename T36>
5058struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5059    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5060    T31, T32, T33, T34, T35, T36, internal::None, internal::None,
5061    internal::None, internal::None, internal::None, internal::None,
5062    internal::None, internal::None, internal::None, internal::None,
5063    internal::None, internal::None, internal::None, internal::None> {
5064  typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5065      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5066      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
5067};
5068template <typename T1, typename T2, typename T3, typename T4, typename T5,
5069    typename T6, typename T7, typename T8, typename T9, typename T10,
5070    typename T11, typename T12, typename T13, typename T14, typename T15,
5071    typename T16, typename T17, typename T18, typename T19, typename T20,
5072    typename T21, typename T22, typename T23, typename T24, typename T25,
5073    typename T26, typename T27, typename T28, typename T29, typename T30,
5074    typename T31, typename T32, typename T33, typename T34, typename T35,
5075    typename T36, typename T37>
5076struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5077    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5078    T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
5079    internal::None, internal::None, internal::None, internal::None,
5080    internal::None, internal::None, internal::None, internal::None,
5081    internal::None, internal::None, internal::None> {
5082  typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5083      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5084      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
5085};
5086template <typename T1, typename T2, typename T3, typename T4, typename T5,
5087    typename T6, typename T7, typename T8, typename T9, typename T10,
5088    typename T11, typename T12, typename T13, typename T14, typename T15,
5089    typename T16, typename T17, typename T18, typename T19, typename T20,
5090    typename T21, typename T22, typename T23, typename T24, typename T25,
5091    typename T26, typename T27, typename T28, typename T29, typename T30,
5092    typename T31, typename T32, typename T33, typename T34, typename T35,
5093    typename T36, typename T37, typename T38>
5094struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5095    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5096    T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
5097    internal::None, internal::None, internal::None, internal::None,
5098    internal::None, internal::None, internal::None, internal::None,
5099    internal::None, internal::None> {
5100  typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5101      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5102      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
5103};
5104template <typename T1, typename T2, typename T3, typename T4, typename T5,
5105    typename T6, typename T7, typename T8, typename T9, typename T10,
5106    typename T11, typename T12, typename T13, typename T14, typename T15,
5107    typename T16, typename T17, typename T18, typename T19, typename T20,
5108    typename T21, typename T22, typename T23, typename T24, typename T25,
5109    typename T26, typename T27, typename T28, typename T29, typename T30,
5110    typename T31, typename T32, typename T33, typename T34, typename T35,
5111    typename T36, typename T37, typename T38, typename T39>
5112struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5113    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5114    T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
5115    internal::None, internal::None, internal::None, internal::None,
5116    internal::None, internal::None, internal::None, internal::None,
5117    internal::None, internal::None> {
5118  typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5119      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5120      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
5121};
5122template <typename T1, typename T2, typename T3, typename T4, typename T5,
5123    typename T6, typename T7, typename T8, typename T9, typename T10,
5124    typename T11, typename T12, typename T13, typename T14, typename T15,
5125    typename T16, typename T17, typename T18, typename T19, typename T20,
5126    typename T21, typename T22, typename T23, typename T24, typename T25,
5127    typename T26, typename T27, typename T28, typename T29, typename T30,
5128    typename T31, typename T32, typename T33, typename T34, typename T35,
5129    typename T36, typename T37, typename T38, typename T39, typename T40>
5130struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5131    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5132    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
5133    internal::None, internal::None, internal::None, internal::None,
5134    internal::None, internal::None, internal::None, internal::None,
5135    internal::None> {
5136  typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5137      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5138      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
5139      T40> type;
5140};
5141template <typename T1, typename T2, typename T3, typename T4, typename T5,
5142    typename T6, typename T7, typename T8, typename T9, typename T10,
5143    typename T11, typename T12, typename T13, typename T14, typename T15,
5144    typename T16, typename T17, typename T18, typename T19, typename T20,
5145    typename T21, typename T22, typename T23, typename T24, typename T25,
5146    typename T26, typename T27, typename T28, typename T29, typename T30,
5147    typename T31, typename T32, typename T33, typename T34, typename T35,
5148    typename T36, typename T37, typename T38, typename T39, typename T40,
5149    typename T41>
5150struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5151    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5152    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
5153    internal::None, internal::None, internal::None, internal::None,
5154    internal::None, internal::None, internal::None, internal::None> {
5155  typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5156      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5157      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5158      T41> type;
5159};
5160template <typename T1, typename T2, typename T3, typename T4, typename T5,
5161    typename T6, typename T7, typename T8, typename T9, typename T10,
5162    typename T11, typename T12, typename T13, typename T14, typename T15,
5163    typename T16, typename T17, typename T18, typename T19, typename T20,
5164    typename T21, typename T22, typename T23, typename T24, typename T25,
5165    typename T26, typename T27, typename T28, typename T29, typename T30,
5166    typename T31, typename T32, typename T33, typename T34, typename T35,
5167    typename T36, typename T37, typename T38, typename T39, typename T40,
5168    typename T41, typename T42>
5169struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5170    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5171    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
5172    internal::None, internal::None, internal::None, internal::None,
5173    internal::None, internal::None, internal::None> {
5174  typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5175      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5176      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5177      T41, T42> type;
5178};
5179template <typename T1, typename T2, typename T3, typename T4, typename T5,
5180    typename T6, typename T7, typename T8, typename T9, typename T10,
5181    typename T11, typename T12, typename T13, typename T14, typename T15,
5182    typename T16, typename T17, typename T18, typename T19, typename T20,
5183    typename T21, typename T22, typename T23, typename T24, typename T25,
5184    typename T26, typename T27, typename T28, typename T29, typename T30,
5185    typename T31, typename T32, typename T33, typename T34, typename T35,
5186    typename T36, typename T37, typename T38, typename T39, typename T40,
5187    typename T41, typename T42, typename T43>
5188struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5189    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5190    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5191    internal::None, internal::None, internal::None, internal::None,
5192    internal::None, internal::None, internal::None> {
5193  typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5194      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5195      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5196      T41, T42, T43> type;
5197};
5198template <typename T1, typename T2, typename T3, typename T4, typename T5,
5199    typename T6, typename T7, typename T8, typename T9, typename T10,
5200    typename T11, typename T12, typename T13, typename T14, typename T15,
5201    typename T16, typename T17, typename T18, typename T19, typename T20,
5202    typename T21, typename T22, typename T23, typename T24, typename T25,
5203    typename T26, typename T27, typename T28, typename T29, typename T30,
5204    typename T31, typename T32, typename T33, typename T34, typename T35,
5205    typename T36, typename T37, typename T38, typename T39, typename T40,
5206    typename T41, typename T42, typename T43, typename T44>
5207struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5208    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5209    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
5210    internal::None, internal::None, internal::None, internal::None,
5211    internal::None, internal::None> {
5212  typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5213      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5214      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5215      T41, T42, T43, T44> type;
5216};
5217template <typename T1, typename T2, typename T3, typename T4, typename T5,
5218    typename T6, typename T7, typename T8, typename T9, typename T10,
5219    typename T11, typename T12, typename T13, typename T14, typename T15,
5220    typename T16, typename T17, typename T18, typename T19, typename T20,
5221    typename T21, typename T22, typename T23, typename T24, typename T25,
5222    typename T26, typename T27, typename T28, typename T29, typename T30,
5223    typename T31, typename T32, typename T33, typename T34, typename T35,
5224    typename T36, typename T37, typename T38, typename T39, typename T40,
5225    typename T41, typename T42, typename T43, typename T44, typename T45>
5226struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5227    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5228    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5229    internal::None, internal::None, internal::None, internal::None,
5230    internal::None> {
5231  typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5232      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5233      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5234      T41, T42, T43, T44, T45> type;
5235};
5236template <typename T1, typename T2, typename T3, typename T4, typename T5,
5237    typename T6, typename T7, typename T8, typename T9, typename T10,
5238    typename T11, typename T12, typename T13, typename T14, typename T15,
5239    typename T16, typename T17, typename T18, typename T19, typename T20,
5240    typename T21, typename T22, typename T23, typename T24, typename T25,
5241    typename T26, typename T27, typename T28, typename T29, typename T30,
5242    typename T31, typename T32, typename T33, typename T34, typename T35,
5243    typename T36, typename T37, typename T38, typename T39, typename T40,
5244    typename T41, typename T42, typename T43, typename T44, typename T45,
5245    typename T46>
5246struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5247    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5248    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5249    T46, internal::None, internal::None, internal::None, internal::None> {
5250  typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5251      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5252      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5253      T41, T42, T43, T44, T45, T46> type;
5254};
5255template <typename T1, typename T2, typename T3, typename T4, typename T5,
5256    typename T6, typename T7, typename T8, typename T9, typename T10,
5257    typename T11, typename T12, typename T13, typename T14, typename T15,
5258    typename T16, typename T17, typename T18, typename T19, typename T20,
5259    typename T21, typename T22, typename T23, typename T24, typename T25,
5260    typename T26, typename T27, typename T28, typename T29, typename T30,
5261    typename T31, typename T32, typename T33, typename T34, typename T35,
5262    typename T36, typename T37, typename T38, typename T39, typename T40,
5263    typename T41, typename T42, typename T43, typename T44, typename T45,
5264    typename T46, typename T47>
5265struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5266    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5267    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5268    T46, T47, internal::None, internal::None, internal::None> {
5269  typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5270      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5271      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5272      T41, T42, T43, T44, T45, T46, T47> type;
5273};
5274template <typename T1, typename T2, typename T3, typename T4, typename T5,
5275    typename T6, typename T7, typename T8, typename T9, typename T10,
5276    typename T11, typename T12, typename T13, typename T14, typename T15,
5277    typename T16, typename T17, typename T18, typename T19, typename T20,
5278    typename T21, typename T22, typename T23, typename T24, typename T25,
5279    typename T26, typename T27, typename T28, typename T29, typename T30,
5280    typename T31, typename T32, typename T33, typename T34, typename T35,
5281    typename T36, typename T37, typename T38, typename T39, typename T40,
5282    typename T41, typename T42, typename T43, typename T44, typename T45,
5283    typename T46, typename T47, typename T48>
5284struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5285    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5286    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5287    T46, T47, T48, internal::None, internal::None> {
5288  typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5289      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5290      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5291      T41, T42, T43, T44, T45, T46, T47, T48> type;
5292};
5293template <typename T1, typename T2, typename T3, typename T4, typename T5,
5294    typename T6, typename T7, typename T8, typename T9, typename T10,
5295    typename T11, typename T12, typename T13, typename T14, typename T15,
5296    typename T16, typename T17, typename T18, typename T19, typename T20,
5297    typename T21, typename T22, typename T23, typename T24, typename T25,
5298    typename T26, typename T27, typename T28, typename T29, typename T30,
5299    typename T31, typename T32, typename T33, typename T34, typename T35,
5300    typename T36, typename T37, typename T38, typename T39, typename T40,
5301    typename T41, typename T42, typename T43, typename T44, typename T45,
5302    typename T46, typename T47, typename T48, typename T49>
5303struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5304    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5305    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5306    T46, T47, T48, T49, internal::None> {
5307  typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5308      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5309      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5310      T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
5311};
5312
5313namespace internal {
5314
5315# define GTEST_TEMPLATE_ template <typename T> class
5316
5317// The template "selector" struct TemplateSel<Tmpl> is used to
5318// represent Tmpl, which must be a class template with one type
5319// parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined
5320// as the type Tmpl<T>.  This allows us to actually instantiate the
5321// template "selected" by TemplateSel<Tmpl>.
5322//
5323// This trick is necessary for simulating typedef for class templates,
5324// which C++ doesn't support directly.
5325template <GTEST_TEMPLATE_ Tmpl>
5326struct TemplateSel {
5327  template <typename T>
5328  struct Bind {
5329    typedef Tmpl<T> type;
5330  };
5331};
5332
5333# define GTEST_BIND_(TmplSel, T) \
5334  TmplSel::template Bind<T>::type
5335
5336// A unique struct template used as the default value for the
5337// arguments of class template Templates.  This allows us to simulate
5338// variadic templates (e.g. Templates<int>, Templates<int, double>,
5339// and etc), which C++ doesn't support directly.
5340template <typename T>
5341struct NoneT {};
5342
5343// The following family of struct and struct templates are used to
5344// represent template lists.  In particular, TemplatesN<T1, T2, ...,
5345// TN> represents a list of N templates (T1, T2, ..., and TN).  Except
5346// for Templates0, every struct in the family has two member types:
5347// Head for the selector of the first template in the list, and Tail
5348// for the rest of the list.
5349
5350// The empty template list.
5351struct Templates0 {};
5352
5353// Template lists of length 1, 2, 3, and so on.
5354
5355template <GTEST_TEMPLATE_ T1>
5356struct Templates1 {
5357  typedef TemplateSel<T1> Head;
5358  typedef Templates0 Tail;
5359};
5360template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
5361struct Templates2 {
5362  typedef TemplateSel<T1> Head;
5363  typedef Templates1<T2> Tail;
5364};
5365
5366template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
5367struct Templates3 {
5368  typedef TemplateSel<T1> Head;
5369  typedef Templates2<T2, T3> Tail;
5370};
5371
5372template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5373    GTEST_TEMPLATE_ T4>
5374struct Templates4 {
5375  typedef TemplateSel<T1> Head;
5376  typedef Templates3<T2, T3, T4> Tail;
5377};
5378
5379template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5380    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
5381struct Templates5 {
5382  typedef TemplateSel<T1> Head;
5383  typedef Templates4<T2, T3, T4, T5> Tail;
5384};
5385
5386template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5387    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
5388struct Templates6 {
5389  typedef TemplateSel<T1> Head;
5390  typedef Templates5<T2, T3, T4, T5, T6> Tail;
5391};
5392
5393template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5394    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5395    GTEST_TEMPLATE_ T7>
5396struct Templates7 {
5397  typedef TemplateSel<T1> Head;
5398  typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
5399};
5400
5401template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5402    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5403    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
5404struct Templates8 {
5405  typedef TemplateSel<T1> Head;
5406  typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
5407};
5408
5409template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5410    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5411    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
5412struct Templates9 {
5413  typedef TemplateSel<T1> Head;
5414  typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
5415};
5416
5417template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5418    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5419    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5420    GTEST_TEMPLATE_ T10>
5421struct Templates10 {
5422  typedef TemplateSel<T1> Head;
5423  typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
5424};
5425
5426template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5427    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5428    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5429    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
5430struct Templates11 {
5431  typedef TemplateSel<T1> Head;
5432  typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
5433};
5434
5435template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5436    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5437    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5438    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
5439struct Templates12 {
5440  typedef TemplateSel<T1> Head;
5441  typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
5442};
5443
5444template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5445    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5446    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5447    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5448    GTEST_TEMPLATE_ T13>
5449struct Templates13 {
5450  typedef TemplateSel<T1> Head;
5451  typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
5452};
5453
5454template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5455    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5456    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5457    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5458    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
5459struct Templates14 {
5460  typedef TemplateSel<T1> Head;
5461  typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5462      T14> Tail;
5463};
5464
5465template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5466    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5467    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5468    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5469    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
5470struct Templates15 {
5471  typedef TemplateSel<T1> Head;
5472  typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5473      T15> Tail;
5474};
5475
5476template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5477    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5478    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5479    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5480    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5481    GTEST_TEMPLATE_ T16>
5482struct Templates16 {
5483  typedef TemplateSel<T1> Head;
5484  typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5485      T15, T16> Tail;
5486};
5487
5488template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5489    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5490    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5491    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5492    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5493    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
5494struct Templates17 {
5495  typedef TemplateSel<T1> Head;
5496  typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5497      T15, T16, T17> Tail;
5498};
5499
5500template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5501    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5502    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5503    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5504    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5505    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
5506struct Templates18 {
5507  typedef TemplateSel<T1> Head;
5508  typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5509      T15, T16, T17, T18> Tail;
5510};
5511
5512template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5513    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5514    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5515    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5516    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5517    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5518    GTEST_TEMPLATE_ T19>
5519struct Templates19 {
5520  typedef TemplateSel<T1> Head;
5521  typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5522      T15, T16, T17, T18, T19> Tail;
5523};
5524
5525template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5526    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5527    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5528    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5529    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5530    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5531    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
5532struct Templates20 {
5533  typedef TemplateSel<T1> Head;
5534  typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5535      T15, T16, T17, T18, T19, T20> Tail;
5536};
5537
5538template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5539    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5540    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5541    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5542    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5543    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5544    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
5545struct Templates21 {
5546  typedef TemplateSel<T1> Head;
5547  typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5548      T15, T16, T17, T18, T19, T20, T21> Tail;
5549};
5550
5551template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5552    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5553    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5554    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5555    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5556    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5557    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5558    GTEST_TEMPLATE_ T22>
5559struct Templates22 {
5560  typedef TemplateSel<T1> Head;
5561  typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5562      T15, T16, T17, T18, T19, T20, T21, T22> Tail;
5563};
5564
5565template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5566    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5567    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5568    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5569    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5570    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5571    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5572    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
5573struct Templates23 {
5574  typedef TemplateSel<T1> Head;
5575  typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5576      T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
5577};
5578
5579template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5580    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5581    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5582    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5583    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5584    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5585    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5586    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
5587struct Templates24 {
5588  typedef TemplateSel<T1> Head;
5589  typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5590      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
5591};
5592
5593template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5594    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5595    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5596    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5597    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5598    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5599    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5600    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5601    GTEST_TEMPLATE_ T25>
5602struct Templates25 {
5603  typedef TemplateSel<T1> Head;
5604  typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5605      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
5606};
5607
5608template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5609    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5610    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5611    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5612    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5613    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5614    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5615    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5616    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
5617struct Templates26 {
5618  typedef TemplateSel<T1> Head;
5619  typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5620      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
5621};
5622
5623template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5624    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5625    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5626    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5627    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5628    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5629    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5630    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5631    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
5632struct Templates27 {
5633  typedef TemplateSel<T1> Head;
5634  typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5635      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
5636};
5637
5638template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5639    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5640    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5641    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5642    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5643    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5644    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5645    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5646    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5647    GTEST_TEMPLATE_ T28>
5648struct Templates28 {
5649  typedef TemplateSel<T1> Head;
5650  typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5651      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5652      T28> Tail;
5653};
5654
5655template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5656    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5657    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5658    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5659    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5660    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5661    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5662    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5663    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5664    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
5665struct Templates29 {
5666  typedef TemplateSel<T1> Head;
5667  typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5668      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5669      T29> Tail;
5670};
5671
5672template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5673    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5674    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5675    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5676    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5677    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5678    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5679    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5680    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5681    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
5682struct Templates30 {
5683  typedef TemplateSel<T1> Head;
5684  typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5685      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5686      T29, T30> Tail;
5687};
5688
5689template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5690    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5691    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5692    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5693    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5694    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5695    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5696    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5697    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5698    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5699    GTEST_TEMPLATE_ T31>
5700struct Templates31 {
5701  typedef TemplateSel<T1> Head;
5702  typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5703      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5704      T29, T30, T31> Tail;
5705};
5706
5707template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5708    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5709    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5710    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5711    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5712    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5713    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5714    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5715    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5716    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5717    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
5718struct Templates32 {
5719  typedef TemplateSel<T1> Head;
5720  typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5721      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5722      T29, T30, T31, T32> Tail;
5723};
5724
5725template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5726    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5727    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5728    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5729    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5730    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5731    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5732    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5733    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5734    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5735    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
5736struct Templates33 {
5737  typedef TemplateSel<T1> Head;
5738  typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5739      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5740      T29, T30, T31, T32, T33> Tail;
5741};
5742
5743template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5744    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5745    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5746    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5747    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5748    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5749    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5750    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5751    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5752    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5753    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5754    GTEST_TEMPLATE_ T34>
5755struct Templates34 {
5756  typedef TemplateSel<T1> Head;
5757  typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5758      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5759      T29, T30, T31, T32, T33, T34> Tail;
5760};
5761
5762template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5763    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5764    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5765    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5766    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5767    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5768    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5769    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5770    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5771    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5772    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5773    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
5774struct Templates35 {
5775  typedef TemplateSel<T1> Head;
5776  typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5777      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5778      T29, T30, T31, T32, T33, T34, T35> Tail;
5779};
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,
5787    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5788    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5789    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5790    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5791    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5792    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
5793struct Templates36 {
5794  typedef TemplateSel<T1> Head;
5795  typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5796      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5797      T29, T30, T31, T32, T33, T34, T35, T36> Tail;
5798};
5799
5800template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5801    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5802    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5803    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5804    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5805    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5806    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5807    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5808    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5809    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5810    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5811    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5812    GTEST_TEMPLATE_ T37>
5813struct Templates37 {
5814  typedef TemplateSel<T1> Head;
5815  typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5816      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5817      T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
5818};
5819
5820template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5821    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5822    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5823    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5824    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5825    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5826    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5827    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5828    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5829    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5830    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5831    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5832    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
5833struct Templates38 {
5834  typedef TemplateSel<T1> Head;
5835  typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5836      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5837      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
5838};
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, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5848    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5849    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5850    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5851    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5852    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
5853struct Templates39 {
5854  typedef TemplateSel<T1> Head;
5855  typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5856      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5857      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
5858};
5859
5860template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5861    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5862    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5863    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5864    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5865    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5866    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5867    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5868    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5869    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5870    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5871    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5872    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5873    GTEST_TEMPLATE_ T40>
5874struct Templates40 {
5875  typedef TemplateSel<T1> Head;
5876  typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5877      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5878      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
5879};
5880
5881template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5882    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5883    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5884    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5885    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5886    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5887    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5888    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5889    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5890    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5891    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5892    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5893    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5894    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
5895struct Templates41 {
5896  typedef TemplateSel<T1> Head;
5897  typedef Templates40<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, T26, T27, T28,
5899      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
5900};
5901
5902template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5903    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5904    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5905    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5906    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5907    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5908    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5909    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5910    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5911    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5912    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5913    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5914    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5915    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
5916struct Templates42 {
5917  typedef TemplateSel<T1> Head;
5918  typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5919      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5920      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
5921      T42> Tail;
5922};
5923
5924template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5925    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5926    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5927    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5928    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5929    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5930    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5931    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5932    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5933    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5934    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5935    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5936    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5937    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5938    GTEST_TEMPLATE_ T43>
5939struct Templates43 {
5940  typedef TemplateSel<T1> Head;
5941  typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5942      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5943      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5944      T43> Tail;
5945};
5946
5947template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5948    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5949    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5950    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5951    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5952    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5953    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5954    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5955    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5956    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5957    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5958    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5959    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5960    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5961    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
5962struct Templates44 {
5963  typedef TemplateSel<T1> Head;
5964  typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5965      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5966      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5967      T43, T44> Tail;
5968};
5969
5970template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5971    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5972    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5973    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5974    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5975    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5976    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5977    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5978    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5979    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5980    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5981    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5982    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5983    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5984    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
5985struct Templates45 {
5986  typedef TemplateSel<T1> Head;
5987  typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5988      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5989      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5990      T43, T44, T45> Tail;
5991};
5992
5993template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5994    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5995    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5996    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5997    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5998    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5999    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6000    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6001    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6002    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6003    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6004    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6005    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6006    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6007    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6008    GTEST_TEMPLATE_ T46>
6009struct Templates46 {
6010  typedef TemplateSel<T1> Head;
6011  typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6012      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6013      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6014      T43, T44, T45, T46> Tail;
6015};
6016
6017template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6018    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6019    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6020    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6021    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6022    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6023    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6024    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6025    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6026    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6027    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6028    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6029    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6030    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6031    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6032    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6033struct Templates47 {
6034  typedef TemplateSel<T1> Head;
6035  typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6036      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6037      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6038      T43, T44, T45, T46, T47> Tail;
6039};
6040
6041template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6042    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6043    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6044    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6045    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6046    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6047    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6048    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6049    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6050    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6051    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6052    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6053    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6054    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6055    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6056    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
6057struct Templates48 {
6058  typedef TemplateSel<T1> Head;
6059  typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6060      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6061      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6062      T43, T44, T45, T46, T47, T48> Tail;
6063};
6064
6065template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6066    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6067    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6068    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6069    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6070    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6071    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6072    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6073    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6074    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6075    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6076    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6077    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6078    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6079    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6080    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6081    GTEST_TEMPLATE_ T49>
6082struct Templates49 {
6083  typedef TemplateSel<T1> Head;
6084  typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6085      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6086      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6087      T43, T44, T45, T46, T47, T48, T49> Tail;
6088};
6089
6090template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6091    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6092    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6093    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6094    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6095    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6096    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6097    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6098    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6099    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6100    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6101    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6102    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6103    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6104    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6105    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6106    GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
6107struct Templates50 {
6108  typedef TemplateSel<T1> Head;
6109  typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6110      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6111      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6112      T43, T44, T45, T46, T47, T48, T49, T50> Tail;
6113};
6114
6115
6116// We don't want to require the users to write TemplatesN<...> directly,
6117// as that would require them to count the length.  Templates<...> is much
6118// easier to write, but generates horrible messages when there is a
6119// compiler error, as gcc insists on printing out each template
6120// argument, even if it has the default value (this means Templates<list>
6121// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
6122// errors).
6123//
6124// Our solution is to combine the best part of the two approaches: a
6125// user would write Templates<T1, ..., TN>, and Google Test will translate
6126// that to TemplatesN<T1, ..., TN> internally to make error messages
6127// readable.  The translation is done by the 'type' member of the
6128// Templates template.
6129template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
6130    GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
6131    GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
6132    GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
6133    GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
6134    GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
6135    GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
6136    GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
6137    GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
6138    GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
6139    GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
6140    GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
6141    GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
6142    GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
6143    GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
6144    GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
6145    GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
6146    GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
6147    GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
6148    GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
6149    GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
6150    GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
6151    GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
6152    GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
6153    GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
6154struct Templates {
6155  typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6156      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6157      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6158      T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
6159};
6160
6161template <>
6162struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6163    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6164    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6165    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6166    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6167    NoneT> {
6168  typedef Templates0 type;
6169};
6170template <GTEST_TEMPLATE_ T1>
6171struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6172    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6173    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6174    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6175    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6176    NoneT> {
6177  typedef Templates1<T1> type;
6178};
6179template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
6180struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6181    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6182    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6183    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6184    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6185    NoneT> {
6186  typedef Templates2<T1, T2> type;
6187};
6188template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
6189struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6190    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6191    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6192    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6193    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6194  typedef Templates3<T1, T2, T3> type;
6195};
6196template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6197    GTEST_TEMPLATE_ T4>
6198struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6199    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6200    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6201    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6202    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6203  typedef Templates4<T1, T2, T3, T4> type;
6204};
6205template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6206    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
6207struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6208    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6209    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6210    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6211    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6212  typedef Templates5<T1, T2, T3, T4, T5> type;
6213};
6214template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6215    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
6216struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
6217    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6218    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6219    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6220    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6221  typedef Templates6<T1, T2, T3, T4, T5, T6> type;
6222};
6223template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6224    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6225    GTEST_TEMPLATE_ T7>
6226struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
6227    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6228    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6229    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6230    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6231  typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
6232};
6233template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6234    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6235    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
6236struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
6237    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6238    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6239    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6240    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6241  typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
6242};
6243template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6244    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6245    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
6246struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
6247    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6248    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6249    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6250    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6251  typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
6252};
6253template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6254    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6255    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6256    GTEST_TEMPLATE_ T10>
6257struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
6258    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6259    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6260    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6261    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6262  typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
6263};
6264template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6265    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6266    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6267    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
6268struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
6269    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6270    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6271    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6272    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6273  typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
6274};
6275template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6276    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6277    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6278    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
6279struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
6280    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6281    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6282    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6283    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6284  typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
6285};
6286template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6287    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6288    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6289    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6290    GTEST_TEMPLATE_ T13>
6291struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
6292    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6293    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6294    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6295    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6296  typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6297      T13> type;
6298};
6299template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6300    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6301    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6302    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6303    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
6304struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6305    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6306    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6307    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6308    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6309  typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6310      T14> type;
6311};
6312template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6313    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6314    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6315    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6316    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
6317struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6318    T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6319    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6320    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6321    NoneT, NoneT, NoneT, NoneT, NoneT> {
6322  typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6323      T14, T15> type;
6324};
6325template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6326    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6327    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6328    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6329    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6330    GTEST_TEMPLATE_ T16>
6331struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6332    T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6333    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6334    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6335    NoneT, NoneT, NoneT, NoneT, NoneT> {
6336  typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6337      T14, T15, T16> type;
6338};
6339template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6340    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6341    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6342    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6343    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6344    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
6345struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6346    T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6347    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6348    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6349    NoneT, NoneT, NoneT, NoneT, NoneT> {
6350  typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6351      T14, T15, T16, T17> type;
6352};
6353template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6354    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6355    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6356    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6357    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6358    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
6359struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6360    T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6361    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6362    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6363    NoneT, NoneT, NoneT, NoneT> {
6364  typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6365      T14, T15, T16, T17, T18> type;
6366};
6367template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6368    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6369    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6370    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6371    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6372    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6373    GTEST_TEMPLATE_ T19>
6374struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6375    T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6376    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6377    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6378    NoneT, NoneT, NoneT, NoneT> {
6379  typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6380      T14, T15, T16, T17, T18, T19> type;
6381};
6382template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6383    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6384    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6385    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6386    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6387    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6388    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
6389struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6390    T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6391    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6392    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6393    NoneT, NoneT, NoneT, NoneT> {
6394  typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6395      T14, T15, T16, T17, T18, T19, T20> type;
6396};
6397template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6398    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6399    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6400    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6401    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6402    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6403    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
6404struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6405    T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
6406    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6407    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6408    NoneT, NoneT, NoneT, NoneT> {
6409  typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6410      T14, T15, T16, T17, T18, T19, T20, T21> type;
6411};
6412template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6413    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6414    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6415    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6416    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6417    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6418    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6419    GTEST_TEMPLATE_ T22>
6420struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6421    T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
6422    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6423    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6424    NoneT, NoneT, NoneT> {
6425  typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6426      T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
6427};
6428template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6429    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6430    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6431    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6432    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6433    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6434    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6435    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
6436struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6437    T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
6438    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6439    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6440    NoneT, NoneT, NoneT> {
6441  typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6442      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
6443};
6444template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6445    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6446    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6447    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6448    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6449    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6450    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6451    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
6452struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6453    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
6454    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6455    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6456    NoneT, NoneT, NoneT> {
6457  typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6458      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
6459};
6460template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6461    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6462    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6463    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6464    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6465    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6466    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6467    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6468    GTEST_TEMPLATE_ T25>
6469struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6470    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
6471    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6472    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6473    NoneT, NoneT> {
6474  typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6475      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
6476};
6477template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6478    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6479    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6480    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6481    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6482    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6483    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6484    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6485    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
6486struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6487    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
6488    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6489    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6490    NoneT, NoneT> {
6491  typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6492      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
6493};
6494template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6495    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6496    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6497    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6498    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6499    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6500    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6501    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6502    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
6503struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6504    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
6505    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6506    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6507    NoneT, NoneT> {
6508  typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6509      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6510      T27> type;
6511};
6512template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6513    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6514    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6515    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6516    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6517    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6518    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6519    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6520    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6521    GTEST_TEMPLATE_ T28>
6522struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6523    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6524    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6525    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6526    NoneT, NoneT> {
6527  typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6528      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6529      T28> type;
6530};
6531template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6532    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6533    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6534    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6535    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6536    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6537    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6538    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6539    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6540    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
6541struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6542    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6543    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6544    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6545    NoneT> {
6546  typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6547      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6548      T28, T29> type;
6549};
6550template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6551    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6552    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6553    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6554    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6555    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6556    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6557    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6558    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6559    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
6560struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6561    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6562    T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6563    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6564  typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6565      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6566      T28, T29, T30> type;
6567};
6568template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6569    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6570    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6571    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6572    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6573    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6574    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6575    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6576    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6577    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6578    GTEST_TEMPLATE_ T31>
6579struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6580    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6581    T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6582    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6583  typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6584      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6585      T28, T29, T30, T31> type;
6586};
6587template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6588    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6589    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6590    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6591    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6592    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6593    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6594    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6595    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6596    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6597    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
6598struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6599    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6600    T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6601    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6602  typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6603      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6604      T28, T29, T30, T31, T32> type;
6605};
6606template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6607    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6608    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6609    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6610    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6611    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6612    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6613    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6614    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6615    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6616    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
6617struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6618    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6619    T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6620    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6621  typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6622      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6623      T28, T29, T30, T31, T32, T33> type;
6624};
6625template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6626    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6627    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6628    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6629    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6630    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6631    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6632    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6633    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6634    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6635    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6636    GTEST_TEMPLATE_ T34>
6637struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6638    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6639    T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6640    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6641  typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6642      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6643      T28, T29, T30, T31, T32, T33, T34> type;
6644};
6645template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6646    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6647    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6648    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6649    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6650    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6651    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6652    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6653    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6654    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6655    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6656    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
6657struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6658    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6659    T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6660    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6661  typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6662      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6663      T28, T29, T30, T31, T32, T33, T34, T35> type;
6664};
6665template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6666    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6667    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6668    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6669    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6670    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6671    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6672    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6673    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6674    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6675    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6676    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
6677struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6678    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6679    T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
6680    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6681  typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6682      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6683      T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
6684};
6685template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6686    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6687    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6688    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6689    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6690    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6691    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6692    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6693    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6694    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6695    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6696    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6697    GTEST_TEMPLATE_ T37>
6698struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6699    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6700    T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
6701    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6702  typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6703      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6704      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
6705};
6706template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6707    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6708    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6709    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6710    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6711    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6712    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6713    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6714    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6715    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6716    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6717    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6718    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
6719struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6720    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6721    T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
6722    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6723  typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6724      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6725      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
6726};
6727template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6728    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6729    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6730    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6731    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6732    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6733    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6734    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6735    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6736    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6737    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6738    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6739    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
6740struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6741    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6742    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
6743    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6744  typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6745      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6746      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
6747};
6748template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6749    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6750    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6751    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6752    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6753    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6754    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6755    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6756    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6757    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6758    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6759    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6760    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6761    GTEST_TEMPLATE_ T40>
6762struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6763    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6764    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
6765    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6766  typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6767      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6768      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
6769};
6770template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6771    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6772    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6773    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6774    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6775    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6776    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6777    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6778    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6779    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6780    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6781    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6782    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6783    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
6784struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6785    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6786    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
6787    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6788  typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6789      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6790      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6791      T41> type;
6792};
6793template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6794    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6795    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6796    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6797    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6798    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6799    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6800    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6801    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6802    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6803    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6804    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6805    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6806    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
6807struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6808    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6809    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
6810    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6811  typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6812      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6813      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6814      T42> type;
6815};
6816template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6817    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6818    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6819    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6820    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6821    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6822    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6823    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6824    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6825    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6826    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6827    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6828    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6829    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6830    GTEST_TEMPLATE_ T43>
6831struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6832    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6833    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
6834    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6835  typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6836      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6837      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6838      T42, T43> type;
6839};
6840template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6841    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6842    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6843    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6844    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6845    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6846    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6847    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6848    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6849    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6850    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6851    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6852    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6853    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6854    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
6855struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6856    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6857    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6858    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6859  typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6860      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6861      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6862      T42, T43, T44> type;
6863};
6864template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6865    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6866    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6867    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6868    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6869    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6870    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6871    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6872    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6873    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6874    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6875    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6876    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6877    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6878    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
6879struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6880    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6881    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6882    T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
6883  typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6884      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6885      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6886      T42, T43, T44, T45> type;
6887};
6888template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6889    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6890    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6891    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6892    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6893    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6894    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6895    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6896    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6897    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6898    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6899    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6900    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6901    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6902    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6903    GTEST_TEMPLATE_ T46>
6904struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6905    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6906    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6907    T45, T46, NoneT, NoneT, NoneT, NoneT> {
6908  typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6909      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6910      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6911      T42, T43, T44, T45, T46> type;
6912};
6913template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6914    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6915    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6916    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6917    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6918    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6919    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6920    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6921    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6922    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6923    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6924    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6925    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6926    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6927    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6928    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6929struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6930    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6931    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6932    T45, T46, T47, NoneT, NoneT, NoneT> {
6933  typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6934      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6935      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6936      T42, T43, T44, T45, T46, T47> type;
6937};
6938template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6939    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6940    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6941    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6942    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6943    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6944    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6945    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6946    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6947    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6948    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6949    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6950    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6951    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6952    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6953    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
6954struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6955    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6956    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6957    T45, T46, T47, T48, NoneT, NoneT> {
6958  typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6959      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6960      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6961      T42, T43, T44, T45, T46, T47, T48> type;
6962};
6963template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6964    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6965    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6966    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6967    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6968    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6969    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6970    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6971    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6972    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6973    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6974    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6975    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6976    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6977    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6978    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6979    GTEST_TEMPLATE_ T49>
6980struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6981    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6982    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6983    T45, T46, T47, T48, T49, NoneT> {
6984  typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6985      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6986      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6987      T42, T43, T44, T45, T46, T47, T48, T49> type;
6988};
6989
6990// The TypeList template makes it possible to use either a single type
6991// or a Types<...> list in TYPED_TEST_CASE() and
6992// INSTANTIATE_TYPED_TEST_CASE_P().
6993
6994template <typename T>
6995struct TypeList {
6996  typedef Types1<T> type;
6997};
6998
6999template <typename T1, typename T2, typename T3, typename T4, typename T5,
7000    typename T6, typename T7, typename T8, typename T9, typename T10,
7001    typename T11, typename T12, typename T13, typename T14, typename T15,
7002    typename T16, typename T17, typename T18, typename T19, typename T20,
7003    typename T21, typename T22, typename T23, typename T24, typename T25,
7004    typename T26, typename T27, typename T28, typename T29, typename T30,
7005    typename T31, typename T32, typename T33, typename T34, typename T35,
7006    typename T36, typename T37, typename T38, typename T39, typename T40,
7007    typename T41, typename T42, typename T43, typename T44, typename T45,
7008    typename T46, typename T47, typename T48, typename T49, typename T50>
7009struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7010    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7011    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
7012    T44, T45, T46, T47, T48, T49, T50> > {
7013  typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
7014      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
7015      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
7016      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
7017};
7018
7019#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7020
7021}  // namespace internal
7022}  // namespace testing
7023
7024#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
7025
7026// Due to C++ preprocessor weirdness, we need double indirection to
7027// concatenate two tokens when one of them is __LINE__.  Writing
7028//
7029//   foo ## __LINE__
7030//
7031// will result in the token foo__LINE__, instead of foo followed by
7032// the current line number.  For more details, see
7033// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
7034#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
7035#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
7036
7037class ProtocolMessage;
7038namespace proto2 { class Message; }
7039
7040namespace testing {
7041
7042// Forward declarations.
7043
7044class AssertionResult;                 // Result of an assertion.
7045class Message;                         // Represents a failure message.
7046class Test;                            // Represents a test.
7047class TestInfo;                        // Information about a test.
7048class TestPartResult;                  // Result of a test part.
7049class UnitTest;                        // A collection of test cases.
7050
7051template <typename T>
7052::std::string PrintToString(const T& value);
7053
7054namespace internal {
7055
7056struct TraceInfo;                      // Information about a trace point.
7057class ScopedTrace;                     // Implements scoped trace.
7058class TestInfoImpl;                    // Opaque implementation of TestInfo
7059class UnitTestImpl;                    // Opaque implementation of UnitTest
7060
7061// How many times InitGoogleTest() has been called.
7062GTEST_API_ extern int g_init_gtest_count;
7063
7064// The text used in failure messages to indicate the start of the
7065// stack trace.
7066GTEST_API_ extern const char kStackTraceMarker[];
7067
7068// Two overloaded helpers for checking at compile time whether an
7069// expression is a null pointer literal (i.e. NULL or any 0-valued
7070// compile-time integral constant).  Their return values have
7071// different sizes, so we can use sizeof() to test which version is
7072// picked by the compiler.  These helpers have no implementations, as
7073// we only need their signatures.
7074//
7075// Given IsNullLiteralHelper(x), the compiler will pick the first
7076// version if x can be implicitly converted to Secret*, and pick the
7077// second version otherwise.  Since Secret is a secret and incomplete
7078// type, the only expression a user can write that has type Secret* is
7079// a null pointer literal.  Therefore, we know that x is a null
7080// pointer literal if and only if the first version is picked by the
7081// compiler.
7082char IsNullLiteralHelper(Secret* p);
7083char (&IsNullLiteralHelper(...))[2];  // NOLINT
7084
7085// A compile-time bool constant that is true if and only if x is a
7086// null pointer literal (i.e. NULL or any 0-valued compile-time
7087// integral constant).
7088#ifdef GTEST_ELLIPSIS_NEEDS_POD_
7089// We lose support for NULL detection where the compiler doesn't like
7090// passing non-POD classes through ellipsis (...).
7091# define GTEST_IS_NULL_LITERAL_(x) false
7092#else
7093# define GTEST_IS_NULL_LITERAL_(x) \
7094    (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
7095#endif  // GTEST_ELLIPSIS_NEEDS_POD_
7096
7097// Appends the user-supplied message to the Google-Test-generated message.
7098GTEST_API_ std::string AppendUserMessage(
7099    const std::string& gtest_msg, const Message& user_msg);
7100
7101#if GTEST_HAS_EXCEPTIONS
7102
7103// This exception is thrown by (and only by) a failed Google Test
7104// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
7105// are enabled).  We derive it from std::runtime_error, which is for
7106// errors presumably detectable only at run time.  Since
7107// std::runtime_error inherits from std::exception, many testing
7108// frameworks know how to extract and print the message inside it.
7109class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
7110 public:
7111  explicit GoogleTestFailureException(const TestPartResult& failure);
7112};
7113
7114#endif  // GTEST_HAS_EXCEPTIONS
7115
7116// A helper class for creating scoped traces in user programs.
7117class GTEST_API_ ScopedTrace {
7118 public:
7119  // The c'tor pushes the given source file location and message onto
7120  // a trace stack maintained by Google Test.
7121  ScopedTrace(const char* file, int line, const Message& message);
7122
7123  // The d'tor pops the info pushed by the c'tor.
7124  //
7125  // Note that the d'tor is not virtual in order to be efficient.
7126  // Don't inherit from ScopedTrace!
7127  ~ScopedTrace();
7128
7129 private:
7130  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
7131} GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its
7132                            // c'tor and d'tor.  Therefore it doesn't
7133                            // need to be used otherwise.
7134
7135// Constructs and returns the message for an equality assertion
7136// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
7137//
7138// The first four parameters are the expressions used in the assertion
7139// and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
7140// where foo is 5 and bar is 6, we have:
7141//
7142//   expected_expression: "foo"
7143//   actual_expression:   "bar"
7144//   expected_value:      "5"
7145//   actual_value:        "6"
7146//
7147// The ignoring_case parameter is true iff the assertion is a
7148// *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will
7149// be inserted into the message.
7150GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
7151                                     const char* actual_expression,
7152                                     const std::string& expected_value,
7153                                     const std::string& actual_value,
7154                                     bool ignoring_case);
7155
7156// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
7157GTEST_API_ std::string GetBoolAssertionFailureMessage(
7158    const AssertionResult& assertion_result,
7159    const char* expression_text,
7160    const char* actual_predicate_value,
7161    const char* expected_predicate_value);
7162
7163// This template class represents an IEEE floating-point number
7164// (either single-precision or double-precision, depending on the
7165// template parameters).
7166//
7167// The purpose of this class is to do more sophisticated number
7168// comparison.  (Due to round-off error, etc, it's very unlikely that
7169// two floating-points will be equal exactly.  Hence a naive
7170// comparison by the == operation often doesn't work.)
7171//
7172// Format of IEEE floating-point:
7173//
7174//   The most-significant bit being the leftmost, an IEEE
7175//   floating-point looks like
7176//
7177//     sign_bit exponent_bits fraction_bits
7178//
7179//   Here, sign_bit is a single bit that designates the sign of the
7180//   number.
7181//
7182//   For float, there are 8 exponent bits and 23 fraction bits.
7183//
7184//   For double, there are 11 exponent bits and 52 fraction bits.
7185//
7186//   More details can be found at
7187//   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
7188//
7189// Template parameter:
7190//
7191//   RawType: the raw floating-point type (either float or double)
7192template <typename RawType>
7193class FloatingPoint {
7194 public:
7195  // Defines the unsigned integer type that has the same size as the
7196  // floating point number.
7197  typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
7198
7199  // Constants.
7200
7201  // # of bits in a number.
7202  static const size_t kBitCount = 8*sizeof(RawType);
7203
7204  // # of fraction bits in a number.
7205  static const size_t kFractionBitCount =
7206    std::numeric_limits<RawType>::digits - 1;
7207
7208  // # of exponent bits in a number.
7209  static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
7210
7211  // The mask for the sign bit.
7212  static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
7213
7214  // The mask for the fraction bits.
7215  static const Bits kFractionBitMask =
7216    ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
7217
7218  // The mask for the exponent bits.
7219  static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
7220
7221  // How many ULP's (Units in the Last Place) we want to tolerate when
7222  // comparing two numbers.  The larger the value, the more error we
7223  // allow.  A 0 value means that two numbers must be exactly the same
7224  // to be considered equal.
7225  //
7226  // The maximum error of a single floating-point operation is 0.5
7227  // units in the last place.  On Intel CPU's, all floating-point
7228  // calculations are done with 80-bit precision, while double has 64
7229  // bits.  Therefore, 4 should be enough for ordinary use.
7230  //
7231  // See the following article for more details on ULP:
7232  // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
7233  static const size_t kMaxUlps = 4;
7234
7235  // Constructs a FloatingPoint from a raw floating-point number.
7236  //
7237  // On an Intel CPU, passing a non-normalized NAN (Not a Number)
7238  // around may change its bits, although the new value is guaranteed
7239  // to be also a NAN.  Therefore, don't expect this constructor to
7240  // preserve the bits in x when x is a NAN.
7241  explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
7242
7243  // Static methods
7244
7245  // Reinterprets a bit pattern as a floating-point number.
7246  //
7247  // This function is needed to test the AlmostEquals() method.
7248  static RawType ReinterpretBits(const Bits bits) {
7249    FloatingPoint fp(0);
7250    fp.u_.bits_ = bits;
7251    return fp.u_.value_;
7252  }
7253
7254  // Returns the floating-point number that represent positive infinity.
7255  static RawType Infinity() {
7256    return ReinterpretBits(kExponentBitMask);
7257  }
7258
7259  // Returns the maximum representable finite floating-point number.
7260  static RawType Max();
7261
7262  // Non-static methods
7263
7264  // Returns the bits that represents this number.
7265  const Bits &bits() const { return u_.bits_; }
7266
7267  // Returns the exponent bits of this number.
7268  Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
7269
7270  // Returns the fraction bits of this number.
7271  Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
7272
7273  // Returns the sign bit of this number.
7274  Bits sign_bit() const { return kSignBitMask & u_.bits_; }
7275
7276  // Returns true iff this is NAN (not a number).
7277  bool is_nan() const {
7278    // It's a NAN if the exponent bits are all ones and the fraction
7279    // bits are not entirely zeros.
7280    return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
7281  }
7282
7283  // Returns true iff this number is at most kMaxUlps ULP's away from
7284  // rhs.  In particular, this function:
7285  //
7286  //   - returns false if either number is (or both are) NAN.
7287  //   - treats really large numbers as almost equal to infinity.
7288  //   - thinks +0.0 and -0.0 are 0 DLP's apart.
7289  bool AlmostEquals(const FloatingPoint& rhs) const {
7290    // The IEEE standard says that any comparison operation involving
7291    // a NAN must return false.
7292    if (is_nan() || rhs.is_nan()) return false;
7293
7294    return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
7295        <= kMaxUlps;
7296  }
7297
7298 private:
7299  // The data type used to store the actual floating-point number.
7300  union FloatingPointUnion {
7301    RawType value_;  // The raw floating-point number.
7302    Bits bits_;      // The bits that represent the number.
7303  };
7304
7305  // Converts an integer from the sign-and-magnitude representation to
7306  // the biased representation.  More precisely, let N be 2 to the
7307  // power of (kBitCount - 1), an integer x is represented by the
7308  // unsigned number x + N.
7309  //
7310  // For instance,
7311  //
7312  //   -N + 1 (the most negative number representable using
7313  //          sign-and-magnitude) is represented by 1;
7314  //   0      is represented by N; and
7315  //   N - 1  (the biggest number representable using
7316  //          sign-and-magnitude) is represented by 2N - 1.
7317  //
7318  // Read http://en.wikipedia.org/wiki/Signed_number_representations
7319  // for more details on signed number representations.
7320  static Bits SignAndMagnitudeToBiased(const Bits &sam) {
7321    if (kSignBitMask & sam) {
7322      // sam represents a negative number.
7323      return ~sam + 1;
7324    } else {
7325      // sam represents a positive number.
7326      return kSignBitMask | sam;
7327    }
7328  }
7329
7330  // Given two numbers in the sign-and-magnitude representation,
7331  // returns the distance between them as an unsigned number.
7332  static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
7333                                                     const Bits &sam2) {
7334    const Bits biased1 = SignAndMagnitudeToBiased(sam1);
7335    const Bits biased2 = SignAndMagnitudeToBiased(sam2);
7336    return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
7337  }
7338
7339  FloatingPointUnion u_;
7340};
7341
7342// We cannot use std::numeric_limits<T>::max() as it clashes with the max()
7343// macro defined by <windows.h>.
7344template <>
7345inline float FloatingPoint<float>::Max() { return FLT_MAX; }
7346template <>
7347inline double FloatingPoint<double>::Max() { return DBL_MAX; }
7348
7349// Typedefs the instances of the FloatingPoint template class that we
7350// care to use.
7351typedef FloatingPoint<float> Float;
7352typedef FloatingPoint<double> Double;
7353
7354// In order to catch the mistake of putting tests that use different
7355// test fixture classes in the same test case, we need to assign
7356// unique IDs to fixture classes and compare them.  The TypeId type is
7357// used to hold such IDs.  The user should treat TypeId as an opaque
7358// type: the only operation allowed on TypeId values is to compare
7359// them for equality using the == operator.
7360typedef const void* TypeId;
7361
7362template <typename T>
7363class TypeIdHelper {
7364 public:
7365  // dummy_ must not have a const type.  Otherwise an overly eager
7366  // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
7367  // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
7368  static bool dummy_;
7369};
7370
7371template <typename T>
7372bool TypeIdHelper<T>::dummy_ = false;
7373
7374// GetTypeId<T>() returns the ID of type T.  Different values will be
7375// returned for different types.  Calling the function twice with the
7376// same type argument is guaranteed to return the same ID.
7377template <typename T>
7378TypeId GetTypeId() {
7379  // The compiler is required to allocate a different
7380  // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
7381  // the template.  Therefore, the address of dummy_ is guaranteed to
7382  // be unique.
7383  return &(TypeIdHelper<T>::dummy_);
7384}
7385
7386// Returns the type ID of ::testing::Test.  Always call this instead
7387// of GetTypeId< ::testing::Test>() to get the type ID of
7388// ::testing::Test, as the latter may give the wrong result due to a
7389// suspected linker bug when compiling Google Test as a Mac OS X
7390// framework.
7391GTEST_API_ TypeId GetTestTypeId();
7392
7393// Defines the abstract factory interface that creates instances
7394// of a Test object.
7395class TestFactoryBase {
7396 public:
7397  virtual ~TestFactoryBase() {}
7398
7399  // Creates a test instance to run. The instance is both created and destroyed
7400  // within TestInfoImpl::Run()
7401  virtual Test* CreateTest() = 0;
7402
7403 protected:
7404  TestFactoryBase() {}
7405
7406 private:
7407  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
7408};
7409
7410// This class provides implementation of TeastFactoryBase interface.
7411// It is used in TEST and TEST_F macros.
7412template <class TestClass>
7413class TestFactoryImpl : public TestFactoryBase {
7414 public:
7415  virtual Test* CreateTest() { return new TestClass; }
7416};
7417
7418#if GTEST_OS_WINDOWS
7419
7420// Predicate-formatters for implementing the HRESULT checking macros
7421// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
7422// We pass a long instead of HRESULT to avoid causing an
7423// include dependency for the HRESULT type.
7424GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
7425                                            long hr);  // NOLINT
7426GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
7427                                            long hr);  // NOLINT
7428
7429#endif  // GTEST_OS_WINDOWS
7430
7431// Types of SetUpTestCase() and TearDownTestCase() functions.
7432typedef void (*SetUpTestCaseFunc)();
7433typedef void (*TearDownTestCaseFunc)();
7434
7435// Creates a new TestInfo object and registers it with Google Test;
7436// returns the created object.
7437//
7438// Arguments:
7439//
7440//   test_case_name:   name of the test case
7441//   name:             name of the test
7442//   type_param        the name of the test's type parameter, or NULL if
7443//                     this is not a typed or a type-parameterized test.
7444//   value_param       text representation of the test's value parameter,
7445//                     or NULL if this is not a type-parameterized test.
7446//   fixture_class_id: ID of the test fixture class
7447//   set_up_tc:        pointer to the function that sets up the test case
7448//   tear_down_tc:     pointer to the function that tears down the test case
7449//   factory:          pointer to the factory that creates a test object.
7450//                     The newly created TestInfo instance will assume
7451//                     ownership of the factory object.
7452GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
7453    const char* test_case_name,
7454    const char* name,
7455    const char* type_param,
7456    const char* value_param,
7457    TypeId fixture_class_id,
7458    SetUpTestCaseFunc set_up_tc,
7459    TearDownTestCaseFunc tear_down_tc,
7460    TestFactoryBase* factory);
7461
7462// If *pstr starts with the given prefix, modifies *pstr to be right
7463// past the prefix and returns true; otherwise leaves *pstr unchanged
7464// and returns false.  None of pstr, *pstr, and prefix can be NULL.
7465GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
7466
7467#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7468
7469// State of the definition of a type-parameterized test case.
7470class GTEST_API_ TypedTestCasePState {
7471 public:
7472  TypedTestCasePState() : registered_(false) {}
7473
7474  // Adds the given test name to defined_test_names_ and return true
7475  // if the test case hasn't been registered; otherwise aborts the
7476  // program.
7477  bool AddTestName(const char* file, int line, const char* case_name,
7478                   const char* test_name) {
7479    if (registered_) {
7480      fprintf(stderr, "%s Test %s must be defined before "
7481              "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
7482              FormatFileLocation(file, line).c_str(), test_name, case_name);
7483      fflush(stderr);
7484      posix::Abort();
7485    }
7486    defined_test_names_.insert(test_name);
7487    return true;
7488  }
7489
7490  // Verifies that registered_tests match the test names in
7491  // defined_test_names_; returns registered_tests if successful, or
7492  // aborts the program otherwise.
7493  const char* VerifyRegisteredTestNames(
7494      const char* file, int line, const char* registered_tests);
7495
7496 private:
7497  bool registered_;
7498  ::std::set<const char*> defined_test_names_;
7499};
7500
7501// Skips to the first non-space char after the first comma in 'str';
7502// returns NULL if no comma is found in 'str'.
7503inline const char* SkipComma(const char* str) {
7504  const char* comma = strchr(str, ',');
7505  if (comma == NULL) {
7506    return NULL;
7507  }
7508  while (IsSpace(*(++comma))) {}
7509  return comma;
7510}
7511
7512// Returns the prefix of 'str' before the first comma in it; returns
7513// the entire string if it contains no comma.
7514inline std::string GetPrefixUntilComma(const char* str) {
7515  const char* comma = strchr(str, ',');
7516  return comma == NULL ? str : std::string(str, comma);
7517}
7518
7519// TypeParameterizedTest<Fixture, TestSel, Types>::Register()
7520// registers a list of type-parameterized tests with Google Test.  The
7521// return value is insignificant - we just need to return something
7522// such that we can call this function in a namespace scope.
7523//
7524// Implementation note: The GTEST_TEMPLATE_ macro declares a template
7525// template parameter.  It's defined in gtest-type-util.h.
7526template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
7527class TypeParameterizedTest {
7528 public:
7529  // 'index' is the index of the test in the type list 'Types'
7530  // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
7531  // Types).  Valid values for 'index' are [0, N - 1] where N is the
7532  // length of Types.
7533  static bool Register(const char* prefix, const char* case_name,
7534                       const char* test_names, int index) {
7535    typedef typename Types::Head Type;
7536    typedef Fixture<Type> FixtureClass;
7537    typedef typename GTEST_BIND_(TestSel, Type) TestClass;
7538
7539    // First, registers the first type-parameterized test in the type
7540    // list.
7541    MakeAndRegisterTestInfo(
7542        (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
7543         + StreamableToString(index)).c_str(),
7544        GetPrefixUntilComma(test_names).c_str(),
7545        GetTypeName<Type>().c_str(),
7546        NULL,  // No value parameter.
7547        GetTypeId<FixtureClass>(),
7548        TestClass::SetUpTestCase,
7549        TestClass::TearDownTestCase,
7550        new TestFactoryImpl<TestClass>);
7551
7552    // Next, recurses (at compile time) with the tail of the type list.
7553    return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
7554        ::Register(prefix, case_name, test_names, index + 1);
7555  }
7556};
7557
7558// The base case for the compile time recursion.
7559template <GTEST_TEMPLATE_ Fixture, class TestSel>
7560class TypeParameterizedTest<Fixture, TestSel, Types0> {
7561 public:
7562  static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7563                       const char* /*test_names*/, int /*index*/) {
7564    return true;
7565  }
7566};
7567
7568// TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
7569// registers *all combinations* of 'Tests' and 'Types' with Google
7570// Test.  The return value is insignificant - we just need to return
7571// something such that we can call this function in a namespace scope.
7572template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
7573class TypeParameterizedTestCase {
7574 public:
7575  static bool Register(const char* prefix, const char* case_name,
7576                       const char* test_names) {
7577    typedef typename Tests::Head Head;
7578
7579    // First, register the first test in 'Test' for each type in 'Types'.
7580    TypeParameterizedTest<Fixture, Head, Types>::Register(
7581        prefix, case_name, test_names, 0);
7582
7583    // Next, recurses (at compile time) with the tail of the test list.
7584    return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
7585        ::Register(prefix, case_name, SkipComma(test_names));
7586  }
7587};
7588
7589// The base case for the compile time recursion.
7590template <GTEST_TEMPLATE_ Fixture, typename Types>
7591class TypeParameterizedTestCase<Fixture, Templates0, Types> {
7592 public:
7593  static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7594                       const char* /*test_names*/) {
7595    return true;
7596  }
7597};
7598
7599#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7600
7601// Returns the current OS stack trace as an std::string.
7602//
7603// The maximum number of stack frames to be included is specified by
7604// the gtest_stack_trace_depth flag.  The skip_count parameter
7605// specifies the number of top frames to be skipped, which doesn't
7606// count against the number of frames to be included.
7607//
7608// For example, if Foo() calls Bar(), which in turn calls
7609// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
7610// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
7611GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
7612    UnitTest* unit_test, int skip_count);
7613
7614// Helpers for suppressing warnings on unreachable code or constant
7615// condition.
7616
7617// Always returns true.
7618GTEST_API_ bool AlwaysTrue();
7619
7620// Always returns false.
7621inline bool AlwaysFalse() { return !AlwaysTrue(); }
7622
7623// Helper for suppressing false warning from Clang on a const char*
7624// variable declared in a conditional expression always being NULL in
7625// the else branch.
7626struct GTEST_API_ ConstCharPtr {
7627  ConstCharPtr(const char* str) : value(str) {}
7628  operator bool() const { return true; }
7629  const char* value;
7630};
7631
7632// A simple Linear Congruential Generator for generating random
7633// numbers with a uniform distribution.  Unlike rand() and srand(), it
7634// doesn't use global state (and therefore can't interfere with user
7635// code).  Unlike rand_r(), it's portable.  An LCG isn't very random,
7636// but it's good enough for our purposes.
7637class GTEST_API_ Random {
7638 public:
7639  static const UInt32 kMaxRange = 1u << 31;
7640
7641  explicit Random(UInt32 seed) : state_(seed) {}
7642
7643  void Reseed(UInt32 seed) { state_ = seed; }
7644
7645  // Generates a random number from [0, range).  Crashes if 'range' is
7646  // 0 or greater than kMaxRange.
7647  UInt32 Generate(UInt32 range);
7648
7649 private:
7650  UInt32 state_;
7651  GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
7652};
7653
7654// Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
7655// compiler error iff T1 and T2 are different types.
7656template <typename T1, typename T2>
7657struct CompileAssertTypesEqual;
7658
7659template <typename T>
7660struct CompileAssertTypesEqual<T, T> {
7661};
7662
7663// Removes the reference from a type if it is a reference type,
7664// otherwise leaves it unchanged.  This is the same as
7665// tr1::remove_reference, which is not widely available yet.
7666template <typename T>
7667struct RemoveReference { typedef T type; };  // NOLINT
7668template <typename T>
7669struct RemoveReference<T&> { typedef T type; };  // NOLINT
7670
7671// A handy wrapper around RemoveReference that works when the argument
7672// T depends on template parameters.
7673#define GTEST_REMOVE_REFERENCE_(T) \
7674    typename ::testing::internal::RemoveReference<T>::type
7675
7676// Removes const from a type if it is a const type, otherwise leaves
7677// it unchanged.  This is the same as tr1::remove_const, which is not
7678// widely available yet.
7679template <typename T>
7680struct RemoveConst { typedef T type; };  // NOLINT
7681template <typename T>
7682struct RemoveConst<const T> { typedef T type; };  // NOLINT
7683
7684// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
7685// definition to fail to remove the const in 'const int[3]' and 'const
7686// char[3][4]'.  The following specialization works around the bug.
7687template <typename T, size_t N>
7688struct RemoveConst<const T[N]> {
7689  typedef typename RemoveConst<T>::type type[N];
7690};
7691
7692#if defined(_MSC_VER) && _MSC_VER < 1400
7693// This is the only specialization that allows VC++ 7.1 to remove const in
7694// 'const int[3] and 'const int[3][4]'.  However, it causes trouble with GCC
7695// and thus needs to be conditionally compiled.
7696template <typename T, size_t N>
7697struct RemoveConst<T[N]> {
7698  typedef typename RemoveConst<T>::type type[N];
7699};
7700#endif
7701
7702// A handy wrapper around RemoveConst that works when the argument
7703// T depends on template parameters.
7704#define GTEST_REMOVE_CONST_(T) \
7705    typename ::testing::internal::RemoveConst<T>::type
7706
7707// Turns const U&, U&, const U, and U all into U.
7708#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
7709    GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
7710
7711// Adds reference to a type if it is not a reference type,
7712// otherwise leaves it unchanged.  This is the same as
7713// tr1::add_reference, which is not widely available yet.
7714template <typename T>
7715struct AddReference { typedef T& type; };  // NOLINT
7716template <typename T>
7717struct AddReference<T&> { typedef T& type; };  // NOLINT
7718
7719// A handy wrapper around AddReference that works when the argument T
7720// depends on template parameters.
7721#define GTEST_ADD_REFERENCE_(T) \
7722    typename ::testing::internal::AddReference<T>::type
7723
7724// Adds a reference to const on top of T as necessary.  For example,
7725// it transforms
7726//
7727//   char         ==> const char&
7728//   const char   ==> const char&
7729//   char&        ==> const char&
7730//   const char&  ==> const char&
7731//
7732// The argument T must depend on some template parameters.
7733#define GTEST_REFERENCE_TO_CONST_(T) \
7734    GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
7735
7736// ImplicitlyConvertible<From, To>::value is a compile-time bool
7737// constant that's true iff type From can be implicitly converted to
7738// type To.
7739template <typename From, typename To>
7740class ImplicitlyConvertible {
7741 private:
7742  // We need the following helper functions only for their types.
7743  // They have no implementations.
7744
7745  // MakeFrom() is an expression whose type is From.  We cannot simply
7746  // use From(), as the type From may not have a public default
7747  // constructor.
7748  static From MakeFrom();
7749
7750  // These two functions are overloaded.  Given an expression
7751  // Helper(x), the compiler will pick the first version if x can be
7752  // implicitly converted to type To; otherwise it will pick the
7753  // second version.
7754  //
7755  // The first version returns a value of size 1, and the second
7756  // version returns a value of size 2.  Therefore, by checking the
7757  // size of Helper(x), which can be done at compile time, we can tell
7758  // which version of Helper() is used, and hence whether x can be
7759  // implicitly converted to type To.
7760  static char Helper(To);
7761  static char (&Helper(...))[2];  // NOLINT
7762
7763  // We have to put the 'public' section after the 'private' section,
7764  // or MSVC refuses to compile the code.
7765 public:
7766  // MSVC warns about implicitly converting from double to int for
7767  // possible loss of data, so we need to temporarily disable the
7768  // warning.
7769#ifdef _MSC_VER
7770# pragma warning(push)          // Saves the current warning state.
7771# pragma warning(disable:4244)  // Temporarily disables warning 4244.
7772
7773  static const bool value =
7774      sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
7775# pragma warning(pop)           // Restores the warning state.
7776#elif defined(__BORLANDC__)
7777  // C++Builder cannot use member overload resolution during template
7778  // instantiation.  The simplest workaround is to use its C++0x type traits
7779  // functions (C++Builder 2009 and above only).
7780  static const bool value = __is_convertible(From, To);
7781#else
7782  static const bool value =
7783      sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
7784#endif  // _MSV_VER
7785};
7786template <typename From, typename To>
7787const bool ImplicitlyConvertible<From, To>::value;
7788
7789// IsAProtocolMessage<T>::value is a compile-time bool constant that's
7790// true iff T is type ProtocolMessage, proto2::Message, or a subclass
7791// of those.
7792template <typename T>
7793struct IsAProtocolMessage
7794    : public bool_constant<
7795  ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
7796  ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
7797};
7798
7799// When the compiler sees expression IsContainerTest<C>(0), if C is an
7800// STL-style container class, the first overload of IsContainerTest
7801// will be viable (since both C::iterator* and C::const_iterator* are
7802// valid types and NULL can be implicitly converted to them).  It will
7803// be picked over the second overload as 'int' is a perfect match for
7804// the type of argument 0.  If C::iterator or C::const_iterator is not
7805// a valid type, the first overload is not viable, and the second
7806// overload will be picked.  Therefore, we can determine whether C is
7807// a container class by checking the type of IsContainerTest<C>(0).
7808// The value of the expression is insignificant.
7809//
7810// Note that we look for both C::iterator and C::const_iterator.  The
7811// reason is that C++ injects the name of a class as a member of the
7812// class itself (e.g. you can refer to class iterator as either
7813// 'iterator' or 'iterator::iterator').  If we look for C::iterator
7814// only, for example, we would mistakenly think that a class named
7815// iterator is an STL container.
7816//
7817// Also note that the simpler approach of overloading
7818// IsContainerTest(typename C::const_iterator*) and
7819// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
7820typedef int IsContainer;
7821template <class C>
7822IsContainer IsContainerTest(int /* dummy */,
7823                            typename C::iterator* /* it */ = NULL,
7824                            typename C::const_iterator* /* const_it */ = NULL) {
7825  return 0;
7826}
7827
7828typedef char IsNotContainer;
7829template <class C>
7830IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
7831
7832// EnableIf<condition>::type is void when 'Cond' is true, and
7833// undefined when 'Cond' is false.  To use SFINAE to make a function
7834// overload only apply when a particular expression is true, add
7835// "typename EnableIf<expression>::type* = 0" as the last parameter.
7836template<bool> struct EnableIf;
7837template<> struct EnableIf<true> { typedef void type; };  // NOLINT
7838
7839// Utilities for native arrays.
7840
7841// ArrayEq() compares two k-dimensional native arrays using the
7842// elements' operator==, where k can be any integer >= 0.  When k is
7843// 0, ArrayEq() degenerates into comparing a single pair of values.
7844
7845template <typename T, typename U>
7846bool ArrayEq(const T* lhs, size_t size, const U* rhs);
7847
7848// This generic version is used when k is 0.
7849template <typename T, typename U>
7850inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
7851
7852// This overload is used when k >= 1.
7853template <typename T, typename U, size_t N>
7854inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
7855  return internal::ArrayEq(lhs, N, rhs);
7856}
7857
7858// This helper reduces code bloat.  If we instead put its logic inside
7859// the previous ArrayEq() function, arrays with different sizes would
7860// lead to different copies of the template code.
7861template <typename T, typename U>
7862bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
7863  for (size_t i = 0; i != size; i++) {
7864    if (!internal::ArrayEq(lhs[i], rhs[i]))
7865      return false;
7866  }
7867  return true;
7868}
7869
7870// Finds the first element in the iterator range [begin, end) that
7871// equals elem.  Element may be a native array type itself.
7872template <typename Iter, typename Element>
7873Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
7874  for (Iter it = begin; it != end; ++it) {
7875    if (internal::ArrayEq(*it, elem))
7876      return it;
7877  }
7878  return end;
7879}
7880
7881// CopyArray() copies a k-dimensional native array using the elements'
7882// operator=, where k can be any integer >= 0.  When k is 0,
7883// CopyArray() degenerates into copying a single value.
7884
7885template <typename T, typename U>
7886void CopyArray(const T* from, size_t size, U* to);
7887
7888// This generic version is used when k is 0.
7889template <typename T, typename U>
7890inline void CopyArray(const T& from, U* to) { *to = from; }
7891
7892// This overload is used when k >= 1.
7893template <typename T, typename U, size_t N>
7894inline void CopyArray(const T(&from)[N], U(*to)[N]) {
7895  internal::CopyArray(from, N, *to);
7896}
7897
7898// This helper reduces code bloat.  If we instead put its logic inside
7899// the previous CopyArray() function, arrays with different sizes
7900// would lead to different copies of the template code.
7901template <typename T, typename U>
7902void CopyArray(const T* from, size_t size, U* to) {
7903  for (size_t i = 0; i != size; i++) {
7904    internal::CopyArray(from[i], to + i);
7905  }
7906}
7907
7908// The relation between an NativeArray object (see below) and the
7909// native array it represents.
7910enum RelationToSource {
7911  kReference,  // The NativeArray references the native array.
7912  kCopy        // The NativeArray makes a copy of the native array and
7913               // owns the copy.
7914};
7915
7916// Adapts a native array to a read-only STL-style container.  Instead
7917// of the complete STL container concept, this adaptor only implements
7918// members useful for Google Mock's container matchers.  New members
7919// should be added as needed.  To simplify the implementation, we only
7920// support Element being a raw type (i.e. having no top-level const or
7921// reference modifier).  It's the client's responsibility to satisfy
7922// this requirement.  Element can be an array type itself (hence
7923// multi-dimensional arrays are supported).
7924template <typename Element>
7925class NativeArray {
7926 public:
7927  // STL-style container typedefs.
7928  typedef Element value_type;
7929  typedef Element* iterator;
7930  typedef const Element* const_iterator;
7931
7932  // Constructs from a native array.
7933  NativeArray(const Element* array, size_t count, RelationToSource relation) {
7934    Init(array, count, relation);
7935  }
7936
7937  // Copy constructor.
7938  NativeArray(const NativeArray& rhs) {
7939    Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
7940  }
7941
7942  ~NativeArray() {
7943    // Ensures that the user doesn't instantiate NativeArray with a
7944    // const or reference type.
7945    static_cast<void>(StaticAssertTypeEqHelper<Element,
7946        GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
7947    if (relation_to_source_ == kCopy)
7948      delete[] array_;
7949  }
7950
7951  // STL-style container methods.
7952  size_t size() const { return size_; }
7953  const_iterator begin() const { return array_; }
7954  const_iterator end() const { return array_ + size_; }
7955  bool operator==(const NativeArray& rhs) const {
7956    return size() == rhs.size() &&
7957        ArrayEq(begin(), size(), rhs.begin());
7958  }
7959
7960 private:
7961  // Initializes this object; makes a copy of the input array if
7962  // 'relation' is kCopy.
7963  void Init(const Element* array, size_t a_size, RelationToSource relation) {
7964    if (relation == kReference) {
7965      array_ = array;
7966    } else {
7967      Element* const copy = new Element[a_size];
7968      CopyArray(array, a_size, copy);
7969      array_ = copy;
7970    }
7971    size_ = a_size;
7972    relation_to_source_ = relation;
7973  }
7974
7975  const Element* array_;
7976  size_t size_;
7977  RelationToSource relation_to_source_;
7978
7979  GTEST_DISALLOW_ASSIGN_(NativeArray);
7980};
7981
7982}  // namespace internal
7983}  // namespace testing
7984
7985#define GTEST_MESSAGE_AT_(file, line, message, result_type) \
7986  ::testing::internal::AssertHelper(result_type, file, line, message) \
7987    = ::testing::Message()
7988
7989#define GTEST_MESSAGE_(message, result_type) \
7990  GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
7991
7992#define GTEST_FATAL_FAILURE_(message) \
7993  return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
7994
7995#define GTEST_NONFATAL_FAILURE_(message) \
7996  GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
7997
7998#define GTEST_SUCCESS_(message) \
7999  GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
8000
8001// Suppresses MSVC warnings 4072 (unreachable code) for the code following
8002// statement if it returns or throws (or doesn't return or throw in some
8003// situations).
8004#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
8005  if (::testing::internal::AlwaysTrue()) { statement; }
8006
8007#define GTEST_TEST_THROW_(statement, expected_exception, fail) \
8008  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8009  if (::testing::internal::ConstCharPtr gtest_msg = "") { \
8010    bool gtest_caught_expected = false; \
8011    try { \
8012      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8013    } \
8014    catch (expected_exception const&) { \
8015      gtest_caught_expected = true; \
8016    } \
8017    catch (...) { \
8018      gtest_msg.value = \
8019          "Expected: " #statement " throws an exception of type " \
8020          #expected_exception ".\n  Actual: it throws a different type."; \
8021      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
8022    } \
8023    if (!gtest_caught_expected) { \
8024      gtest_msg.value = \
8025          "Expected: " #statement " throws an exception of type " \
8026          #expected_exception ".\n  Actual: it throws nothing."; \
8027      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
8028    } \
8029  } else \
8030    GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
8031      fail(gtest_msg.value)
8032
8033#define GTEST_TEST_NO_THROW_(statement, fail) \
8034  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8035  if (::testing::internal::AlwaysTrue()) { \
8036    try { \
8037      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8038    } \
8039    catch (...) { \
8040      goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
8041    } \
8042  } else \
8043    GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
8044      fail("Expected: " #statement " doesn't throw an exception.\n" \
8045           "  Actual: it throws.")
8046
8047#define GTEST_TEST_ANY_THROW_(statement, fail) \
8048  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8049  if (::testing::internal::AlwaysTrue()) { \
8050    bool gtest_caught_any = false; \
8051    try { \
8052      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8053    } \
8054    catch (...) { \
8055      gtest_caught_any = true; \
8056    } \
8057    if (!gtest_caught_any) { \
8058      goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
8059    } \
8060  } else \
8061    GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
8062      fail("Expected: " #statement " throws an exception.\n" \
8063           "  Actual: it doesn't.")
8064
8065
8066// Implements Boolean test assertions such as EXPECT_TRUE. expression can be
8067// either a boolean expression or an AssertionResult. text is a textual
8068// represenation of expression as it was passed into the EXPECT_TRUE.
8069#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
8070  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8071  if (const ::testing::AssertionResult gtest_ar_ = \
8072      ::testing::AssertionResult(expression)) \
8073    ; \
8074  else \
8075    fail(::testing::internal::GetBoolAssertionFailureMessage(\
8076        gtest_ar_, text, #actual, #expected).c_str())
8077
8078#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
8079  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8080  if (::testing::internal::AlwaysTrue()) { \
8081    ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
8082    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8083    if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
8084      goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
8085    } \
8086  } else \
8087    GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
8088      fail("Expected: " #statement " doesn't generate new fatal " \
8089           "failures in the current thread.\n" \
8090           "  Actual: it does.")
8091
8092// Expands to the name of the class that implements the given test.
8093#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
8094  test_case_name##_##test_name##_Test
8095
8096// Helper macro for defining tests.
8097#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
8098class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
8099 public:\
8100  GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
8101 private:\
8102  virtual void TestBody();\
8103  static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
8104  GTEST_DISALLOW_COPY_AND_ASSIGN_(\
8105      GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
8106};\
8107\
8108::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
8109  ::test_info_ =\
8110    ::testing::internal::MakeAndRegisterTestInfo(\
8111        #test_case_name, #test_name, NULL, NULL, \
8112        (parent_id), \
8113        parent_class::SetUpTestCase, \
8114        parent_class::TearDownTestCase, \
8115        new ::testing::internal::TestFactoryImpl<\
8116            GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
8117void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
8118
8119#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
8120// Copyright 2005, Google Inc.
8121// All rights reserved.
8122//
8123// Redistribution and use in source and binary forms, with or without
8124// modification, are permitted provided that the following conditions are
8125// met:
8126//
8127//     * Redistributions of source code must retain the above copyright
8128// notice, this list of conditions and the following disclaimer.
8129//     * Redistributions in binary form must reproduce the above
8130// copyright notice, this list of conditions and the following disclaimer
8131// in the documentation and/or other materials provided with the
8132// distribution.
8133//     * Neither the name of Google Inc. nor the names of its
8134// contributors may be used to endorse or promote products derived from
8135// this software without specific prior written permission.
8136//
8137// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8138// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8139// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8140// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8141// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8142// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8143// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8144// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8145// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8146// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8147// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8148//
8149// Author: wan@google.com (Zhanyong Wan)
8150//
8151// The Google C++ Testing Framework (Google Test)
8152//
8153// This header file defines the public API for death tests.  It is
8154// #included by gtest.h so a user doesn't need to include this
8155// directly.
8156
8157#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8158#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8159
8160// Copyright 2005, Google Inc.
8161// All rights reserved.
8162//
8163// Redistribution and use in source and binary forms, with or without
8164// modification, are permitted provided that the following conditions are
8165// met:
8166//
8167//     * Redistributions of source code must retain the above copyright
8168// notice, this list of conditions and the following disclaimer.
8169//     * Redistributions in binary form must reproduce the above
8170// copyright notice, this list of conditions and the following disclaimer
8171// in the documentation and/or other materials provided with the
8172// distribution.
8173//     * Neither the name of Google Inc. nor the names of its
8174// contributors may be used to endorse or promote products derived from
8175// this software without specific prior written permission.
8176//
8177// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8178// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8179// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8180// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8181// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8182// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8183// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8184// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8185// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8186// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8187// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8188//
8189// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
8190//
8191// The Google C++ Testing Framework (Google Test)
8192//
8193// This header file defines internal utilities needed for implementing
8194// death tests.  They are subject to change without notice.
8195
8196#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8197#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8198
8199
8200#include <stdio.h>
8201
8202namespace testing {
8203namespace internal {
8204
8205GTEST_DECLARE_string_(internal_run_death_test);
8206
8207// Names of the flags (needed for parsing Google Test flags).
8208const char kDeathTestStyleFlag[] = "death_test_style";
8209const char kDeathTestUseFork[] = "death_test_use_fork";
8210const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
8211
8212#if GTEST_HAS_DEATH_TEST
8213
8214// DeathTest is a class that hides much of the complexity of the
8215// GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method
8216// returns a concrete class that depends on the prevailing death test
8217// style, as defined by the --gtest_death_test_style and/or
8218// --gtest_internal_run_death_test flags.
8219
8220// In describing the results of death tests, these terms are used with
8221// the corresponding definitions:
8222//
8223// exit status:  The integer exit information in the format specified
8224//               by wait(2)
8225// exit code:    The integer code passed to exit(3), _exit(2), or
8226//               returned from main()
8227class GTEST_API_ DeathTest {
8228 public:
8229  // Create returns false if there was an error determining the
8230  // appropriate action to take for the current death test; for example,
8231  // if the gtest_death_test_style flag is set to an invalid value.
8232  // The LastMessage method will return a more detailed message in that
8233  // case.  Otherwise, the DeathTest pointer pointed to by the "test"
8234  // argument is set.  If the death test should be skipped, the pointer
8235  // is set to NULL; otherwise, it is set to the address of a new concrete
8236  // DeathTest object that controls the execution of the current test.
8237  static bool Create(const char* statement, const RE* regex,
8238                     const char* file, int line, DeathTest** test);
8239  DeathTest();
8240  virtual ~DeathTest() { }
8241
8242  // A helper class that aborts a death test when it's deleted.
8243  class ReturnSentinel {
8244   public:
8245    explicit ReturnSentinel(DeathTest* test) : test_(test) { }
8246    ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
8247   private:
8248    DeathTest* const test_;
8249    GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
8250  } GTEST_ATTRIBUTE_UNUSED_;
8251
8252  // An enumeration of possible roles that may be taken when a death
8253  // test is encountered.  EXECUTE means that the death test logic should
8254  // be executed immediately.  OVERSEE means that the program should prepare
8255  // the appropriate environment for a child process to execute the death
8256  // test, then wait for it to complete.
8257  enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
8258
8259  // An enumeration of the three reasons that a test might be aborted.
8260  enum AbortReason {
8261    TEST_ENCOUNTERED_RETURN_STATEMENT,
8262    TEST_THREW_EXCEPTION,
8263    TEST_DID_NOT_DIE
8264  };
8265
8266  // Assumes one of the above roles.
8267  virtual TestRole AssumeRole() = 0;
8268
8269  // Waits for the death test to finish and returns its status.
8270  virtual int Wait() = 0;
8271
8272  // Returns true if the death test passed; that is, the test process
8273  // exited during the test, its exit status matches a user-supplied
8274  // predicate, and its stderr output matches a user-supplied regular
8275  // expression.
8276  // The user-supplied predicate may be a macro expression rather
8277  // than a function pointer or functor, or else Wait and Passed could
8278  // be combined.
8279  virtual bool Passed(bool exit_status_ok) = 0;
8280
8281  // Signals that the death test did not die as expected.
8282  virtual void Abort(AbortReason reason) = 0;
8283
8284  // Returns a human-readable outcome message regarding the outcome of
8285  // the last death test.
8286  static const char* LastMessage();
8287
8288  static void set_last_death_test_message(const std::string& message);
8289
8290 private:
8291  // A string containing a description of the outcome of the last death test.
8292  static std::string last_death_test_message_;
8293
8294  GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
8295};
8296
8297// Factory interface for death tests.  May be mocked out for testing.
8298class DeathTestFactory {
8299 public:
8300  virtual ~DeathTestFactory() { }
8301  virtual bool Create(const char* statement, const RE* regex,
8302                      const char* file, int line, DeathTest** test) = 0;
8303};
8304
8305// A concrete DeathTestFactory implementation for normal use.
8306class DefaultDeathTestFactory : public DeathTestFactory {
8307 public:
8308  virtual bool Create(const char* statement, const RE* regex,
8309                      const char* file, int line, DeathTest** test);
8310};
8311
8312// Returns true if exit_status describes a process that was terminated
8313// by a signal, or exited normally with a nonzero exit code.
8314GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
8315
8316// Traps C++ exceptions escaping statement and reports them as test
8317// failures. Note that trapping SEH exceptions is not implemented here.
8318# if GTEST_HAS_EXCEPTIONS
8319#  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
8320  try { \
8321    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8322  } catch (const ::std::exception& gtest_exception) { \
8323    fprintf(\
8324        stderr, \
8325        "\n%s: Caught std::exception-derived exception escaping the " \
8326        "death test statement. Exception message: %s\n", \
8327        ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
8328        gtest_exception.what()); \
8329    fflush(stderr); \
8330    death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
8331  } catch (...) { \
8332    death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
8333  }
8334
8335# else
8336#  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
8337  GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
8338
8339# endif
8340
8341// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
8342// ASSERT_EXIT*, and EXPECT_EXIT*.
8343# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
8344  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8345  if (::testing::internal::AlwaysTrue()) { \
8346    const ::testing::internal::RE& gtest_regex = (regex); \
8347    ::testing::internal::DeathTest* gtest_dt; \
8348    if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
8349        __FILE__, __LINE__, &gtest_dt)) { \
8350      goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
8351    } \
8352    if (gtest_dt != NULL) { \
8353      ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
8354          gtest_dt_ptr(gtest_dt); \
8355      switch (gtest_dt->AssumeRole()) { \
8356        case ::testing::internal::DeathTest::OVERSEE_TEST: \
8357          if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
8358            goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
8359          } \
8360          break; \
8361        case ::testing::internal::DeathTest::EXECUTE_TEST: { \
8362          ::testing::internal::DeathTest::ReturnSentinel \
8363              gtest_sentinel(gtest_dt); \
8364          GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
8365          gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
8366          break; \
8367        } \
8368        default: \
8369          break; \
8370      } \
8371    } \
8372  } else \
8373    GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
8374      fail(::testing::internal::DeathTest::LastMessage())
8375// The symbol "fail" here expands to something into which a message
8376// can be streamed.
8377
8378// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
8379// NDEBUG mode. In this case we need the statements to be executed, the regex is
8380// ignored, and the macro must accept a streamed message even though the message
8381// is never printed.
8382# define GTEST_EXECUTE_STATEMENT_(statement, regex) \
8383  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8384  if (::testing::internal::AlwaysTrue()) { \
8385     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8386  } else \
8387    ::testing::Message()
8388
8389// A class representing the parsed contents of the
8390// --gtest_internal_run_death_test flag, as it existed when
8391// RUN_ALL_TESTS was called.
8392class InternalRunDeathTestFlag {
8393 public:
8394  InternalRunDeathTestFlag(const std::string& a_file,
8395                           int a_line,
8396                           int an_index,
8397                           int a_write_fd)
8398      : file_(a_file), line_(a_line), index_(an_index),
8399        write_fd_(a_write_fd) {}
8400
8401  ~InternalRunDeathTestFlag() {
8402    if (write_fd_ >= 0)
8403      posix::Close(write_fd_);
8404  }
8405
8406  const std::string& file() const { return file_; }
8407  int line() const { return line_; }
8408  int index() const { return index_; }
8409  int write_fd() const { return write_fd_; }
8410
8411 private:
8412  std::string file_;
8413  int line_;
8414  int index_;
8415  int write_fd_;
8416
8417  GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
8418};
8419
8420// Returns a newly created InternalRunDeathTestFlag object with fields
8421// initialized from the GTEST_FLAG(internal_run_death_test) flag if
8422// the flag is specified; otherwise returns NULL.
8423InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
8424
8425#else  // GTEST_HAS_DEATH_TEST
8426
8427// This macro is used for implementing macros such as
8428// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
8429// death tests are not supported. Those macros must compile on such systems
8430// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
8431// systems that support death tests. This allows one to write such a macro
8432// on a system that does not support death tests and be sure that it will
8433// compile on a death-test supporting system.
8434//
8435// Parameters:
8436//   statement -  A statement that a macro such as EXPECT_DEATH would test
8437//                for program termination. This macro has to make sure this
8438//                statement is compiled but not executed, to ensure that
8439//                EXPECT_DEATH_IF_SUPPORTED compiles with a certain
8440//                parameter iff EXPECT_DEATH compiles with it.
8441//   regex     -  A regex that a macro such as EXPECT_DEATH would use to test
8442//                the output of statement.  This parameter has to be
8443//                compiled but not evaluated by this macro, to ensure that
8444//                this macro only accepts expressions that a macro such as
8445//                EXPECT_DEATH would accept.
8446//   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
8447//                and a return statement for ASSERT_DEATH_IF_SUPPORTED.
8448//                This ensures that ASSERT_DEATH_IF_SUPPORTED will not
8449//                compile inside functions where ASSERT_DEATH doesn't
8450//                compile.
8451//
8452//  The branch that has an always false condition is used to ensure that
8453//  statement and regex are compiled (and thus syntactically correct) but
8454//  never executed. The unreachable code macro protects the terminator
8455//  statement from generating an 'unreachable code' warning in case
8456//  statement unconditionally returns or throws. The Message constructor at
8457//  the end allows the syntax of streaming additional messages into the
8458//  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
8459# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
8460    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8461    if (::testing::internal::AlwaysTrue()) { \
8462      GTEST_LOG_(WARNING) \
8463          << "Death tests are not supported on this platform.\n" \
8464          << "Statement '" #statement "' cannot be verified."; \
8465    } else if (::testing::internal::AlwaysFalse()) { \
8466      ::testing::internal::RE::PartialMatch(".*", (regex)); \
8467      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8468      terminator; \
8469    } else \
8470      ::testing::Message()
8471
8472#endif  // GTEST_HAS_DEATH_TEST
8473
8474}  // namespace internal
8475}  // namespace testing
8476
8477#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8478
8479namespace testing {
8480
8481// This flag controls the style of death tests.  Valid values are "threadsafe",
8482// meaning that the death test child process will re-execute the test binary
8483// from the start, running only a single death test, or "fast",
8484// meaning that the child process will execute the test logic immediately
8485// after forking.
8486GTEST_DECLARE_string_(death_test_style);
8487
8488#if GTEST_HAS_DEATH_TEST
8489
8490namespace internal {
8491
8492// Returns a Boolean value indicating whether the caller is currently
8493// executing in the context of the death test child process.  Tools such as
8494// Valgrind heap checkers may need this to modify their behavior in death
8495// tests.  IMPORTANT: This is an internal utility.  Using it may break the
8496// implementation of death tests.  User code MUST NOT use it.
8497GTEST_API_ bool InDeathTestChild();
8498
8499}  // namespace internal
8500
8501// The following macros are useful for writing death tests.
8502
8503// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
8504// executed:
8505//
8506//   1. It generates a warning if there is more than one active
8507//   thread.  This is because it's safe to fork() or clone() only
8508//   when there is a single thread.
8509//
8510//   2. The parent process clone()s a sub-process and runs the death
8511//   test in it; the sub-process exits with code 0 at the end of the
8512//   death test, if it hasn't exited already.
8513//
8514//   3. The parent process waits for the sub-process to terminate.
8515//
8516//   4. The parent process checks the exit code and error message of
8517//   the sub-process.
8518//
8519// Examples:
8520//
8521//   ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
8522//   for (int i = 0; i < 5; i++) {
8523//     EXPECT_DEATH(server.ProcessRequest(i),
8524//                  "Invalid request .* in ProcessRequest()")
8525//                  << "Failed to die on request " << i;
8526//   }
8527//
8528//   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
8529//
8530//   bool KilledBySIGHUP(int exit_code) {
8531//     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
8532//   }
8533//
8534//   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
8535//
8536// On the regular expressions used in death tests:
8537//
8538//   On POSIX-compliant systems (*nix), we use the <regex.h> library,
8539//   which uses the POSIX extended regex syntax.
8540//
8541//   On other platforms (e.g. Windows), we only support a simple regex
8542//   syntax implemented as part of Google Test.  This limited
8543//   implementation should be enough most of the time when writing
8544//   death tests; though it lacks many features you can find in PCRE
8545//   or POSIX extended regex syntax.  For example, we don't support
8546//   union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
8547//   repetition count ("x{5,7}"), among others.
8548//
8549//   Below is the syntax that we do support.  We chose it to be a
8550//   subset of both PCRE and POSIX extended regex, so it's easy to
8551//   learn wherever you come from.  In the following: 'A' denotes a
8552//   literal character, period (.), or a single \\ escape sequence;
8553//   'x' and 'y' denote regular expressions; 'm' and 'n' are for
8554//   natural numbers.
8555//
8556//     c     matches any literal character c
8557//     \\d   matches any decimal digit
8558//     \\D   matches any character that's not a decimal digit
8559//     \\f   matches \f
8560//     \\n   matches \n
8561//     \\r   matches \r
8562//     \\s   matches any ASCII whitespace, including \n
8563//     \\S   matches any character that's not a whitespace
8564//     \\t   matches \t
8565//     \\v   matches \v
8566//     \\w   matches any letter, _, or decimal digit
8567//     \\W   matches any character that \\w doesn't match
8568//     \\c   matches any literal character c, which must be a punctuation
8569//     .     matches any single character except \n
8570//     A?    matches 0 or 1 occurrences of A
8571//     A*    matches 0 or many occurrences of A
8572//     A+    matches 1 or many occurrences of A
8573//     ^     matches the beginning of a string (not that of each line)
8574//     $     matches the end of a string (not that of each line)
8575//     xy    matches x followed by y
8576//
8577//   If you accidentally use PCRE or POSIX extended regex features
8578//   not implemented by us, you will get a run-time failure.  In that
8579//   case, please try to rewrite your regular expression within the
8580//   above syntax.
8581//
8582//   This implementation is *not* meant to be as highly tuned or robust
8583//   as a compiled regex library, but should perform well enough for a
8584//   death test, which already incurs significant overhead by launching
8585//   a child process.
8586//
8587// Known caveats:
8588//
8589//   A "threadsafe" style death test obtains the path to the test
8590//   program from argv[0] and re-executes it in the sub-process.  For
8591//   simplicity, the current implementation doesn't search the PATH
8592//   when launching the sub-process.  This means that the user must
8593//   invoke the test program via a path that contains at least one
8594//   path separator (e.g. path/to/foo_test and
8595//   /absolute/path/to/bar_test are fine, but foo_test is not).  This
8596//   is rarely a problem as people usually don't put the test binary
8597//   directory in PATH.
8598//
8599// TODO(wan@google.com): make thread-safe death tests search the PATH.
8600
8601// Asserts that a given statement causes the program to exit, with an
8602// integer exit status that satisfies predicate, and emitting error output
8603// that matches regex.
8604# define ASSERT_EXIT(statement, predicate, regex) \
8605    GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
8606
8607// Like ASSERT_EXIT, but continues on to successive tests in the
8608// test case, if any:
8609# define EXPECT_EXIT(statement, predicate, regex) \
8610    GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
8611
8612// Asserts that a given statement causes the program to exit, either by
8613// explicitly exiting with a nonzero exit code or being killed by a
8614// signal, and emitting error output that matches regex.
8615# define ASSERT_DEATH(statement, regex) \
8616    ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
8617
8618// Like ASSERT_DEATH, but continues on to successive tests in the
8619// test case, if any:
8620# define EXPECT_DEATH(statement, regex) \
8621    EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
8622
8623// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
8624
8625// Tests that an exit code describes a normal exit with a given exit code.
8626class GTEST_API_ ExitedWithCode {
8627 public:
8628  explicit ExitedWithCode(int exit_code);
8629  bool operator()(int exit_status) const;
8630 private:
8631  // No implementation - assignment is unsupported.
8632  void operator=(const ExitedWithCode& other);
8633
8634  const int exit_code_;
8635};
8636
8637# if !GTEST_OS_WINDOWS
8638// Tests that an exit code describes an exit due to termination by a
8639// given signal.
8640class GTEST_API_ KilledBySignal {
8641 public:
8642  explicit KilledBySignal(int signum);
8643  bool operator()(int exit_status) const;
8644 private:
8645  const int signum_;
8646};
8647# endif  // !GTEST_OS_WINDOWS
8648
8649// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
8650// The death testing framework causes this to have interesting semantics,
8651// since the sideeffects of the call are only visible in opt mode, and not
8652// in debug mode.
8653//
8654// In practice, this can be used to test functions that utilize the
8655// LOG(DFATAL) macro using the following style:
8656//
8657// int DieInDebugOr12(int* sideeffect) {
8658//   if (sideeffect) {
8659//     *sideeffect = 12;
8660//   }
8661//   LOG(DFATAL) << "death";
8662//   return 12;
8663// }
8664//
8665// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
8666//   int sideeffect = 0;
8667//   // Only asserts in dbg.
8668//   EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
8669//
8670// #ifdef NDEBUG
8671//   // opt-mode has sideeffect visible.
8672//   EXPECT_EQ(12, sideeffect);
8673// #else
8674//   // dbg-mode no visible sideeffect.
8675//   EXPECT_EQ(0, sideeffect);
8676// #endif
8677// }
8678//
8679// This will assert that DieInDebugReturn12InOpt() crashes in debug
8680// mode, usually due to a DCHECK or LOG(DFATAL), but returns the
8681// appropriate fallback value (12 in this case) in opt mode. If you
8682// need to test that a function has appropriate side-effects in opt
8683// mode, include assertions against the side-effects.  A general
8684// pattern for this is:
8685//
8686// EXPECT_DEBUG_DEATH({
8687//   // Side-effects here will have an effect after this statement in
8688//   // opt mode, but none in debug mode.
8689//   EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
8690// }, "death");
8691//
8692# ifdef NDEBUG
8693
8694#  define EXPECT_DEBUG_DEATH(statement, regex) \
8695  GTEST_EXECUTE_STATEMENT_(statement, regex)
8696
8697#  define ASSERT_DEBUG_DEATH(statement, regex) \
8698  GTEST_EXECUTE_STATEMENT_(statement, regex)
8699
8700# else
8701
8702#  define EXPECT_DEBUG_DEATH(statement, regex) \
8703  EXPECT_DEATH(statement, regex)
8704
8705#  define ASSERT_DEBUG_DEATH(statement, regex) \
8706  ASSERT_DEATH(statement, regex)
8707
8708# endif  // NDEBUG for EXPECT_DEBUG_DEATH
8709#endif  // GTEST_HAS_DEATH_TEST
8710
8711// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
8712// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
8713// death tests are supported; otherwise they just issue a warning.  This is
8714// useful when you are combining death test assertions with normal test
8715// assertions in one test.
8716#if GTEST_HAS_DEATH_TEST
8717# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
8718    EXPECT_DEATH(statement, regex)
8719# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
8720    ASSERT_DEATH(statement, regex)
8721#else
8722# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
8723    GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
8724# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
8725    GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
8726#endif
8727
8728}  // namespace testing
8729
8730#endif  // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8731// This file was GENERATED by command:
8732//     pump.py gtest-param-test.h.pump
8733// DO NOT EDIT BY HAND!!!
8734
8735// Copyright 2008, Google Inc.
8736// All rights reserved.
8737//
8738// Redistribution and use in source and binary forms, with or without
8739// modification, are permitted provided that the following conditions are
8740// met:
8741//
8742//     * Redistributions of source code must retain the above copyright
8743// notice, this list of conditions and the following disclaimer.
8744//     * Redistributions in binary form must reproduce the above
8745// copyright notice, this list of conditions and the following disclaimer
8746// in the documentation and/or other materials provided with the
8747// distribution.
8748//     * Neither the name of Google Inc. nor the names of its
8749// contributors may be used to endorse or promote products derived from
8750// this software without specific prior written permission.
8751//
8752// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8753// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8754// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8755// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8756// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8757// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8758// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8759// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8760// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8761// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8762// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8763//
8764// Authors: vladl@google.com (Vlad Losev)
8765//
8766// Macros and functions for implementing parameterized tests
8767// in Google C++ Testing Framework (Google Test)
8768//
8769// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
8770//
8771#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8772#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8773
8774
8775// Value-parameterized tests allow you to test your code with different
8776// parameters without writing multiple copies of the same test.
8777//
8778// Here is how you use value-parameterized tests:
8779
8780#if 0
8781
8782// To write value-parameterized tests, first you should define a fixture
8783// class. It is usually derived from testing::TestWithParam<T> (see below for
8784// another inheritance scheme that's sometimes useful in more complicated
8785// class hierarchies), where the type of your parameter values.
8786// TestWithParam<T> is itself derived from testing::Test. T can be any
8787// copyable type. If it's a raw pointer, you are responsible for managing the
8788// lifespan of the pointed values.
8789
8790class FooTest : public ::testing::TestWithParam<const char*> {
8791  // You can implement all the usual class fixture members here.
8792};
8793
8794// Then, use the TEST_P macro to define as many parameterized tests
8795// for this fixture as you want. The _P suffix is for "parameterized"
8796// or "pattern", whichever you prefer to think.
8797
8798TEST_P(FooTest, DoesBlah) {
8799  // Inside a test, access the test parameter with the GetParam() method
8800  // of the TestWithParam<T> class:
8801  EXPECT_TRUE(foo.Blah(GetParam()));
8802  ...
8803}
8804
8805TEST_P(FooTest, HasBlahBlah) {
8806  ...
8807}
8808
8809// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
8810// case with any set of parameters you want. Google Test defines a number
8811// of functions for generating test parameters. They return what we call
8812// (surprise!) parameter generators. Here is a  summary of them, which
8813// are all in the testing namespace:
8814//
8815//
8816//  Range(begin, end [, step]) - Yields values {begin, begin+step,
8817//                               begin+step+step, ...}. The values do not
8818//                               include end. step defaults to 1.
8819//  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.
8820//  ValuesIn(container)        - Yields values from a C-style array, an STL
8821//  ValuesIn(begin,end)          container, or an iterator range [begin, end).
8822//  Bool()                     - Yields sequence {false, true}.
8823//  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product
8824//                               for the math savvy) of the values generated
8825//                               by the N generators.
8826//
8827// For more details, see comments at the definitions of these functions below
8828// in this file.
8829//
8830// The following statement will instantiate tests from the FooTest test case
8831// each with parameter values "meeny", "miny", and "moe".
8832
8833INSTANTIATE_TEST_CASE_P(InstantiationName,
8834                        FooTest,
8835                        Values("meeny", "miny", "moe"));
8836
8837// To distinguish different instances of the pattern, (yes, you
8838// can instantiate it more then once) the first argument to the
8839// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
8840// actual test case name. Remember to pick unique prefixes for different
8841// instantiations. The tests from the instantiation above will have
8842// these names:
8843//
8844//    * InstantiationName/FooTest.DoesBlah/0 for "meeny"
8845//    * InstantiationName/FooTest.DoesBlah/1 for "miny"
8846//    * InstantiationName/FooTest.DoesBlah/2 for "moe"
8847//    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
8848//    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
8849//    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
8850//
8851// You can use these names in --gtest_filter.
8852//
8853// This statement will instantiate all tests from FooTest again, each
8854// with parameter values "cat" and "dog":
8855
8856const char* pets[] = {"cat", "dog"};
8857INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
8858
8859// The tests from the instantiation above will have these names:
8860//
8861//    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
8862//    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
8863//    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
8864//    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
8865//
8866// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
8867// in the given test case, whether their definitions come before or
8868// AFTER the INSTANTIATE_TEST_CASE_P statement.
8869//
8870// Please also note that generator expressions (including parameters to the
8871// generators) are evaluated in InitGoogleTest(), after main() has started.
8872// This allows the user on one hand, to adjust generator parameters in order
8873// to dynamically determine a set of tests to run and on the other hand,
8874// give the user a chance to inspect the generated tests with Google Test
8875// reflection API before RUN_ALL_TESTS() is executed.
8876//
8877// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
8878// for more examples.
8879//
8880// In the future, we plan to publish the API for defining new parameter
8881// generators. But for now this interface remains part of the internal
8882// implementation and is subject to change.
8883//
8884//
8885// A parameterized test fixture must be derived from testing::Test and from
8886// testing::WithParamInterface<T>, where T is the type of the parameter
8887// values. Inheriting from TestWithParam<T> satisfies that requirement because
8888// TestWithParam<T> inherits from both Test and WithParamInterface. In more
8889// complicated hierarchies, however, it is occasionally useful to inherit
8890// separately from Test and WithParamInterface. For example:
8891
8892class BaseTest : public ::testing::Test {
8893  // You can inherit all the usual members for a non-parameterized test
8894  // fixture here.
8895};
8896
8897class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
8898  // The usual test fixture members go here too.
8899};
8900
8901TEST_F(BaseTest, HasFoo) {
8902  // This is an ordinary non-parameterized test.
8903}
8904
8905TEST_P(DerivedTest, DoesBlah) {
8906  // GetParam works just the same here as if you inherit from TestWithParam.
8907  EXPECT_TRUE(foo.Blah(GetParam()));
8908}
8909
8910#endif  // 0
8911
8912
8913#if !GTEST_OS_SYMBIAN
8914# include <utility>
8915#endif
8916
8917// scripts/fuse_gtest.py depends on gtest's own header being #included
8918// *unconditionally*.  Therefore these #includes cannot be moved
8919// inside #if GTEST_HAS_PARAM_TEST.
8920// Copyright 2008 Google Inc.
8921// All Rights Reserved.
8922//
8923// Redistribution and use in source and binary forms, with or without
8924// modification, are permitted provided that the following conditions are
8925// met:
8926//
8927//     * Redistributions of source code must retain the above copyright
8928// notice, this list of conditions and the following disclaimer.
8929//     * Redistributions in binary form must reproduce the above
8930// copyright notice, this list of conditions and the following disclaimer
8931// in the documentation and/or other materials provided with the
8932// distribution.
8933//     * Neither the name of Google Inc. nor the names of its
8934// contributors may be used to endorse or promote products derived from
8935// this software without specific prior written permission.
8936//
8937// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8938// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8939// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8940// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8941// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8942// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8943// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8944// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8945// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8946// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8947// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8948//
8949// Author: vladl@google.com (Vlad Losev)
8950
8951// Type and function utilities for implementing parameterized tests.
8952
8953#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
8954#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
8955
8956#include <iterator>
8957#include <utility>
8958#include <vector>
8959
8960// scripts/fuse_gtest.py depends on gtest's own header being #included
8961// *unconditionally*.  Therefore these #includes cannot be moved
8962// inside #if GTEST_HAS_PARAM_TEST.
8963// Copyright 2003 Google Inc.
8964// All rights reserved.
8965//
8966// Redistribution and use in source and binary forms, with or without
8967// modification, are permitted provided that the following conditions are
8968// met:
8969//
8970//     * Redistributions of source code must retain the above copyright
8971// notice, this list of conditions and the following disclaimer.
8972//     * Redistributions in binary form must reproduce the above
8973// copyright notice, this list of conditions and the following disclaimer
8974// in the documentation and/or other materials provided with the
8975// distribution.
8976//     * Neither the name of Google Inc. nor the names of its
8977// contributors may be used to endorse or promote products derived from
8978// this software without specific prior written permission.
8979//
8980// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8981// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8982// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8983// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8984// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8985// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8986// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8987// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8988// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8989// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8990// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8991//
8992// Authors: Dan Egnor (egnor@google.com)
8993//
8994// A "smart" pointer type with reference tracking.  Every pointer to a
8995// particular object is kept on a circular linked list.  When the last pointer
8996// to an object is destroyed or reassigned, the object is deleted.
8997//
8998// Used properly, this deletes the object when the last reference goes away.
8999// There are several caveats:
9000// - Like all reference counting schemes, cycles lead to leaks.
9001// - Each smart pointer is actually two pointers (8 bytes instead of 4).
9002// - Every time a pointer is assigned, the entire list of pointers to that
9003//   object is traversed.  This class is therefore NOT SUITABLE when there
9004//   will often be more than two or three pointers to a particular object.
9005// - References are only tracked as long as linked_ptr<> objects are copied.
9006//   If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
9007//   will happen (double deletion).
9008//
9009// A good use of this class is storing object references in STL containers.
9010// You can safely put linked_ptr<> in a vector<>.
9011// Other uses may not be as good.
9012//
9013// Note: If you use an incomplete type with linked_ptr<>, the class
9014// *containing* linked_ptr<> must have a constructor and destructor (even
9015// if they do nothing!).
9016//
9017// Bill Gibbons suggested we use something like this.
9018//
9019// Thread Safety:
9020//   Unlike other linked_ptr implementations, in this implementation
9021//   a linked_ptr object is thread-safe in the sense that:
9022//     - it's safe to copy linked_ptr objects concurrently,
9023//     - it's safe to copy *from* a linked_ptr and read its underlying
9024//       raw pointer (e.g. via get()) concurrently, and
9025//     - it's safe to write to two linked_ptrs that point to the same
9026//       shared object concurrently.
9027// TODO(wan@google.com): rename this to safe_linked_ptr to avoid
9028// confusion with normal linked_ptr.
9029
9030#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9031#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9032
9033#include <stdlib.h>
9034#include <assert.h>
9035
9036
9037namespace testing {
9038namespace internal {
9039
9040// Protects copying of all linked_ptr objects.
9041GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
9042
9043// This is used internally by all instances of linked_ptr<>.  It needs to be
9044// a non-template class because different types of linked_ptr<> can refer to
9045// the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
9046// So, it needs to be possible for different types of linked_ptr to participate
9047// in the same circular linked list, so we need a single class type here.
9048//
9049// DO NOT USE THIS CLASS DIRECTLY YOURSELF.  Use linked_ptr<T>.
9050class linked_ptr_internal {
9051 public:
9052  // Create a new circle that includes only this instance.
9053  void join_new() {
9054    next_ = this;
9055  }
9056
9057  // Many linked_ptr operations may change p.link_ for some linked_ptr
9058  // variable p in the same circle as this object.  Therefore we need
9059  // to prevent two such operations from occurring concurrently.
9060  //
9061  // Note that different types of linked_ptr objects can coexist in a
9062  // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
9063  // linked_ptr<Derived2>).  Therefore we must use a single mutex to
9064  // protect all linked_ptr objects.  This can create serious
9065  // contention in production code, but is acceptable in a testing
9066  // framework.
9067
9068  // Join an existing circle.
9069  void join(linked_ptr_internal const* ptr)
9070      GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
9071    MutexLock lock(&g_linked_ptr_mutex);
9072
9073    linked_ptr_internal const* p = ptr;
9074    while (p->next_ != ptr) p = p->next_;
9075    p->next_ = this;
9076    next_ = ptr;
9077  }
9078
9079  // Leave whatever circle we're part of.  Returns true if we were the
9080  // last member of the circle.  Once this is done, you can join() another.
9081  bool depart()
9082      GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
9083    MutexLock lock(&g_linked_ptr_mutex);
9084
9085    if (next_ == this) return true;
9086    linked_ptr_internal const* p = next_;
9087    while (p->next_ != this) p = p->next_;
9088    p->next_ = next_;
9089    return false;
9090  }
9091
9092 private:
9093  mutable linked_ptr_internal const* next_;
9094};
9095
9096template <typename T>
9097class linked_ptr {
9098 public:
9099  typedef T element_type;
9100
9101  // Take over ownership of a raw pointer.  This should happen as soon as
9102  // possible after the object is created.
9103  explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
9104  ~linked_ptr() { depart(); }
9105
9106  // Copy an existing linked_ptr<>, adding ourselves to the list of references.
9107  template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
9108  linked_ptr(linked_ptr const& ptr) {  // NOLINT
9109    assert(&ptr != this);
9110    copy(&ptr);
9111  }
9112
9113  // Assignment releases the old value and acquires the new.
9114  template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
9115    depart();
9116    copy(&ptr);
9117    return *this;
9118  }
9119
9120  linked_ptr& operator=(linked_ptr const& ptr) {
9121    if (&ptr != this) {
9122      depart();
9123      copy(&ptr);
9124    }
9125    return *this;
9126  }
9127
9128  // Smart pointer members.
9129  void reset(T* ptr = NULL) {
9130    depart();
9131    capture(ptr);
9132  }
9133  T* get() const { return value_; }
9134  T* operator->() const { return value_; }
9135  T& operator*() const { return *value_; }
9136
9137  bool operator==(T* p) const { return value_ == p; }
9138  bool operator!=(T* p) const { return value_ != p; }
9139  template <typename U>
9140  bool operator==(linked_ptr<U> const& ptr) const {
9141    return value_ == ptr.get();
9142  }
9143  template <typename U>
9144  bool operator!=(linked_ptr<U> const& ptr) const {
9145    return value_ != ptr.get();
9146  }
9147
9148 private:
9149  template <typename U>
9150  friend class linked_ptr;
9151
9152  T* value_;
9153  linked_ptr_internal link_;
9154
9155  void depart() {
9156    if (link_.depart()) delete value_;
9157  }
9158
9159  void capture(T* ptr) {
9160    value_ = ptr;
9161    link_.join_new();
9162  }
9163
9164  template <typename U> void copy(linked_ptr<U> const* ptr) {
9165    value_ = ptr->get();
9166    if (value_)
9167      link_.join(&ptr->link_);
9168    else
9169      link_.join_new();
9170  }
9171};
9172
9173template<typename T> inline
9174bool operator==(T* ptr, const linked_ptr<T>& x) {
9175  return ptr == x.get();
9176}
9177
9178template<typename T> inline
9179bool operator!=(T* ptr, const linked_ptr<T>& x) {
9180  return ptr != x.get();
9181}
9182
9183// A function to convert T* into linked_ptr<T>
9184// Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
9185// for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
9186template <typename T>
9187linked_ptr<T> make_linked_ptr(T* ptr) {
9188  return linked_ptr<T>(ptr);
9189}
9190
9191}  // namespace internal
9192}  // namespace testing
9193
9194#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9195// Copyright 2007, Google Inc.
9196// All rights reserved.
9197//
9198// Redistribution and use in source and binary forms, with or without
9199// modification, are permitted provided that the following conditions are
9200// met:
9201//
9202//     * Redistributions of source code must retain the above copyright
9203// notice, this list of conditions and the following disclaimer.
9204//     * Redistributions in binary form must reproduce the above
9205// copyright notice, this list of conditions and the following disclaimer
9206// in the documentation and/or other materials provided with the
9207// distribution.
9208//     * Neither the name of Google Inc. nor the names of its
9209// contributors may be used to endorse or promote products derived from
9210// this software without specific prior written permission.
9211//
9212// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9213// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9214// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9215// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9216// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9217// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9218// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9219// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9220// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9221// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9222// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9223//
9224// Author: wan@google.com (Zhanyong Wan)
9225
9226// Google Test - The Google C++ Testing Framework
9227//
9228// This file implements a universal value printer that can print a
9229// value of any type T:
9230//
9231//   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
9232//
9233// A user can teach this function how to print a class type T by
9234// defining either operator<<() or PrintTo() in the namespace that
9235// defines T.  More specifically, the FIRST defined function in the
9236// following list will be used (assuming T is defined in namespace
9237// foo):
9238//
9239//   1. foo::PrintTo(const T&, ostream*)
9240//   2. operator<<(ostream&, const T&) defined in either foo or the
9241//      global namespace.
9242//
9243// If none of the above is defined, it will print the debug string of
9244// the value if it is a protocol buffer, or print the raw bytes in the
9245// value otherwise.
9246//
9247// To aid debugging: when T is a reference type, the address of the
9248// value is also printed; when T is a (const) char pointer, both the
9249// pointer value and the NUL-terminated string it points to are
9250// printed.
9251//
9252// We also provide some convenient wrappers:
9253//
9254//   // Prints a value to a string.  For a (const or not) char
9255//   // pointer, the NUL-terminated string (but not the pointer) is
9256//   // printed.
9257//   std::string ::testing::PrintToString(const T& value);
9258//
9259//   // Prints a value tersely: for a reference type, the referenced
9260//   // value (but not the address) is printed; for a (const or not) char
9261//   // pointer, the NUL-terminated string (but not the pointer) is
9262//   // printed.
9263//   void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
9264//
9265//   // Prints value using the type inferred by the compiler.  The difference
9266//   // from UniversalTersePrint() is that this function prints both the
9267//   // pointer and the NUL-terminated string for a (const or not) char pointer.
9268//   void ::testing::internal::UniversalPrint(const T& value, ostream*);
9269//
9270//   // Prints the fields of a tuple tersely to a string vector, one
9271//   // element for each field. Tuple support must be enabled in
9272//   // gtest-port.h.
9273//   std::vector<string> UniversalTersePrintTupleFieldsToStrings(
9274//       const Tuple& value);
9275//
9276// Known limitation:
9277//
9278// The print primitives print the elements of an STL-style container
9279// using the compiler-inferred type of *iter where iter is a
9280// const_iterator of the container.  When const_iterator is an input
9281// iterator but not a forward iterator, this inferred type may not
9282// match value_type, and the print output may be incorrect.  In
9283// practice, this is rarely a problem as for most containers
9284// const_iterator is a forward iterator.  We'll fix this if there's an
9285// actual need for it.  Note that this fix cannot rely on value_type
9286// being defined as many user-defined container types don't have
9287// value_type.
9288
9289#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9290#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9291
9292#include <ostream>  // NOLINT
9293#include <sstream>
9294#include <string>
9295#include <utility>
9296#include <vector>
9297
9298namespace testing {
9299
9300// Definitions in the 'internal' and 'internal2' name spaces are
9301// subject to change without notice.  DO NOT USE THEM IN USER CODE!
9302namespace internal2 {
9303
9304// Prints the given number of bytes in the given object to the given
9305// ostream.
9306GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
9307                                     size_t count,
9308                                     ::std::ostream* os);
9309
9310// For selecting which printer to use when a given type has neither <<
9311// nor PrintTo().
9312enum TypeKind {
9313  kProtobuf,              // a protobuf type
9314  kConvertibleToInteger,  // a type implicitly convertible to BiggestInt
9315                          // (e.g. a named or unnamed enum type)
9316  kOtherType              // anything else
9317};
9318
9319// TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
9320// by the universal printer to print a value of type T when neither
9321// operator<< nor PrintTo() is defined for T, where kTypeKind is the
9322// "kind" of T as defined by enum TypeKind.
9323template <typename T, TypeKind kTypeKind>
9324class TypeWithoutFormatter {
9325 public:
9326  // This default version is called when kTypeKind is kOtherType.
9327  static void PrintValue(const T& value, ::std::ostream* os) {
9328    PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
9329                         sizeof(value), os);
9330  }
9331};
9332
9333// We print a protobuf using its ShortDebugString() when the string
9334// doesn't exceed this many characters; otherwise we print it using
9335// DebugString() for better readability.
9336const size_t kProtobufOneLinerMaxLength = 50;
9337
9338template <typename T>
9339class TypeWithoutFormatter<T, kProtobuf> {
9340 public:
9341  static void PrintValue(const T& value, ::std::ostream* os) {
9342    const ::testing::internal::string short_str = value.ShortDebugString();
9343    const ::testing::internal::string pretty_str =
9344        short_str.length() <= kProtobufOneLinerMaxLength ?
9345        short_str : ("\n" + value.DebugString());
9346    *os << ("<" + pretty_str + ">");
9347  }
9348};
9349
9350template <typename T>
9351class TypeWithoutFormatter<T, kConvertibleToInteger> {
9352 public:
9353  // Since T has no << operator or PrintTo() but can be implicitly
9354  // converted to BiggestInt, we print it as a BiggestInt.
9355  //
9356  // Most likely T is an enum type (either named or unnamed), in which
9357  // case printing it as an integer is the desired behavior.  In case
9358  // T is not an enum, printing it as an integer is the best we can do
9359  // given that it has no user-defined printer.
9360  static void PrintValue(const T& value, ::std::ostream* os) {
9361    const internal::BiggestInt kBigInt = value;
9362    *os << kBigInt;
9363  }
9364};
9365
9366// Prints the given value to the given ostream.  If the value is a
9367// protocol message, its debug string is printed; if it's an enum or
9368// of a type implicitly convertible to BiggestInt, it's printed as an
9369// integer; otherwise the bytes in the value are printed.  This is
9370// what UniversalPrinter<T>::Print() does when it knows nothing about
9371// type T and T has neither << operator nor PrintTo().
9372//
9373// A user can override this behavior for a class type Foo by defining
9374// a << operator in the namespace where Foo is defined.
9375//
9376// We put this operator in namespace 'internal2' instead of 'internal'
9377// to simplify the implementation, as much code in 'internal' needs to
9378// use << in STL, which would conflict with our own << were it defined
9379// in 'internal'.
9380//
9381// Note that this operator<< takes a generic std::basic_ostream<Char,
9382// CharTraits> type instead of the more restricted std::ostream.  If
9383// we define it to take an std::ostream instead, we'll get an
9384// "ambiguous overloads" compiler error when trying to print a type
9385// Foo that supports streaming to std::basic_ostream<Char,
9386// CharTraits>, as the compiler cannot tell whether
9387// operator<<(std::ostream&, const T&) or
9388// operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
9389// specific.
9390template <typename Char, typename CharTraits, typename T>
9391::std::basic_ostream<Char, CharTraits>& operator<<(
9392    ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
9393  TypeWithoutFormatter<T,
9394      (internal::IsAProtocolMessage<T>::value ? kProtobuf :
9395       internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
9396       kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
9397  return os;
9398}
9399
9400}  // namespace internal2
9401}  // namespace testing
9402
9403// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
9404// magic needed for implementing UniversalPrinter won't work.
9405namespace testing_internal {
9406
9407// Used to print a value that is not an STL-style container when the
9408// user doesn't define PrintTo() for it.
9409template <typename T>
9410void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
9411  // With the following statement, during unqualified name lookup,
9412  // testing::internal2::operator<< appears as if it was declared in
9413  // the nearest enclosing namespace that contains both
9414  // ::testing_internal and ::testing::internal2, i.e. the global
9415  // namespace.  For more details, refer to the C++ Standard section
9416  // 7.3.4-1 [namespace.udir].  This allows us to fall back onto
9417  // testing::internal2::operator<< in case T doesn't come with a <<
9418  // operator.
9419  //
9420  // We cannot write 'using ::testing::internal2::operator<<;', which
9421  // gcc 3.3 fails to compile due to a compiler bug.
9422  using namespace ::testing::internal2;  // NOLINT
9423
9424  // Assuming T is defined in namespace foo, in the next statement,
9425  // the compiler will consider all of:
9426  //
9427  //   1. foo::operator<< (thanks to Koenig look-up),
9428  //   2. ::operator<< (as the current namespace is enclosed in ::),
9429  //   3. testing::internal2::operator<< (thanks to the using statement above).
9430  //
9431  // The operator<< whose type matches T best will be picked.
9432  //
9433  // We deliberately allow #2 to be a candidate, as sometimes it's
9434  // impossible to define #1 (e.g. when foo is ::std, defining
9435  // anything in it is undefined behavior unless you are a compiler
9436  // vendor.).
9437  *os << value;
9438}
9439
9440}  // namespace testing_internal
9441
9442namespace testing {
9443namespace internal {
9444
9445// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
9446// value to the given ostream.  The caller must ensure that
9447// 'ostream_ptr' is not NULL, or the behavior is undefined.
9448//
9449// We define UniversalPrinter as a class template (as opposed to a
9450// function template), as we need to partially specialize it for
9451// reference types, which cannot be done with function templates.
9452template <typename T>
9453class UniversalPrinter;
9454
9455template <typename T>
9456void UniversalPrint(const T& value, ::std::ostream* os);
9457
9458// Used to print an STL-style container when the user doesn't define
9459// a PrintTo() for it.
9460template <typename C>
9461void DefaultPrintTo(IsContainer /* dummy */,
9462                    false_type /* is not a pointer */,
9463                    const C& container, ::std::ostream* os) {
9464  const size_t kMaxCount = 32;  // The maximum number of elements to print.
9465  *os << '{';
9466  size_t count = 0;
9467  for (typename C::const_iterator it = container.begin();
9468       it != container.end(); ++it, ++count) {
9469    if (count > 0) {
9470      *os << ',';
9471      if (count == kMaxCount) {  // Enough has been printed.
9472        *os << " ...";
9473        break;
9474      }
9475    }
9476    *os << ' ';
9477    // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
9478    // handle *it being a native array.
9479    internal::UniversalPrint(*it, os);
9480  }
9481
9482  if (count > 0) {
9483    *os << ' ';
9484  }
9485  *os << '}';
9486}
9487
9488// Used to print a pointer that is neither a char pointer nor a member
9489// pointer, when the user doesn't define PrintTo() for it.  (A member
9490// variable pointer or member function pointer doesn't really point to
9491// a location in the address space.  Their representation is
9492// implementation-defined.  Therefore they will be printed as raw
9493// bytes.)
9494template <typename T>
9495void DefaultPrintTo(IsNotContainer /* dummy */,
9496                    true_type /* is a pointer */,
9497                    T* p, ::std::ostream* os) {
9498  if (p == NULL) {
9499    *os << "NULL";
9500  } else {
9501    // C++ doesn't allow casting from a function pointer to any object
9502    // pointer.
9503    //
9504    // IsTrue() silences warnings: "Condition is always true",
9505    // "unreachable code".
9506    if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
9507      // T is not a function type.  We just call << to print p,
9508      // relying on ADL to pick up user-defined << for their pointer
9509      // types, if any.
9510      *os << p;
9511    } else {
9512      // T is a function type, so '*os << p' doesn't do what we want
9513      // (it just prints p as bool).  We want to print p as a const
9514      // void*.  However, we cannot cast it to const void* directly,
9515      // even using reinterpret_cast, as earlier versions of gcc
9516      // (e.g. 3.4.5) cannot compile the cast when p is a function
9517      // pointer.  Casting to UInt64 first solves the problem.
9518      *os << reinterpret_cast<const void*>(
9519          reinterpret_cast<internal::UInt64>(p));
9520    }
9521  }
9522}
9523
9524// Used to print a non-container, non-pointer value when the user
9525// doesn't define PrintTo() for it.
9526template <typename T>
9527void DefaultPrintTo(IsNotContainer /* dummy */,
9528                    false_type /* is not a pointer */,
9529                    const T& value, ::std::ostream* os) {
9530  ::testing_internal::DefaultPrintNonContainerTo(value, os);
9531}
9532
9533// Prints the given value using the << operator if it has one;
9534// otherwise prints the bytes in it.  This is what
9535// UniversalPrinter<T>::Print() does when PrintTo() is not specialized
9536// or overloaded for type T.
9537//
9538// A user can override this behavior for a class type Foo by defining
9539// an overload of PrintTo() in the namespace where Foo is defined.  We
9540// give the user this option as sometimes defining a << operator for
9541// Foo is not desirable (e.g. the coding style may prevent doing it,
9542// or there is already a << operator but it doesn't do what the user
9543// wants).
9544template <typename T>
9545void PrintTo(const T& value, ::std::ostream* os) {
9546  // DefaultPrintTo() is overloaded.  The type of its first two
9547  // arguments determine which version will be picked.  If T is an
9548  // STL-style container, the version for container will be called; if
9549  // T is a pointer, the pointer version will be called; otherwise the
9550  // generic version will be called.
9551  //
9552  // Note that we check for container types here, prior to we check
9553  // for protocol message types in our operator<<.  The rationale is:
9554  //
9555  // For protocol messages, we want to give people a chance to
9556  // override Google Mock's format by defining a PrintTo() or
9557  // operator<<.  For STL containers, other formats can be
9558  // incompatible with Google Mock's format for the container
9559  // elements; therefore we check for container types here to ensure
9560  // that our format is used.
9561  //
9562  // The second argument of DefaultPrintTo() is needed to bypass a bug
9563  // in Symbian's C++ compiler that prevents it from picking the right
9564  // overload between:
9565  //
9566  //   PrintTo(const T& x, ...);
9567  //   PrintTo(T* x, ...);
9568  DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
9569}
9570
9571// The following list of PrintTo() overloads tells
9572// UniversalPrinter<T>::Print() how to print standard types (built-in
9573// types, strings, plain arrays, and pointers).
9574
9575// Overloads for various char types.
9576GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
9577GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
9578inline void PrintTo(char c, ::std::ostream* os) {
9579  // When printing a plain char, we always treat it as unsigned.  This
9580  // way, the output won't be affected by whether the compiler thinks
9581  // char is signed or not.
9582  PrintTo(static_cast<unsigned char>(c), os);
9583}
9584
9585// Overloads for other simple built-in types.
9586inline void PrintTo(bool x, ::std::ostream* os) {
9587  *os << (x ? "true" : "false");
9588}
9589
9590// Overload for wchar_t type.
9591// Prints a wchar_t as a symbol if it is printable or as its internal
9592// code otherwise and also as its decimal code (except for L'\0').
9593// The L'\0' char is printed as "L'\\0'". The decimal code is printed
9594// as signed integer when wchar_t is implemented by the compiler
9595// as a signed type and is printed as an unsigned integer when wchar_t
9596// is implemented as an unsigned type.
9597GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
9598
9599// Overloads for C strings.
9600GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
9601inline void PrintTo(char* s, ::std::ostream* os) {
9602  PrintTo(ImplicitCast_<const char*>(s), os);
9603}
9604
9605// signed/unsigned char is often used for representing binary data, so
9606// we print pointers to it as void* to be safe.
9607inline void PrintTo(const signed char* s, ::std::ostream* os) {
9608  PrintTo(ImplicitCast_<const void*>(s), os);
9609}
9610inline void PrintTo(signed char* s, ::std::ostream* os) {
9611  PrintTo(ImplicitCast_<const void*>(s), os);
9612}
9613inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
9614  PrintTo(ImplicitCast_<const void*>(s), os);
9615}
9616inline void PrintTo(unsigned char* s, ::std::ostream* os) {
9617  PrintTo(ImplicitCast_<const void*>(s), os);
9618}
9619
9620// MSVC can be configured to define wchar_t as a typedef of unsigned
9621// short.  It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
9622// type.  When wchar_t is a typedef, defining an overload for const
9623// wchar_t* would cause unsigned short* be printed as a wide string,
9624// possibly causing invalid memory accesses.
9625#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
9626// Overloads for wide C strings
9627GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
9628inline void PrintTo(wchar_t* s, ::std::ostream* os) {
9629  PrintTo(ImplicitCast_<const wchar_t*>(s), os);
9630}
9631#endif
9632
9633// Overload for C arrays.  Multi-dimensional arrays are printed
9634// properly.
9635
9636// Prints the given number of elements in an array, without printing
9637// the curly braces.
9638template <typename T>
9639void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
9640  UniversalPrint(a[0], os);
9641  for (size_t i = 1; i != count; i++) {
9642    *os << ", ";
9643    UniversalPrint(a[i], os);
9644  }
9645}
9646
9647// Overloads for ::string and ::std::string.
9648#if GTEST_HAS_GLOBAL_STRING
9649GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
9650inline void PrintTo(const ::string& s, ::std::ostream* os) {
9651  PrintStringTo(s, os);
9652}
9653#endif  // GTEST_HAS_GLOBAL_STRING
9654
9655GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
9656inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
9657  PrintStringTo(s, os);
9658}
9659
9660// Overloads for ::wstring and ::std::wstring.
9661#if GTEST_HAS_GLOBAL_WSTRING
9662GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
9663inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
9664  PrintWideStringTo(s, os);
9665}
9666#endif  // GTEST_HAS_GLOBAL_WSTRING
9667
9668#if GTEST_HAS_STD_WSTRING
9669GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
9670inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
9671  PrintWideStringTo(s, os);
9672}
9673#endif  // GTEST_HAS_STD_WSTRING
9674
9675#if GTEST_HAS_TR1_TUPLE
9676// Overload for ::std::tr1::tuple.  Needed for printing function arguments,
9677// which are packed as tuples.
9678
9679// Helper function for printing a tuple.  T must be instantiated with
9680// a tuple type.
9681template <typename T>
9682void PrintTupleTo(const T& t, ::std::ostream* os);
9683
9684// Overloaded PrintTo() for tuples of various arities.  We support
9685// tuples of up-to 10 fields.  The following implementation works
9686// regardless of whether tr1::tuple is implemented using the
9687// non-standard variadic template feature or not.
9688
9689inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
9690  PrintTupleTo(t, os);
9691}
9692
9693template <typename T1>
9694void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
9695  PrintTupleTo(t, os);
9696}
9697
9698template <typename T1, typename T2>
9699void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
9700  PrintTupleTo(t, os);
9701}
9702
9703template <typename T1, typename T2, typename T3>
9704void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
9705  PrintTupleTo(t, os);
9706}
9707
9708template <typename T1, typename T2, typename T3, typename T4>
9709void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
9710  PrintTupleTo(t, os);
9711}
9712
9713template <typename T1, typename T2, typename T3, typename T4, typename T5>
9714void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
9715             ::std::ostream* os) {
9716  PrintTupleTo(t, os);
9717}
9718
9719template <typename T1, typename T2, typename T3, typename T4, typename T5,
9720          typename T6>
9721void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
9722             ::std::ostream* os) {
9723  PrintTupleTo(t, os);
9724}
9725
9726template <typename T1, typename T2, typename T3, typename T4, typename T5,
9727          typename T6, typename T7>
9728void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
9729             ::std::ostream* os) {
9730  PrintTupleTo(t, os);
9731}
9732
9733template <typename T1, typename T2, typename T3, typename T4, typename T5,
9734          typename T6, typename T7, typename T8>
9735void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
9736             ::std::ostream* os) {
9737  PrintTupleTo(t, os);
9738}
9739
9740template <typename T1, typename T2, typename T3, typename T4, typename T5,
9741          typename T6, typename T7, typename T8, typename T9>
9742void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
9743             ::std::ostream* os) {
9744  PrintTupleTo(t, os);
9745}
9746
9747template <typename T1, typename T2, typename T3, typename T4, typename T5,
9748          typename T6, typename T7, typename T8, typename T9, typename T10>
9749void PrintTo(
9750    const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
9751    ::std::ostream* os) {
9752  PrintTupleTo(t, os);
9753}
9754#endif  // GTEST_HAS_TR1_TUPLE
9755
9756// Overload for std::pair.
9757template <typename T1, typename T2>
9758void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
9759  *os << '(';
9760  // We cannot use UniversalPrint(value.first, os) here, as T1 may be
9761  // a reference type.  The same for printing value.second.
9762  UniversalPrinter<T1>::Print(value.first, os);
9763  *os << ", ";
9764  UniversalPrinter<T2>::Print(value.second, os);
9765  *os << ')';
9766}
9767
9768// Implements printing a non-reference type T by letting the compiler
9769// pick the right overload of PrintTo() for T.
9770template <typename T>
9771class UniversalPrinter {
9772 public:
9773  // MSVC warns about adding const to a function type, so we want to
9774  // disable the warning.
9775#ifdef _MSC_VER
9776# pragma warning(push)          // Saves the current warning state.
9777# pragma warning(disable:4180)  // Temporarily disables warning 4180.
9778#endif  // _MSC_VER
9779
9780  // Note: we deliberately don't call this PrintTo(), as that name
9781  // conflicts with ::testing::internal::PrintTo in the body of the
9782  // function.
9783  static void Print(const T& value, ::std::ostream* os) {
9784    // By default, ::testing::internal::PrintTo() is used for printing
9785    // the value.
9786    //
9787    // Thanks to Koenig look-up, if T is a class and has its own
9788    // PrintTo() function defined in its namespace, that function will
9789    // be visible here.  Since it is more specific than the generic ones
9790    // in ::testing::internal, it will be picked by the compiler in the
9791    // following statement - exactly what we want.
9792    PrintTo(value, os);
9793  }
9794
9795#ifdef _MSC_VER
9796# pragma warning(pop)           // Restores the warning state.
9797#endif  // _MSC_VER
9798};
9799
9800// UniversalPrintArray(begin, len, os) prints an array of 'len'
9801// elements, starting at address 'begin'.
9802template <typename T>
9803void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
9804  if (len == 0) {
9805    *os << "{}";
9806  } else {
9807    *os << "{ ";
9808    const size_t kThreshold = 18;
9809    const size_t kChunkSize = 8;
9810    // If the array has more than kThreshold elements, we'll have to
9811    // omit some details by printing only the first and the last
9812    // kChunkSize elements.
9813    // TODO(wan@google.com): let the user control the threshold using a flag.
9814    if (len <= kThreshold) {
9815      PrintRawArrayTo(begin, len, os);
9816    } else {
9817      PrintRawArrayTo(begin, kChunkSize, os);
9818      *os << ", ..., ";
9819      PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
9820    }
9821    *os << " }";
9822  }
9823}
9824// This overload prints a (const) char array compactly.
9825GTEST_API_ void UniversalPrintArray(
9826    const char* begin, size_t len, ::std::ostream* os);
9827
9828// This overload prints a (const) wchar_t array compactly.
9829GTEST_API_ void UniversalPrintArray(
9830    const wchar_t* begin, size_t len, ::std::ostream* os);
9831
9832// Implements printing an array type T[N].
9833template <typename T, size_t N>
9834class UniversalPrinter<T[N]> {
9835 public:
9836  // Prints the given array, omitting some elements when there are too
9837  // many.
9838  static void Print(const T (&a)[N], ::std::ostream* os) {
9839    UniversalPrintArray(a, N, os);
9840  }
9841};
9842
9843// Implements printing a reference type T&.
9844template <typename T>
9845class UniversalPrinter<T&> {
9846 public:
9847  // MSVC warns about adding const to a function type, so we want to
9848  // disable the warning.
9849#ifdef _MSC_VER
9850# pragma warning(push)          // Saves the current warning state.
9851# pragma warning(disable:4180)  // Temporarily disables warning 4180.
9852#endif  // _MSC_VER
9853
9854  static void Print(const T& value, ::std::ostream* os) {
9855    // Prints the address of the value.  We use reinterpret_cast here
9856    // as static_cast doesn't compile when T is a function type.
9857    *os << "@" << reinterpret_cast<const void*>(&value) << " ";
9858
9859    // Then prints the value itself.
9860    UniversalPrint(value, os);
9861  }
9862
9863#ifdef _MSC_VER
9864# pragma warning(pop)           // Restores the warning state.
9865#endif  // _MSC_VER
9866};
9867
9868// Prints a value tersely: for a reference type, the referenced value
9869// (but not the address) is printed; for a (const) char pointer, the
9870// NUL-terminated string (but not the pointer) is printed.
9871
9872template <typename T>
9873class UniversalTersePrinter {
9874 public:
9875  static void Print(const T& value, ::std::ostream* os) {
9876    UniversalPrint(value, os);
9877  }
9878};
9879template <typename T>
9880class UniversalTersePrinter<T&> {
9881 public:
9882  static void Print(const T& value, ::std::ostream* os) {
9883    UniversalPrint(value, os);
9884  }
9885};
9886template <typename T, size_t N>
9887class UniversalTersePrinter<T[N]> {
9888 public:
9889  static void Print(const T (&value)[N], ::std::ostream* os) {
9890    UniversalPrinter<T[N]>::Print(value, os);
9891  }
9892};
9893template <>
9894class UniversalTersePrinter<const char*> {
9895 public:
9896  static void Print(const char* str, ::std::ostream* os) {
9897    if (str == NULL) {
9898      *os << "NULL";
9899    } else {
9900      UniversalPrint(string(str), os);
9901    }
9902  }
9903};
9904template <>
9905class UniversalTersePrinter<char*> {
9906 public:
9907  static void Print(char* str, ::std::ostream* os) {
9908    UniversalTersePrinter<const char*>::Print(str, os);
9909  }
9910};
9911
9912#if GTEST_HAS_STD_WSTRING
9913template <>
9914class UniversalTersePrinter<const wchar_t*> {
9915 public:
9916  static void Print(const wchar_t* str, ::std::ostream* os) {
9917    if (str == NULL) {
9918      *os << "NULL";
9919    } else {
9920      UniversalPrint(::std::wstring(str), os);
9921    }
9922  }
9923};
9924#endif
9925
9926template <>
9927class UniversalTersePrinter<wchar_t*> {
9928 public:
9929  static void Print(wchar_t* str, ::std::ostream* os) {
9930    UniversalTersePrinter<const wchar_t*>::Print(str, os);
9931  }
9932};
9933
9934template <typename T>
9935void UniversalTersePrint(const T& value, ::std::ostream* os) {
9936  UniversalTersePrinter<T>::Print(value, os);
9937}
9938
9939// Prints a value using the type inferred by the compiler.  The
9940// difference between this and UniversalTersePrint() is that for a
9941// (const) char pointer, this prints both the pointer and the
9942// NUL-terminated string.
9943template <typename T>
9944void UniversalPrint(const T& value, ::std::ostream* os) {
9945  // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
9946  // UniversalPrinter with T directly.
9947  typedef T T1;
9948  UniversalPrinter<T1>::Print(value, os);
9949}
9950
9951#if GTEST_HAS_TR1_TUPLE
9952typedef ::std::vector<string> Strings;
9953
9954// This helper template allows PrintTo() for tuples and
9955// UniversalTersePrintTupleFieldsToStrings() to be defined by
9956// induction on the number of tuple fields.  The idea is that
9957// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
9958// fields in tuple t, and can be defined in terms of
9959// TuplePrefixPrinter<N - 1>.
9960
9961// The inductive case.
9962template <size_t N>
9963struct TuplePrefixPrinter {
9964  // Prints the first N fields of a tuple.
9965  template <typename Tuple>
9966  static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
9967    TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
9968    *os << ", ";
9969    UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
9970        ::Print(::std::tr1::get<N - 1>(t), os);
9971  }
9972
9973  // Tersely prints the first N fields of a tuple to a string vector,
9974  // one element for each field.
9975  template <typename Tuple>
9976  static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
9977    TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
9978    ::std::stringstream ss;
9979    UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
9980    strings->push_back(ss.str());
9981  }
9982};
9983
9984// Base cases.
9985template <>
9986struct TuplePrefixPrinter<0> {
9987  template <typename Tuple>
9988  static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
9989
9990  template <typename Tuple>
9991  static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
9992};
9993// We have to specialize the entire TuplePrefixPrinter<> class
9994// template here, even though the definition of
9995// TersePrintPrefixToStrings() is the same as the generic version, as
9996// Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
9997// support specializing a method template of a class template.
9998template <>
9999struct TuplePrefixPrinter<1> {
10000  template <typename Tuple>
10001  static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
10002    UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
10003        Print(::std::tr1::get<0>(t), os);
10004  }
10005
10006  template <typename Tuple>
10007  static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
10008    ::std::stringstream ss;
10009    UniversalTersePrint(::std::tr1::get<0>(t), &ss);
10010    strings->push_back(ss.str());
10011  }
10012};
10013
10014// Helper function for printing a tuple.  T must be instantiated with
10015// a tuple type.
10016template <typename T>
10017void PrintTupleTo(const T& t, ::std::ostream* os) {
10018  *os << "(";
10019  TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
10020      PrintPrefixTo(t, os);
10021  *os << ")";
10022}
10023
10024// Prints the fields of a tuple tersely to a string vector, one
10025// element for each field.  See the comment before
10026// UniversalTersePrint() for how we define "tersely".
10027template <typename Tuple>
10028Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
10029  Strings result;
10030  TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
10031      TersePrintPrefixToStrings(value, &result);
10032  return result;
10033}
10034#endif  // GTEST_HAS_TR1_TUPLE
10035
10036}  // namespace internal
10037
10038template <typename T>
10039::std::string PrintToString(const T& value) {
10040  ::std::stringstream ss;
10041  internal::UniversalTersePrinter<T>::Print(value, &ss);
10042  return ss.str();
10043}
10044
10045}  // namespace testing
10046
10047#endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10048
10049#if GTEST_HAS_PARAM_TEST
10050
10051namespace testing {
10052namespace internal {
10053
10054// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10055//
10056// Outputs a message explaining invalid registration of different
10057// fixture class for the same test case. This may happen when
10058// TEST_P macro is used to define two tests with the same name
10059// but in different namespaces.
10060GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
10061                                          const char* file, int line);
10062
10063template <typename> class ParamGeneratorInterface;
10064template <typename> class ParamGenerator;
10065
10066// Interface for iterating over elements provided by an implementation
10067// of ParamGeneratorInterface<T>.
10068template <typename T>
10069class ParamIteratorInterface {
10070 public:
10071  virtual ~ParamIteratorInterface() {}
10072  // A pointer to the base generator instance.
10073  // Used only for the purposes of iterator comparison
10074  // to make sure that two iterators belong to the same generator.
10075  virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
10076  // Advances iterator to point to the next element
10077  // provided by the generator. The caller is responsible
10078  // for not calling Advance() on an iterator equal to
10079  // BaseGenerator()->End().
10080  virtual void Advance() = 0;
10081  // Clones the iterator object. Used for implementing copy semantics
10082  // of ParamIterator<T>.
10083  virtual ParamIteratorInterface* Clone() const = 0;
10084  // Dereferences the current iterator and provides (read-only) access
10085  // to the pointed value. It is the caller's responsibility not to call
10086  // Current() on an iterator equal to BaseGenerator()->End().
10087  // Used for implementing ParamGenerator<T>::operator*().
10088  virtual const T* Current() const = 0;
10089  // Determines whether the given iterator and other point to the same
10090  // element in the sequence generated by the generator.
10091  // Used for implementing ParamGenerator<T>::operator==().
10092  virtual bool Equals(const ParamIteratorInterface& other) const = 0;
10093};
10094
10095// Class iterating over elements provided by an implementation of
10096// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
10097// and implements the const forward iterator concept.
10098template <typename T>
10099class ParamIterator {
10100 public:
10101  typedef T value_type;
10102  typedef const T& reference;
10103  typedef ptrdiff_t difference_type;
10104
10105  // ParamIterator assumes ownership of the impl_ pointer.
10106  ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
10107  ParamIterator& operator=(const ParamIterator& other) {
10108    if (this != &other)
10109      impl_.reset(other.impl_->Clone());
10110    return *this;
10111  }
10112
10113  const T& operator*() const { return *impl_->Current(); }
10114  const T* operator->() const { return impl_->Current(); }
10115  // Prefix version of operator++.
10116  ParamIterator& operator++() {
10117    impl_->Advance();
10118    return *this;
10119  }
10120  // Postfix version of operator++.
10121  ParamIterator operator++(int /*unused*/) {
10122    ParamIteratorInterface<T>* clone = impl_->Clone();
10123    impl_->Advance();
10124    return ParamIterator(clone);
10125  }
10126  bool operator==(const ParamIterator& other) const {
10127    return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
10128  }
10129  bool operator!=(const ParamIterator& other) const {
10130    return !(*this == other);
10131  }
10132
10133 private:
10134  friend class ParamGenerator<T>;
10135  explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
10136  scoped_ptr<ParamIteratorInterface<T> > impl_;
10137};
10138
10139// ParamGeneratorInterface<T> is the binary interface to access generators
10140// defined in other translation units.
10141template <typename T>
10142class ParamGeneratorInterface {
10143 public:
10144  typedef T ParamType;
10145
10146  virtual ~ParamGeneratorInterface() {}
10147
10148  // Generator interface definition
10149  virtual ParamIteratorInterface<T>* Begin() const = 0;
10150  virtual ParamIteratorInterface<T>* End() const = 0;
10151};
10152
10153// Wraps ParamGeneratorInterface<T> and provides general generator syntax
10154// compatible with the STL Container concept.
10155// This class implements copy initialization semantics and the contained
10156// ParamGeneratorInterface<T> instance is shared among all copies
10157// of the original object. This is possible because that instance is immutable.
10158template<typename T>
10159class ParamGenerator {
10160 public:
10161  typedef ParamIterator<T> iterator;
10162
10163  explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
10164  ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
10165
10166  ParamGenerator& operator=(const ParamGenerator& other) {
10167    impl_ = other.impl_;
10168    return *this;
10169  }
10170
10171  iterator begin() const { return iterator(impl_->Begin()); }
10172  iterator end() const { return iterator(impl_->End()); }
10173
10174 private:
10175  linked_ptr<const ParamGeneratorInterface<T> > impl_;
10176};
10177
10178// Generates values from a range of two comparable values. Can be used to
10179// generate sequences of user-defined types that implement operator+() and
10180// operator<().
10181// This class is used in the Range() function.
10182template <typename T, typename IncrementT>
10183class RangeGenerator : public ParamGeneratorInterface<T> {
10184 public:
10185  RangeGenerator(T begin, T end, IncrementT step)
10186      : begin_(begin), end_(end),
10187        step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
10188  virtual ~RangeGenerator() {}
10189
10190  virtual ParamIteratorInterface<T>* Begin() const {
10191    return new Iterator(this, begin_, 0, step_);
10192  }
10193  virtual ParamIteratorInterface<T>* End() const {
10194    return new Iterator(this, end_, end_index_, step_);
10195  }
10196
10197 private:
10198  class Iterator : public ParamIteratorInterface<T> {
10199   public:
10200    Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
10201             IncrementT step)
10202        : base_(base), value_(value), index_(index), step_(step) {}
10203    virtual ~Iterator() {}
10204
10205    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10206      return base_;
10207    }
10208    virtual void Advance() {
10209      value_ = value_ + step_;
10210      index_++;
10211    }
10212    virtual ParamIteratorInterface<T>* Clone() const {
10213      return new Iterator(*this);
10214    }
10215    virtual const T* Current() const { return &value_; }
10216    virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10217      // Having the same base generator guarantees that the other
10218      // iterator is of the same type and we can downcast.
10219      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10220          << "The program attempted to compare iterators "
10221          << "from different generators." << std::endl;
10222      const int other_index =
10223          CheckedDowncastToActualType<const Iterator>(&other)->index_;
10224      return index_ == other_index;
10225    }
10226
10227   private:
10228    Iterator(const Iterator& other)
10229        : ParamIteratorInterface<T>(),
10230          base_(other.base_), value_(other.value_), index_(other.index_),
10231          step_(other.step_) {}
10232
10233    // No implementation - assignment is unsupported.
10234    void operator=(const Iterator& other);
10235
10236    const ParamGeneratorInterface<T>* const base_;
10237    T value_;
10238    int index_;
10239    const IncrementT step_;
10240  };  // class RangeGenerator::Iterator
10241
10242  static int CalculateEndIndex(const T& begin,
10243                               const T& end,
10244                               const IncrementT& step) {
10245    int end_index = 0;
10246    for (T i = begin; i < end; i = i + step)
10247      end_index++;
10248    return end_index;
10249  }
10250
10251  // No implementation - assignment is unsupported.
10252  void operator=(const RangeGenerator& other);
10253
10254  const T begin_;
10255  const T end_;
10256  const IncrementT step_;
10257  // The index for the end() iterator. All the elements in the generated
10258  // sequence are indexed (0-based) to aid iterator comparison.
10259  const int end_index_;
10260};  // class RangeGenerator
10261
10262
10263// Generates values from a pair of STL-style iterators. Used in the
10264// ValuesIn() function. The elements are copied from the source range
10265// since the source can be located on the stack, and the generator
10266// is likely to persist beyond that stack frame.
10267template <typename T>
10268class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
10269 public:
10270  template <typename ForwardIterator>
10271  ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
10272      : container_(begin, end) {}
10273  virtual ~ValuesInIteratorRangeGenerator() {}
10274
10275  virtual ParamIteratorInterface<T>* Begin() const {
10276    return new Iterator(this, container_.begin());
10277  }
10278  virtual ParamIteratorInterface<T>* End() const {
10279    return new Iterator(this, container_.end());
10280  }
10281
10282 private:
10283  typedef typename ::std::vector<T> ContainerType;
10284
10285  class Iterator : public ParamIteratorInterface<T> {
10286   public:
10287    Iterator(const ParamGeneratorInterface<T>* base,
10288             typename ContainerType::const_iterator iterator)
10289        : base_(base), iterator_(iterator) {}
10290    virtual ~Iterator() {}
10291
10292    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10293      return base_;
10294    }
10295    virtual void Advance() {
10296      ++iterator_;
10297      value_.reset();
10298    }
10299    virtual ParamIteratorInterface<T>* Clone() const {
10300      return new Iterator(*this);
10301    }
10302    // We need to use cached value referenced by iterator_ because *iterator_
10303    // can return a temporary object (and of type other then T), so just
10304    // having "return &*iterator_;" doesn't work.
10305    // value_ is updated here and not in Advance() because Advance()
10306    // can advance iterator_ beyond the end of the range, and we cannot
10307    // detect that fact. The client code, on the other hand, is
10308    // responsible for not calling Current() on an out-of-range iterator.
10309    virtual const T* Current() const {
10310      if (value_.get() == NULL)
10311        value_.reset(new T(*iterator_));
10312      return value_.get();
10313    }
10314    virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10315      // Having the same base generator guarantees that the other
10316      // iterator is of the same type and we can downcast.
10317      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10318          << "The program attempted to compare iterators "
10319          << "from different generators." << std::endl;
10320      return iterator_ ==
10321          CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
10322    }
10323
10324   private:
10325    Iterator(const Iterator& other)
10326          // The explicit constructor call suppresses a false warning
10327          // emitted by gcc when supplied with the -Wextra option.
10328        : ParamIteratorInterface<T>(),
10329          base_(other.base_),
10330          iterator_(other.iterator_) {}
10331
10332    const ParamGeneratorInterface<T>* const base_;
10333    typename ContainerType::const_iterator iterator_;
10334    // A cached value of *iterator_. We keep it here to allow access by
10335    // pointer in the wrapping iterator's operator->().
10336    // value_ needs to be mutable to be accessed in Current().
10337    // Use of scoped_ptr helps manage cached value's lifetime,
10338    // which is bound by the lifespan of the iterator itself.
10339    mutable scoped_ptr<const T> value_;
10340  };  // class ValuesInIteratorRangeGenerator::Iterator
10341
10342  // No implementation - assignment is unsupported.
10343  void operator=(const ValuesInIteratorRangeGenerator& other);
10344
10345  const ContainerType container_;
10346};  // class ValuesInIteratorRangeGenerator
10347
10348// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10349//
10350// Stores a parameter value and later creates tests parameterized with that
10351// value.
10352template <class TestClass>
10353class ParameterizedTestFactory : public TestFactoryBase {
10354 public:
10355  typedef typename TestClass::ParamType ParamType;
10356  explicit ParameterizedTestFactory(ParamType parameter) :
10357      parameter_(parameter) {}
10358  virtual Test* CreateTest() {
10359    TestClass::SetParam(&parameter_);
10360    return new TestClass();
10361  }
10362
10363 private:
10364  const ParamType parameter_;
10365
10366  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
10367};
10368
10369// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10370//
10371// TestMetaFactoryBase is a base class for meta-factories that create
10372// test factories for passing into MakeAndRegisterTestInfo function.
10373template <class ParamType>
10374class TestMetaFactoryBase {
10375 public:
10376  virtual ~TestMetaFactoryBase() {}
10377
10378  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
10379};
10380
10381// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10382//
10383// TestMetaFactory creates test factories for passing into
10384// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
10385// ownership of test factory pointer, same factory object cannot be passed
10386// into that method twice. But ParameterizedTestCaseInfo is going to call
10387// it for each Test/Parameter value combination. Thus it needs meta factory
10388// creator class.
10389template <class TestCase>
10390class TestMetaFactory
10391    : public TestMetaFactoryBase<typename TestCase::ParamType> {
10392 public:
10393  typedef typename TestCase::ParamType ParamType;
10394
10395  TestMetaFactory() {}
10396
10397  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
10398    return new ParameterizedTestFactory<TestCase>(parameter);
10399  }
10400
10401 private:
10402  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
10403};
10404
10405// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10406//
10407// ParameterizedTestCaseInfoBase is a generic interface
10408// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
10409// accumulates test information provided by TEST_P macro invocations
10410// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
10411// and uses that information to register all resulting test instances
10412// in RegisterTests method. The ParameterizeTestCaseRegistry class holds
10413// a collection of pointers to the ParameterizedTestCaseInfo objects
10414// and calls RegisterTests() on each of them when asked.
10415class ParameterizedTestCaseInfoBase {
10416 public:
10417  virtual ~ParameterizedTestCaseInfoBase() {}
10418
10419  // Base part of test case name for display purposes.
10420  virtual const string& GetTestCaseName() const = 0;
10421  // Test case id to verify identity.
10422  virtual TypeId GetTestCaseTypeId() const = 0;
10423  // UnitTest class invokes this method to register tests in this
10424  // test case right before running them in RUN_ALL_TESTS macro.
10425  // This method should not be called more then once on any single
10426  // instance of a ParameterizedTestCaseInfoBase derived class.
10427  virtual void RegisterTests() = 0;
10428
10429 protected:
10430  ParameterizedTestCaseInfoBase() {}
10431
10432 private:
10433  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
10434};
10435
10436// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10437//
10438// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
10439// macro invocations for a particular test case and generators
10440// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
10441// test case. It registers tests with all values generated by all
10442// generators when asked.
10443template <class TestCase>
10444class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
10445 public:
10446  // ParamType and GeneratorCreationFunc are private types but are required
10447  // for declarations of public methods AddTestPattern() and
10448  // AddTestCaseInstantiation().
10449  typedef typename TestCase::ParamType ParamType;
10450  // A function that returns an instance of appropriate generator type.
10451  typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
10452
10453  explicit ParameterizedTestCaseInfo(const char* name)
10454      : test_case_name_(name) {}
10455
10456  // Test case base name for display purposes.
10457  virtual const string& GetTestCaseName() const { return test_case_name_; }
10458  // Test case id to verify identity.
10459  virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
10460  // TEST_P macro uses AddTestPattern() to record information
10461  // about a single test in a LocalTestInfo structure.
10462  // test_case_name is the base name of the test case (without invocation
10463  // prefix). test_base_name is the name of an individual test without
10464  // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
10465  // test case base name and DoBar is test base name.
10466  void AddTestPattern(const char* test_case_name,
10467                      const char* test_base_name,
10468                      TestMetaFactoryBase<ParamType>* meta_factory) {
10469    tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
10470                                                       test_base_name,
10471                                                       meta_factory)));
10472  }
10473  // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
10474  // about a generator.
10475  int AddTestCaseInstantiation(const string& instantiation_name,
10476                               GeneratorCreationFunc* func,
10477                               const char* /* file */,
10478                               int /* line */) {
10479    instantiations_.push_back(::std::make_pair(instantiation_name, func));
10480    return 0;  // Return value used only to run this method in namespace scope.
10481  }
10482  // UnitTest class invokes this method to register tests in this test case
10483  // test cases right before running tests in RUN_ALL_TESTS macro.
10484  // This method should not be called more then once on any single
10485  // instance of a ParameterizedTestCaseInfoBase derived class.
10486  // UnitTest has a guard to prevent from calling this method more then once.
10487  virtual void RegisterTests() {
10488    for (typename TestInfoContainer::iterator test_it = tests_.begin();
10489         test_it != tests_.end(); ++test_it) {
10490      linked_ptr<TestInfo> test_info = *test_it;
10491      for (typename InstantiationContainer::iterator gen_it =
10492               instantiations_.begin(); gen_it != instantiations_.end();
10493               ++gen_it) {
10494        const string& instantiation_name = gen_it->first;
10495        ParamGenerator<ParamType> generator((*gen_it->second)());
10496
10497        string test_case_name;
10498        if ( !instantiation_name.empty() )
10499          test_case_name = instantiation_name + "/";
10500        test_case_name += test_info->test_case_base_name;
10501
10502        int i = 0;
10503        for (typename ParamGenerator<ParamType>::iterator param_it =
10504                 generator.begin();
10505             param_it != generator.end(); ++param_it, ++i) {
10506          Message test_name_stream;
10507          test_name_stream << test_info->test_base_name << "/" << i;
10508          MakeAndRegisterTestInfo(
10509              test_case_name.c_str(),
10510              test_name_stream.GetString().c_str(),
10511              NULL,  // No type parameter.
10512              PrintToString(*param_it).c_str(),
10513              GetTestCaseTypeId(),
10514              TestCase::SetUpTestCase,
10515              TestCase::TearDownTestCase,
10516              test_info->test_meta_factory->CreateTestFactory(*param_it));
10517        }  // for param_it
10518      }  // for gen_it
10519    }  // for test_it
10520  }  // RegisterTests
10521
10522 private:
10523  // LocalTestInfo structure keeps information about a single test registered
10524  // with TEST_P macro.
10525  struct TestInfo {
10526    TestInfo(const char* a_test_case_base_name,
10527             const char* a_test_base_name,
10528             TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
10529        test_case_base_name(a_test_case_base_name),
10530        test_base_name(a_test_base_name),
10531        test_meta_factory(a_test_meta_factory) {}
10532
10533    const string test_case_base_name;
10534    const string test_base_name;
10535    const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
10536  };
10537  typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
10538  // Keeps pairs of <Instantiation name, Sequence generator creation function>
10539  // received from INSTANTIATE_TEST_CASE_P macros.
10540  typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
10541      InstantiationContainer;
10542
10543  const string test_case_name_;
10544  TestInfoContainer tests_;
10545  InstantiationContainer instantiations_;
10546
10547  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
10548};  // class ParameterizedTestCaseInfo
10549
10550// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10551//
10552// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
10553// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
10554// macros use it to locate their corresponding ParameterizedTestCaseInfo
10555// descriptors.
10556class ParameterizedTestCaseRegistry {
10557 public:
10558  ParameterizedTestCaseRegistry() {}
10559  ~ParameterizedTestCaseRegistry() {
10560    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10561         it != test_case_infos_.end(); ++it) {
10562      delete *it;
10563    }
10564  }
10565
10566  // Looks up or creates and returns a structure containing information about
10567  // tests and instantiations of a particular test case.
10568  template <class TestCase>
10569  ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
10570      const char* test_case_name,
10571      const char* file,
10572      int line) {
10573    ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
10574    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10575         it != test_case_infos_.end(); ++it) {
10576      if ((*it)->GetTestCaseName() == test_case_name) {
10577        if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
10578          // Complain about incorrect usage of Google Test facilities
10579          // and terminate the program since we cannot guaranty correct
10580          // test case setup and tear-down in this case.
10581          ReportInvalidTestCaseType(test_case_name,  file, line);
10582          posix::Abort();
10583        } else {
10584          // At this point we are sure that the object we found is of the same
10585          // type we are looking for, so we downcast it to that type
10586          // without further checks.
10587          typed_test_info = CheckedDowncastToActualType<
10588              ParameterizedTestCaseInfo<TestCase> >(*it);
10589        }
10590        break;
10591      }
10592    }
10593    if (typed_test_info == NULL) {
10594      typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
10595      test_case_infos_.push_back(typed_test_info);
10596    }
10597    return typed_test_info;
10598  }
10599  void RegisterTests() {
10600    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10601         it != test_case_infos_.end(); ++it) {
10602      (*it)->RegisterTests();
10603    }
10604  }
10605
10606 private:
10607  typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
10608
10609  TestCaseInfoContainer test_case_infos_;
10610
10611  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
10612};
10613
10614}  // namespace internal
10615}  // namespace testing
10616
10617#endif  //  GTEST_HAS_PARAM_TEST
10618
10619#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
10620// This file was GENERATED by command:
10621//     pump.py gtest-param-util-generated.h.pump
10622// DO NOT EDIT BY HAND!!!
10623
10624// Copyright 2008 Google Inc.
10625// All Rights Reserved.
10626//
10627// Redistribution and use in source and binary forms, with or without
10628// modification, are permitted provided that the following conditions are
10629// met:
10630//
10631//     * Redistributions of source code must retain the above copyright
10632// notice, this list of conditions and the following disclaimer.
10633//     * Redistributions in binary form must reproduce the above
10634// copyright notice, this list of conditions and the following disclaimer
10635// in the documentation and/or other materials provided with the
10636// distribution.
10637//     * Neither the name of Google Inc. nor the names of its
10638// contributors may be used to endorse or promote products derived from
10639// this software without specific prior written permission.
10640//
10641// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10642// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10643// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10644// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10645// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10646// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10647// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10648// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10649// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10650// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10651// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10652//
10653// Author: vladl@google.com (Vlad Losev)
10654
10655// Type and function utilities for implementing parameterized tests.
10656// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
10657//
10658// Currently Google Test supports at most 50 arguments in Values,
10659// and at most 10 arguments in Combine. Please contact
10660// googletestframework@googlegroups.com if you need more.
10661// Please note that the number of arguments to Combine is limited
10662// by the maximum arity of the implementation of tr1::tuple which is
10663// currently set at 10.
10664
10665#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10666#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10667
10668// scripts/fuse_gtest.py depends on gtest's own header being #included
10669// *unconditionally*.  Therefore these #includes cannot be moved
10670// inside #if GTEST_HAS_PARAM_TEST.
10671
10672#if GTEST_HAS_PARAM_TEST
10673
10674namespace testing {
10675
10676// Forward declarations of ValuesIn(), which is implemented in
10677// include/gtest/gtest-param-test.h.
10678template <typename ForwardIterator>
10679internal::ParamGenerator<
10680  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
10681ValuesIn(ForwardIterator begin, ForwardIterator end);
10682
10683template <typename T, size_t N>
10684internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
10685
10686template <class Container>
10687internal::ParamGenerator<typename Container::value_type> ValuesIn(
10688    const Container& container);
10689
10690namespace internal {
10691
10692// Used in the Values() function to provide polymorphic capabilities.
10693template <typename T1>
10694class ValueArray1 {
10695 public:
10696  explicit ValueArray1(T1 v1) : v1_(v1) {}
10697
10698  template <typename T>
10699  operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
10700
10701 private:
10702  // No implementation - assignment is unsupported.
10703  void operator=(const ValueArray1& other);
10704
10705  const T1 v1_;
10706};
10707
10708template <typename T1, typename T2>
10709class ValueArray2 {
10710 public:
10711  ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
10712
10713  template <typename T>
10714  operator ParamGenerator<T>() const {
10715    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
10716    return ValuesIn(array);
10717  }
10718
10719 private:
10720  // No implementation - assignment is unsupported.
10721  void operator=(const ValueArray2& other);
10722
10723  const T1 v1_;
10724  const T2 v2_;
10725};
10726
10727template <typename T1, typename T2, typename T3>
10728class ValueArray3 {
10729 public:
10730  ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
10731
10732  template <typename T>
10733  operator ParamGenerator<T>() const {
10734    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10735        static_cast<T>(v3_)};
10736    return ValuesIn(array);
10737  }
10738
10739 private:
10740  // No implementation - assignment is unsupported.
10741  void operator=(const ValueArray3& other);
10742
10743  const T1 v1_;
10744  const T2 v2_;
10745  const T3 v3_;
10746};
10747
10748template <typename T1, typename T2, typename T3, typename T4>
10749class ValueArray4 {
10750 public:
10751  ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
10752      v4_(v4) {}
10753
10754  template <typename T>
10755  operator ParamGenerator<T>() const {
10756    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10757        static_cast<T>(v3_), static_cast<T>(v4_)};
10758    return ValuesIn(array);
10759  }
10760
10761 private:
10762  // No implementation - assignment is unsupported.
10763  void operator=(const ValueArray4& other);
10764
10765  const T1 v1_;
10766  const T2 v2_;
10767  const T3 v3_;
10768  const T4 v4_;
10769};
10770
10771template <typename T1, typename T2, typename T3, typename T4, typename T5>
10772class ValueArray5 {
10773 public:
10774  ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
10775      v4_(v4), v5_(v5) {}
10776
10777  template <typename T>
10778  operator ParamGenerator<T>() const {
10779    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10780        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
10781    return ValuesIn(array);
10782  }
10783
10784 private:
10785  // No implementation - assignment is unsupported.
10786  void operator=(const ValueArray5& other);
10787
10788  const T1 v1_;
10789  const T2 v2_;
10790  const T3 v3_;
10791  const T4 v4_;
10792  const T5 v5_;
10793};
10794
10795template <typename T1, typename T2, typename T3, typename T4, typename T5,
10796    typename T6>
10797class ValueArray6 {
10798 public:
10799  ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
10800      v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
10801
10802  template <typename T>
10803  operator ParamGenerator<T>() const {
10804    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10805        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10806        static_cast<T>(v6_)};
10807    return ValuesIn(array);
10808  }
10809
10810 private:
10811  // No implementation - assignment is unsupported.
10812  void operator=(const ValueArray6& other);
10813
10814  const T1 v1_;
10815  const T2 v2_;
10816  const T3 v3_;
10817  const T4 v4_;
10818  const T5 v5_;
10819  const T6 v6_;
10820};
10821
10822template <typename T1, typename T2, typename T3, typename T4, typename T5,
10823    typename T6, typename T7>
10824class ValueArray7 {
10825 public:
10826  ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
10827      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
10828
10829  template <typename T>
10830  operator ParamGenerator<T>() const {
10831    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10832        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10833        static_cast<T>(v6_), static_cast<T>(v7_)};
10834    return ValuesIn(array);
10835  }
10836
10837 private:
10838  // No implementation - assignment is unsupported.
10839  void operator=(const ValueArray7& other);
10840
10841  const T1 v1_;
10842  const T2 v2_;
10843  const T3 v3_;
10844  const T4 v4_;
10845  const T5 v5_;
10846  const T6 v6_;
10847  const T7 v7_;
10848};
10849
10850template <typename T1, typename T2, typename T3, typename T4, typename T5,
10851    typename T6, typename T7, typename T8>
10852class ValueArray8 {
10853 public:
10854  ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
10855      T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10856      v8_(v8) {}
10857
10858  template <typename T>
10859  operator ParamGenerator<T>() const {
10860    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10861        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10862        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
10863    return ValuesIn(array);
10864  }
10865
10866 private:
10867  // No implementation - assignment is unsupported.
10868  void operator=(const ValueArray8& other);
10869
10870  const T1 v1_;
10871  const T2 v2_;
10872  const T3 v3_;
10873  const T4 v4_;
10874  const T5 v5_;
10875  const T6 v6_;
10876  const T7 v7_;
10877  const T8 v8_;
10878};
10879
10880template <typename T1, typename T2, typename T3, typename T4, typename T5,
10881    typename T6, typename T7, typename T8, typename T9>
10882class ValueArray9 {
10883 public:
10884  ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
10885      T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10886      v8_(v8), v9_(v9) {}
10887
10888  template <typename T>
10889  operator ParamGenerator<T>() const {
10890    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10891        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10892        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10893        static_cast<T>(v9_)};
10894    return ValuesIn(array);
10895  }
10896
10897 private:
10898  // No implementation - assignment is unsupported.
10899  void operator=(const ValueArray9& other);
10900
10901  const T1 v1_;
10902  const T2 v2_;
10903  const T3 v3_;
10904  const T4 v4_;
10905  const T5 v5_;
10906  const T6 v6_;
10907  const T7 v7_;
10908  const T8 v8_;
10909  const T9 v9_;
10910};
10911
10912template <typename T1, typename T2, typename T3, typename T4, typename T5,
10913    typename T6, typename T7, typename T8, typename T9, typename T10>
10914class ValueArray10 {
10915 public:
10916  ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10917      T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10918      v8_(v8), v9_(v9), v10_(v10) {}
10919
10920  template <typename T>
10921  operator ParamGenerator<T>() const {
10922    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10923        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10924        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10925        static_cast<T>(v9_), static_cast<T>(v10_)};
10926    return ValuesIn(array);
10927  }
10928
10929 private:
10930  // No implementation - assignment is unsupported.
10931  void operator=(const ValueArray10& other);
10932
10933  const T1 v1_;
10934  const T2 v2_;
10935  const T3 v3_;
10936  const T4 v4_;
10937  const T5 v5_;
10938  const T6 v6_;
10939  const T7 v7_;
10940  const T8 v8_;
10941  const T9 v9_;
10942  const T10 v10_;
10943};
10944
10945template <typename T1, typename T2, typename T3, typename T4, typename T5,
10946    typename T6, typename T7, typename T8, typename T9, typename T10,
10947    typename T11>
10948class ValueArray11 {
10949 public:
10950  ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10951      T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
10952      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
10953
10954  template <typename T>
10955  operator ParamGenerator<T>() const {
10956    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10957        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10958        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10959        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
10960    return ValuesIn(array);
10961  }
10962
10963 private:
10964  // No implementation - assignment is unsupported.
10965  void operator=(const ValueArray11& other);
10966
10967  const T1 v1_;
10968  const T2 v2_;
10969  const T3 v3_;
10970  const T4 v4_;
10971  const T5 v5_;
10972  const T6 v6_;
10973  const T7 v7_;
10974  const T8 v8_;
10975  const T9 v9_;
10976  const T10 v10_;
10977  const T11 v11_;
10978};
10979
10980template <typename T1, typename T2, typename T3, typename T4, typename T5,
10981    typename T6, typename T7, typename T8, typename T9, typename T10,
10982    typename T11, typename T12>
10983class ValueArray12 {
10984 public:
10985  ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10986      T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
10987      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
10988
10989  template <typename T>
10990  operator ParamGenerator<T>() const {
10991    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10992        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10993        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10994        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
10995        static_cast<T>(v12_)};
10996    return ValuesIn(array);
10997  }
10998
10999 private:
11000  // No implementation - assignment is unsupported.
11001  void operator=(const ValueArray12& other);
11002
11003  const T1 v1_;
11004  const T2 v2_;
11005  const T3 v3_;
11006  const T4 v4_;
11007  const T5 v5_;
11008  const T6 v6_;
11009  const T7 v7_;
11010  const T8 v8_;
11011  const T9 v9_;
11012  const T10 v10_;
11013  const T11 v11_;
11014  const T12 v12_;
11015};
11016
11017template <typename T1, typename T2, typename T3, typename T4, typename T5,
11018    typename T6, typename T7, typename T8, typename T9, typename T10,
11019    typename T11, typename T12, typename T13>
11020class ValueArray13 {
11021 public:
11022  ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11023      T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11024      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11025      v12_(v12), v13_(v13) {}
11026
11027  template <typename T>
11028  operator ParamGenerator<T>() const {
11029    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11030        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11031        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11032        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11033        static_cast<T>(v12_), static_cast<T>(v13_)};
11034    return ValuesIn(array);
11035  }
11036
11037 private:
11038  // No implementation - assignment is unsupported.
11039  void operator=(const ValueArray13& other);
11040
11041  const T1 v1_;
11042  const T2 v2_;
11043  const T3 v3_;
11044  const T4 v4_;
11045  const T5 v5_;
11046  const T6 v6_;
11047  const T7 v7_;
11048  const T8 v8_;
11049  const T9 v9_;
11050  const T10 v10_;
11051  const T11 v11_;
11052  const T12 v12_;
11053  const T13 v13_;
11054};
11055
11056template <typename T1, typename T2, typename T3, typename T4, typename T5,
11057    typename T6, typename T7, typename T8, typename T9, typename T10,
11058    typename T11, typename T12, typename T13, typename T14>
11059class ValueArray14 {
11060 public:
11061  ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11062      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
11063      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11064      v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
11065
11066  template <typename T>
11067  operator ParamGenerator<T>() const {
11068    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11069        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11070        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11071        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11072        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
11073    return ValuesIn(array);
11074  }
11075
11076 private:
11077  // No implementation - assignment is unsupported.
11078  void operator=(const ValueArray14& other);
11079
11080  const T1 v1_;
11081  const T2 v2_;
11082  const T3 v3_;
11083  const T4 v4_;
11084  const T5 v5_;
11085  const T6 v6_;
11086  const T7 v7_;
11087  const T8 v8_;
11088  const T9 v9_;
11089  const T10 v10_;
11090  const T11 v11_;
11091  const T12 v12_;
11092  const T13 v13_;
11093  const T14 v14_;
11094};
11095
11096template <typename T1, typename T2, typename T3, typename T4, typename T5,
11097    typename T6, typename T7, typename T8, typename T9, typename T10,
11098    typename T11, typename T12, typename T13, typename T14, typename T15>
11099class ValueArray15 {
11100 public:
11101  ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11102      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
11103      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11104      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
11105
11106  template <typename T>
11107  operator ParamGenerator<T>() const {
11108    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11109        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11110        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11111        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11112        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11113        static_cast<T>(v15_)};
11114    return ValuesIn(array);
11115  }
11116
11117 private:
11118  // No implementation - assignment is unsupported.
11119  void operator=(const ValueArray15& other);
11120
11121  const T1 v1_;
11122  const T2 v2_;
11123  const T3 v3_;
11124  const T4 v4_;
11125  const T5 v5_;
11126  const T6 v6_;
11127  const T7 v7_;
11128  const T8 v8_;
11129  const T9 v9_;
11130  const T10 v10_;
11131  const T11 v11_;
11132  const T12 v12_;
11133  const T13 v13_;
11134  const T14 v14_;
11135  const T15 v15_;
11136};
11137
11138template <typename T1, typename T2, typename T3, typename T4, typename T5,
11139    typename T6, typename T7, typename T8, typename T9, typename T10,
11140    typename T11, typename T12, typename T13, typename T14, typename T15,
11141    typename T16>
11142class ValueArray16 {
11143 public:
11144  ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11145      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
11146      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11147      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11148      v16_(v16) {}
11149
11150  template <typename T>
11151  operator ParamGenerator<T>() const {
11152    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11153        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11154        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11155        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11156        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11157        static_cast<T>(v15_), static_cast<T>(v16_)};
11158    return ValuesIn(array);
11159  }
11160
11161 private:
11162  // No implementation - assignment is unsupported.
11163  void operator=(const ValueArray16& other);
11164
11165  const T1 v1_;
11166  const T2 v2_;
11167  const T3 v3_;
11168  const T4 v4_;
11169  const T5 v5_;
11170  const T6 v6_;
11171  const T7 v7_;
11172  const T8 v8_;
11173  const T9 v9_;
11174  const T10 v10_;
11175  const T11 v11_;
11176  const T12 v12_;
11177  const T13 v13_;
11178  const T14 v14_;
11179  const T15 v15_;
11180  const T16 v16_;
11181};
11182
11183template <typename T1, typename T2, typename T3, typename T4, typename T5,
11184    typename T6, typename T7, typename T8, typename T9, typename T10,
11185    typename T11, typename T12, typename T13, typename T14, typename T15,
11186    typename T16, typename T17>
11187class ValueArray17 {
11188 public:
11189  ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11190      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
11191      T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11192      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11193      v15_(v15), v16_(v16), v17_(v17) {}
11194
11195  template <typename T>
11196  operator ParamGenerator<T>() const {
11197    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11198        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11199        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11200        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11201        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11202        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
11203    return ValuesIn(array);
11204  }
11205
11206 private:
11207  // No implementation - assignment is unsupported.
11208  void operator=(const ValueArray17& other);
11209
11210  const T1 v1_;
11211  const T2 v2_;
11212  const T3 v3_;
11213  const T4 v4_;
11214  const T5 v5_;
11215  const T6 v6_;
11216  const T7 v7_;
11217  const T8 v8_;
11218  const T9 v9_;
11219  const T10 v10_;
11220  const T11 v11_;
11221  const T12 v12_;
11222  const T13 v13_;
11223  const T14 v14_;
11224  const T15 v15_;
11225  const T16 v16_;
11226  const T17 v17_;
11227};
11228
11229template <typename T1, typename T2, typename T3, typename T4, typename T5,
11230    typename T6, typename T7, typename T8, typename T9, typename T10,
11231    typename T11, typename T12, typename T13, typename T14, typename T15,
11232    typename T16, typename T17, typename T18>
11233class ValueArray18 {
11234 public:
11235  ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11236      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11237      T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11238      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11239      v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
11240
11241  template <typename T>
11242  operator ParamGenerator<T>() const {
11243    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11244        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11245        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11246        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11247        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11248        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11249        static_cast<T>(v18_)};
11250    return ValuesIn(array);
11251  }
11252
11253 private:
11254  // No implementation - assignment is unsupported.
11255  void operator=(const ValueArray18& other);
11256
11257  const T1 v1_;
11258  const T2 v2_;
11259  const T3 v3_;
11260  const T4 v4_;
11261  const T5 v5_;
11262  const T6 v6_;
11263  const T7 v7_;
11264  const T8 v8_;
11265  const T9 v9_;
11266  const T10 v10_;
11267  const T11 v11_;
11268  const T12 v12_;
11269  const T13 v13_;
11270  const T14 v14_;
11271  const T15 v15_;
11272  const T16 v16_;
11273  const T17 v17_;
11274  const T18 v18_;
11275};
11276
11277template <typename T1, typename T2, typename T3, typename T4, typename T5,
11278    typename T6, typename T7, typename T8, typename T9, typename T10,
11279    typename T11, typename T12, typename T13, typename T14, typename T15,
11280    typename T16, typename T17, typename T18, typename T19>
11281class ValueArray19 {
11282 public:
11283  ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11284      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11285      T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11286      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11287      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
11288
11289  template <typename T>
11290  operator ParamGenerator<T>() const {
11291    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11292        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11293        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11294        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11295        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11296        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11297        static_cast<T>(v18_), static_cast<T>(v19_)};
11298    return ValuesIn(array);
11299  }
11300
11301 private:
11302  // No implementation - assignment is unsupported.
11303  void operator=(const ValueArray19& other);
11304
11305  const T1 v1_;
11306  const T2 v2_;
11307  const T3 v3_;
11308  const T4 v4_;
11309  const T5 v5_;
11310  const T6 v6_;
11311  const T7 v7_;
11312  const T8 v8_;
11313  const T9 v9_;
11314  const T10 v10_;
11315  const T11 v11_;
11316  const T12 v12_;
11317  const T13 v13_;
11318  const T14 v14_;
11319  const T15 v15_;
11320  const T16 v16_;
11321  const T17 v17_;
11322  const T18 v18_;
11323  const T19 v19_;
11324};
11325
11326template <typename T1, typename T2, typename T3, typename T4, typename T5,
11327    typename T6, typename T7, typename T8, typename T9, typename T10,
11328    typename T11, typename T12, typename T13, typename T14, typename T15,
11329    typename T16, typename T17, typename T18, typename T19, typename T20>
11330class ValueArray20 {
11331 public:
11332  ValueArray20(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) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11335      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11336      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11337      v19_(v19), v20_(v20) {}
11338
11339  template <typename T>
11340  operator ParamGenerator<T>() const {
11341    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11342        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11343        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11344        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11345        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11346        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11347        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
11348    return ValuesIn(array);
11349  }
11350
11351 private:
11352  // No implementation - assignment is unsupported.
11353  void operator=(const ValueArray20& other);
11354
11355  const T1 v1_;
11356  const T2 v2_;
11357  const T3 v3_;
11358  const T4 v4_;
11359  const T5 v5_;
11360  const T6 v6_;
11361  const T7 v7_;
11362  const T8 v8_;
11363  const T9 v9_;
11364  const T10 v10_;
11365  const T11 v11_;
11366  const T12 v12_;
11367  const T13 v13_;
11368  const T14 v14_;
11369  const T15 v15_;
11370  const T16 v16_;
11371  const T17 v17_;
11372  const T18 v18_;
11373  const T19 v19_;
11374  const T20 v20_;
11375};
11376
11377template <typename T1, typename T2, typename T3, typename T4, typename T5,
11378    typename T6, typename T7, typename T8, typename T9, typename T10,
11379    typename T11, typename T12, typename T13, typename T14, typename T15,
11380    typename T16, typename T17, typename T18, typename T19, typename T20,
11381    typename T21>
11382class ValueArray21 {
11383 public:
11384  ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11385      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11386      T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11387      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11388      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11389      v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
11390
11391  template <typename T>
11392  operator ParamGenerator<T>() const {
11393    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11394        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11395        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11396        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11397        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11398        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11399        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11400        static_cast<T>(v21_)};
11401    return ValuesIn(array);
11402  }
11403
11404 private:
11405  // No implementation - assignment is unsupported.
11406  void operator=(const ValueArray21& other);
11407
11408  const T1 v1_;
11409  const T2 v2_;
11410  const T3 v3_;
11411  const T4 v4_;
11412  const T5 v5_;
11413  const T6 v6_;
11414  const T7 v7_;
11415  const T8 v8_;
11416  const T9 v9_;
11417  const T10 v10_;
11418  const T11 v11_;
11419  const T12 v12_;
11420  const T13 v13_;
11421  const T14 v14_;
11422  const T15 v15_;
11423  const T16 v16_;
11424  const T17 v17_;
11425  const T18 v18_;
11426  const T19 v19_;
11427  const T20 v20_;
11428  const T21 v21_;
11429};
11430
11431template <typename T1, typename T2, typename T3, typename T4, typename T5,
11432    typename T6, typename T7, typename T8, typename T9, typename T10,
11433    typename T11, typename T12, typename T13, typename T14, typename T15,
11434    typename T16, typename T17, typename T18, typename T19, typename T20,
11435    typename T21, typename T22>
11436class ValueArray22 {
11437 public:
11438  ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11439      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11440      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
11441      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11442      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11443      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
11444
11445  template <typename T>
11446  operator ParamGenerator<T>() const {
11447    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11448        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11449        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11450        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11451        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11452        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11453        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11454        static_cast<T>(v21_), static_cast<T>(v22_)};
11455    return ValuesIn(array);
11456  }
11457
11458 private:
11459  // No implementation - assignment is unsupported.
11460  void operator=(const ValueArray22& other);
11461
11462  const T1 v1_;
11463  const T2 v2_;
11464  const T3 v3_;
11465  const T4 v4_;
11466  const T5 v5_;
11467  const T6 v6_;
11468  const T7 v7_;
11469  const T8 v8_;
11470  const T9 v9_;
11471  const T10 v10_;
11472  const T11 v11_;
11473  const T12 v12_;
11474  const T13 v13_;
11475  const T14 v14_;
11476  const T15 v15_;
11477  const T16 v16_;
11478  const T17 v17_;
11479  const T18 v18_;
11480  const T19 v19_;
11481  const T20 v20_;
11482  const T21 v21_;
11483  const T22 v22_;
11484};
11485
11486template <typename T1, typename T2, typename T3, typename T4, typename T5,
11487    typename T6, typename T7, typename T8, typename T9, typename T10,
11488    typename T11, typename T12, typename T13, typename T14, typename T15,
11489    typename T16, typename T17, typename T18, typename T19, typename T20,
11490    typename T21, typename T22, typename T23>
11491class ValueArray23 {
11492 public:
11493  ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11494      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11495      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
11496      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11497      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11498      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11499      v23_(v23) {}
11500
11501  template <typename T>
11502  operator ParamGenerator<T>() const {
11503    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11504        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11505        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11506        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11507        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11508        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11509        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11510        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
11511    return ValuesIn(array);
11512  }
11513
11514 private:
11515  // No implementation - assignment is unsupported.
11516  void operator=(const ValueArray23& other);
11517
11518  const T1 v1_;
11519  const T2 v2_;
11520  const T3 v3_;
11521  const T4 v4_;
11522  const T5 v5_;
11523  const T6 v6_;
11524  const T7 v7_;
11525  const T8 v8_;
11526  const T9 v9_;
11527  const T10 v10_;
11528  const T11 v11_;
11529  const T12 v12_;
11530  const T13 v13_;
11531  const T14 v14_;
11532  const T15 v15_;
11533  const T16 v16_;
11534  const T17 v17_;
11535  const T18 v18_;
11536  const T19 v19_;
11537  const T20 v20_;
11538  const T21 v21_;
11539  const T22 v22_;
11540  const T23 v23_;
11541};
11542
11543template <typename T1, typename T2, typename T3, typename T4, typename T5,
11544    typename T6, typename T7, typename T8, typename T9, typename T10,
11545    typename T11, typename T12, typename T13, typename T14, typename T15,
11546    typename T16, typename T17, typename T18, typename T19, typename T20,
11547    typename T21, typename T22, typename T23, typename T24>
11548class ValueArray24 {
11549 public:
11550  ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11551      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11552      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
11553      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11554      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11555      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
11556      v22_(v22), v23_(v23), v24_(v24) {}
11557
11558  template <typename T>
11559  operator ParamGenerator<T>() const {
11560    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11561        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11562        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11563        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11564        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11565        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11566        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11567        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11568        static_cast<T>(v24_)};
11569    return ValuesIn(array);
11570  }
11571
11572 private:
11573  // No implementation - assignment is unsupported.
11574  void operator=(const ValueArray24& other);
11575
11576  const T1 v1_;
11577  const T2 v2_;
11578  const T3 v3_;
11579  const T4 v4_;
11580  const T5 v5_;
11581  const T6 v6_;
11582  const T7 v7_;
11583  const T8 v8_;
11584  const T9 v9_;
11585  const T10 v10_;
11586  const T11 v11_;
11587  const T12 v12_;
11588  const T13 v13_;
11589  const T14 v14_;
11590  const T15 v15_;
11591  const T16 v16_;
11592  const T17 v17_;
11593  const T18 v18_;
11594  const T19 v19_;
11595  const T20 v20_;
11596  const T21 v21_;
11597  const T22 v22_;
11598  const T23 v23_;
11599  const T24 v24_;
11600};
11601
11602template <typename T1, typename T2, typename T3, typename T4, typename T5,
11603    typename T6, typename T7, typename T8, typename T9, typename T10,
11604    typename T11, typename T12, typename T13, typename T14, typename T15,
11605    typename T16, typename T17, typename T18, typename T19, typename T20,
11606    typename T21, typename T22, typename T23, typename T24, typename T25>
11607class ValueArray25 {
11608 public:
11609  ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11610      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11611      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
11612      T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11613      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11614      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11615      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
11616
11617  template <typename T>
11618  operator ParamGenerator<T>() const {
11619    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11620        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11621        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11622        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11623        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11624        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11625        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11626        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11627        static_cast<T>(v24_), static_cast<T>(v25_)};
11628    return ValuesIn(array);
11629  }
11630
11631 private:
11632  // No implementation - assignment is unsupported.
11633  void operator=(const ValueArray25& other);
11634
11635  const T1 v1_;
11636  const T2 v2_;
11637  const T3 v3_;
11638  const T4 v4_;
11639  const T5 v5_;
11640  const T6 v6_;
11641  const T7 v7_;
11642  const T8 v8_;
11643  const T9 v9_;
11644  const T10 v10_;
11645  const T11 v11_;
11646  const T12 v12_;
11647  const T13 v13_;
11648  const T14 v14_;
11649  const T15 v15_;
11650  const T16 v16_;
11651  const T17 v17_;
11652  const T18 v18_;
11653  const T19 v19_;
11654  const T20 v20_;
11655  const T21 v21_;
11656  const T22 v22_;
11657  const T23 v23_;
11658  const T24 v24_;
11659  const T25 v25_;
11660};
11661
11662template <typename T1, typename T2, typename T3, typename T4, typename T5,
11663    typename T6, typename T7, typename T8, typename T9, typename T10,
11664    typename T11, typename T12, typename T13, typename T14, typename T15,
11665    typename T16, typename T17, typename T18, typename T19, typename T20,
11666    typename T21, typename T22, typename T23, typename T24, typename T25,
11667    typename T26>
11668class ValueArray26 {
11669 public:
11670  ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11671      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11672      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11673      T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11674      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11675      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11676      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
11677
11678  template <typename T>
11679  operator ParamGenerator<T>() const {
11680    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11681        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11682        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11683        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11684        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11685        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11686        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11687        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11688        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
11689    return ValuesIn(array);
11690  }
11691
11692 private:
11693  // No implementation - assignment is unsupported.
11694  void operator=(const ValueArray26& other);
11695
11696  const T1 v1_;
11697  const T2 v2_;
11698  const T3 v3_;
11699  const T4 v4_;
11700  const T5 v5_;
11701  const T6 v6_;
11702  const T7 v7_;
11703  const T8 v8_;
11704  const T9 v9_;
11705  const T10 v10_;
11706  const T11 v11_;
11707  const T12 v12_;
11708  const T13 v13_;
11709  const T14 v14_;
11710  const T15 v15_;
11711  const T16 v16_;
11712  const T17 v17_;
11713  const T18 v18_;
11714  const T19 v19_;
11715  const T20 v20_;
11716  const T21 v21_;
11717  const T22 v22_;
11718  const T23 v23_;
11719  const T24 v24_;
11720  const T25 v25_;
11721  const T26 v26_;
11722};
11723
11724template <typename T1, typename T2, typename T3, typename T4, typename T5,
11725    typename T6, typename T7, typename T8, typename T9, typename T10,
11726    typename T11, typename T12, typename T13, typename T14, typename T15,
11727    typename T16, typename T17, typename T18, typename T19, typename T20,
11728    typename T21, typename T22, typename T23, typename T24, typename T25,
11729    typename T26, typename T27>
11730class ValueArray27 {
11731 public:
11732  ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11733      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11734      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11735      T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11736      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11737      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
11738      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
11739      v26_(v26), v27_(v27) {}
11740
11741  template <typename T>
11742  operator ParamGenerator<T>() const {
11743    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11744        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11745        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11746        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11747        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11748        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11749        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11750        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11751        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11752        static_cast<T>(v27_)};
11753    return ValuesIn(array);
11754  }
11755
11756 private:
11757  // No implementation - assignment is unsupported.
11758  void operator=(const ValueArray27& other);
11759
11760  const T1 v1_;
11761  const T2 v2_;
11762  const T3 v3_;
11763  const T4 v4_;
11764  const T5 v5_;
11765  const T6 v6_;
11766  const T7 v7_;
11767  const T8 v8_;
11768  const T9 v9_;
11769  const T10 v10_;
11770  const T11 v11_;
11771  const T12 v12_;
11772  const T13 v13_;
11773  const T14 v14_;
11774  const T15 v15_;
11775  const T16 v16_;
11776  const T17 v17_;
11777  const T18 v18_;
11778  const T19 v19_;
11779  const T20 v20_;
11780  const T21 v21_;
11781  const T22 v22_;
11782  const T23 v23_;
11783  const T24 v24_;
11784  const T25 v25_;
11785  const T26 v26_;
11786  const T27 v27_;
11787};
11788
11789template <typename T1, typename T2, typename T3, typename T4, typename T5,
11790    typename T6, typename T7, typename T8, typename T9, typename T10,
11791    typename T11, typename T12, typename T13, typename T14, typename T15,
11792    typename T16, typename T17, typename T18, typename T19, typename T20,
11793    typename T21, typename T22, typename T23, typename T24, typename T25,
11794    typename T26, typename T27, typename T28>
11795class ValueArray28 {
11796 public:
11797  ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11798      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11799      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11800      T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11801      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11802      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11803      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
11804      v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
11805
11806  template <typename T>
11807  operator ParamGenerator<T>() const {
11808    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11809        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11810        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11811        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11812        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11813        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11814        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11815        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11816        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11817        static_cast<T>(v27_), static_cast<T>(v28_)};
11818    return ValuesIn(array);
11819  }
11820
11821 private:
11822  // No implementation - assignment is unsupported.
11823  void operator=(const ValueArray28& other);
11824
11825  const T1 v1_;
11826  const T2 v2_;
11827  const T3 v3_;
11828  const T4 v4_;
11829  const T5 v5_;
11830  const T6 v6_;
11831  const T7 v7_;
11832  const T8 v8_;
11833  const T9 v9_;
11834  const T10 v10_;
11835  const T11 v11_;
11836  const T12 v12_;
11837  const T13 v13_;
11838  const T14 v14_;
11839  const T15 v15_;
11840  const T16 v16_;
11841  const T17 v17_;
11842  const T18 v18_;
11843  const T19 v19_;
11844  const T20 v20_;
11845  const T21 v21_;
11846  const T22 v22_;
11847  const T23 v23_;
11848  const T24 v24_;
11849  const T25 v25_;
11850  const T26 v26_;
11851  const T27 v27_;
11852  const T28 v28_;
11853};
11854
11855template <typename T1, typename T2, typename T3, typename T4, typename T5,
11856    typename T6, typename T7, typename T8, typename T9, typename T10,
11857    typename T11, typename T12, typename T13, typename T14, typename T15,
11858    typename T16, typename T17, typename T18, typename T19, typename T20,
11859    typename T21, typename T22, typename T23, typename T24, typename T25,
11860    typename T26, typename T27, typename T28, typename T29>
11861class ValueArray29 {
11862 public:
11863  ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11864      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11865      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11866      T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11867      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11868      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11869      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
11870      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
11871
11872  template <typename T>
11873  operator ParamGenerator<T>() const {
11874    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11875        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11876        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11877        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11878        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11879        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11880        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11881        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11882        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11883        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
11884    return ValuesIn(array);
11885  }
11886
11887 private:
11888  // No implementation - assignment is unsupported.
11889  void operator=(const ValueArray29& 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};
11921
11922template <typename T1, typename T2, typename T3, typename T4, typename T5,
11923    typename T6, typename T7, typename T8, typename T9, typename T10,
11924    typename T11, typename T12, typename T13, typename T14, typename T15,
11925    typename T16, typename T17, typename T18, typename T19, typename T20,
11926    typename T21, typename T22, typename T23, typename T24, typename T25,
11927    typename T26, typename T27, typename T28, typename T29, typename T30>
11928class ValueArray30 {
11929 public:
11930  ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11931      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11932      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11933      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
11934      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11935      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11936      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11937      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
11938      v29_(v29), v30_(v30) {}
11939
11940  template <typename T>
11941  operator ParamGenerator<T>() const {
11942    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11943        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11944        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11945        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11946        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11947        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11948        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11949        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11950        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11951        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
11952        static_cast<T>(v30_)};
11953    return ValuesIn(array);
11954  }
11955
11956 private:
11957  // No implementation - assignment is unsupported.
11958  void operator=(const ValueArray30& other);
11959
11960  const T1 v1_;
11961  const T2 v2_;
11962  const T3 v3_;
11963  const T4 v4_;
11964  const T5 v5_;
11965  const T6 v6_;
11966  const T7 v7_;
11967  const T8 v8_;
11968  const T9 v9_;
11969  const T10 v10_;
11970  const T11 v11_;
11971  const T12 v12_;
11972  const T13 v13_;
11973  const T14 v14_;
11974  const T15 v15_;
11975  const T16 v16_;
11976  const T17 v17_;
11977  const T18 v18_;
11978  const T19 v19_;
11979  const T20 v20_;
11980  const T21 v21_;
11981  const T22 v22_;
11982  const T23 v23_;
11983  const T24 v24_;
11984  const T25 v25_;
11985  const T26 v26_;
11986  const T27 v27_;
11987  const T28 v28_;
11988  const T29 v29_;
11989  const T30 v30_;
11990};
11991
11992template <typename T1, typename T2, typename T3, typename T4, typename T5,
11993    typename T6, typename T7, typename T8, typename T9, typename T10,
11994    typename T11, typename T12, typename T13, typename T14, typename T15,
11995    typename T16, typename T17, typename T18, typename T19, typename T20,
11996    typename T21, typename T22, typename T23, typename T24, typename T25,
11997    typename T26, typename T27, typename T28, typename T29, typename T30,
11998    typename T31>
11999class ValueArray31 {
12000 public:
12001  ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12002      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12003      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12004      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
12005      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12006      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12007      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12008      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12009      v29_(v29), v30_(v30), v31_(v31) {}
12010
12011  template <typename T>
12012  operator ParamGenerator<T>() const {
12013    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12014        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12015        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12016        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12017        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12018        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12019        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12020        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12021        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12022        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12023        static_cast<T>(v30_), static_cast<T>(v31_)};
12024    return ValuesIn(array);
12025  }
12026
12027 private:
12028  // No implementation - assignment is unsupported.
12029  void operator=(const ValueArray31& other);
12030
12031  const T1 v1_;
12032  const T2 v2_;
12033  const T3 v3_;
12034  const T4 v4_;
12035  const T5 v5_;
12036  const T6 v6_;
12037  const T7 v7_;
12038  const T8 v8_;
12039  const T9 v9_;
12040  const T10 v10_;
12041  const T11 v11_;
12042  const T12 v12_;
12043  const T13 v13_;
12044  const T14 v14_;
12045  const T15 v15_;
12046  const T16 v16_;
12047  const T17 v17_;
12048  const T18 v18_;
12049  const T19 v19_;
12050  const T20 v20_;
12051  const T21 v21_;
12052  const T22 v22_;
12053  const T23 v23_;
12054  const T24 v24_;
12055  const T25 v25_;
12056  const T26 v26_;
12057  const T27 v27_;
12058  const T28 v28_;
12059  const T29 v29_;
12060  const T30 v30_;
12061  const T31 v31_;
12062};
12063
12064template <typename T1, typename T2, typename T3, typename T4, typename T5,
12065    typename T6, typename T7, typename T8, typename T9, typename T10,
12066    typename T11, typename T12, typename T13, typename T14, typename T15,
12067    typename T16, typename T17, typename T18, typename T19, typename T20,
12068    typename T21, typename T22, typename T23, typename T24, typename T25,
12069    typename T26, typename T27, typename T28, typename T29, typename T30,
12070    typename T31, typename T32>
12071class ValueArray32 {
12072 public:
12073  ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12074      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12075      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12076      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
12077      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12078      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12079      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12080      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12081      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
12082
12083  template <typename T>
12084  operator ParamGenerator<T>() const {
12085    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12086        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12087        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12088        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12089        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12090        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12091        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12092        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12093        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12094        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12095        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
12096    return ValuesIn(array);
12097  }
12098
12099 private:
12100  // No implementation - assignment is unsupported.
12101  void operator=(const ValueArray32& other);
12102
12103  const T1 v1_;
12104  const T2 v2_;
12105  const T3 v3_;
12106  const T4 v4_;
12107  const T5 v5_;
12108  const T6 v6_;
12109  const T7 v7_;
12110  const T8 v8_;
12111  const T9 v9_;
12112  const T10 v10_;
12113  const T11 v11_;
12114  const T12 v12_;
12115  const T13 v13_;
12116  const T14 v14_;
12117  const T15 v15_;
12118  const T16 v16_;
12119  const T17 v17_;
12120  const T18 v18_;
12121  const T19 v19_;
12122  const T20 v20_;
12123  const T21 v21_;
12124  const T22 v22_;
12125  const T23 v23_;
12126  const T24 v24_;
12127  const T25 v25_;
12128  const T26 v26_;
12129  const T27 v27_;
12130  const T28 v28_;
12131  const T29 v29_;
12132  const T30 v30_;
12133  const T31 v31_;
12134  const T32 v32_;
12135};
12136
12137template <typename T1, typename T2, typename T3, typename T4, typename T5,
12138    typename T6, typename T7, typename T8, typename T9, typename T10,
12139    typename T11, typename T12, typename T13, typename T14, typename T15,
12140    typename T16, typename T17, typename T18, typename T19, typename T20,
12141    typename T21, typename T22, typename T23, typename T24, typename T25,
12142    typename T26, typename T27, typename T28, typename T29, typename T30,
12143    typename T31, typename T32, typename T33>
12144class ValueArray33 {
12145 public:
12146  ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12147      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12148      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12149      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
12150      T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12151      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12152      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12153      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12154      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12155      v33_(v33) {}
12156
12157  template <typename T>
12158  operator ParamGenerator<T>() const {
12159    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12160        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12161        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12162        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12163        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12164        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12165        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12166        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12167        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12168        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12169        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12170        static_cast<T>(v33_)};
12171    return ValuesIn(array);
12172  }
12173
12174 private:
12175  // No implementation - assignment is unsupported.
12176  void operator=(const ValueArray33& other);
12177
12178  const T1 v1_;
12179  const T2 v2_;
12180  const T3 v3_;
12181  const T4 v4_;
12182  const T5 v5_;
12183  const T6 v6_;
12184  const T7 v7_;
12185  const T8 v8_;
12186  const T9 v9_;
12187  const T10 v10_;
12188  const T11 v11_;
12189  const T12 v12_;
12190  const T13 v13_;
12191  const T14 v14_;
12192  const T15 v15_;
12193  const T16 v16_;
12194  const T17 v17_;
12195  const T18 v18_;
12196  const T19 v19_;
12197  const T20 v20_;
12198  const T21 v21_;
12199  const T22 v22_;
12200  const T23 v23_;
12201  const T24 v24_;
12202  const T25 v25_;
12203  const T26 v26_;
12204  const T27 v27_;
12205  const T28 v28_;
12206  const T29 v29_;
12207  const T30 v30_;
12208  const T31 v31_;
12209  const T32 v32_;
12210  const T33 v33_;
12211};
12212
12213template <typename T1, typename T2, typename T3, typename T4, typename T5,
12214    typename T6, typename T7, typename T8, typename T9, typename T10,
12215    typename T11, typename T12, typename T13, typename T14, typename T15,
12216    typename T16, typename T17, typename T18, typename T19, typename T20,
12217    typename T21, typename T22, typename T23, typename T24, typename T25,
12218    typename T26, typename T27, typename T28, typename T29, typename T30,
12219    typename T31, typename T32, typename T33, typename T34>
12220class ValueArray34 {
12221 public:
12222  ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12223      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12224      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12225      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12226      T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12227      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12228      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12229      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12230      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12231      v33_(v33), v34_(v34) {}
12232
12233  template <typename T>
12234  operator ParamGenerator<T>() const {
12235    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12236        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12237        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12238        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12239        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12240        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12241        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12242        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12243        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12244        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12245        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12246        static_cast<T>(v33_), static_cast<T>(v34_)};
12247    return ValuesIn(array);
12248  }
12249
12250 private:
12251  // No implementation - assignment is unsupported.
12252  void operator=(const ValueArray34& other);
12253
12254  const T1 v1_;
12255  const T2 v2_;
12256  const T3 v3_;
12257  const T4 v4_;
12258  const T5 v5_;
12259  const T6 v6_;
12260  const T7 v7_;
12261  const T8 v8_;
12262  const T9 v9_;
12263  const T10 v10_;
12264  const T11 v11_;
12265  const T12 v12_;
12266  const T13 v13_;
12267  const T14 v14_;
12268  const T15 v15_;
12269  const T16 v16_;
12270  const T17 v17_;
12271  const T18 v18_;
12272  const T19 v19_;
12273  const T20 v20_;
12274  const T21 v21_;
12275  const T22 v22_;
12276  const T23 v23_;
12277  const T24 v24_;
12278  const T25 v25_;
12279  const T26 v26_;
12280  const T27 v27_;
12281  const T28 v28_;
12282  const T29 v29_;
12283  const T30 v30_;
12284  const T31 v31_;
12285  const T32 v32_;
12286  const T33 v33_;
12287  const T34 v34_;
12288};
12289
12290template <typename T1, typename T2, typename T3, typename T4, typename T5,
12291    typename T6, typename T7, typename T8, typename T9, typename T10,
12292    typename T11, typename T12, typename T13, typename T14, typename T15,
12293    typename T16, typename T17, typename T18, typename T19, typename T20,
12294    typename T21, typename T22, typename T23, typename T24, typename T25,
12295    typename T26, typename T27, typename T28, typename T29, typename T30,
12296    typename T31, typename T32, typename T33, typename T34, typename T35>
12297class ValueArray35 {
12298 public:
12299  ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12300      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12301      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12302      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12303      T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12304      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12305      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12306      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12307      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12308      v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
12309
12310  template <typename T>
12311  operator ParamGenerator<T>() const {
12312    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12313        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12314        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12315        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12316        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12317        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12318        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12319        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12320        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12321        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12322        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12323        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
12324    return ValuesIn(array);
12325  }
12326
12327 private:
12328  // No implementation - assignment is unsupported.
12329  void operator=(const ValueArray35& other);
12330
12331  const T1 v1_;
12332  const T2 v2_;
12333  const T3 v3_;
12334  const T4 v4_;
12335  const T5 v5_;
12336  const T6 v6_;
12337  const T7 v7_;
12338  const T8 v8_;
12339  const T9 v9_;
12340  const T10 v10_;
12341  const T11 v11_;
12342  const T12 v12_;
12343  const T13 v13_;
12344  const T14 v14_;
12345  const T15 v15_;
12346  const T16 v16_;
12347  const T17 v17_;
12348  const T18 v18_;
12349  const T19 v19_;
12350  const T20 v20_;
12351  const T21 v21_;
12352  const T22 v22_;
12353  const T23 v23_;
12354  const T24 v24_;
12355  const T25 v25_;
12356  const T26 v26_;
12357  const T27 v27_;
12358  const T28 v28_;
12359  const T29 v29_;
12360  const T30 v30_;
12361  const T31 v31_;
12362  const T32 v32_;
12363  const T33 v33_;
12364  const T34 v34_;
12365  const T35 v35_;
12366};
12367
12368template <typename T1, typename T2, typename T3, typename T4, typename T5,
12369    typename T6, typename T7, typename T8, typename T9, typename T10,
12370    typename T11, typename T12, typename T13, typename T14, typename T15,
12371    typename T16, typename T17, typename T18, typename T19, typename T20,
12372    typename T21, typename T22, typename T23, typename T24, typename T25,
12373    typename T26, typename T27, typename T28, typename T29, typename T30,
12374    typename T31, typename T32, typename T33, typename T34, typename T35,
12375    typename T36>
12376class ValueArray36 {
12377 public:
12378  ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12379      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12380      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12381      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12382      T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12383      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12384      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12385      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
12386      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
12387      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
12388
12389  template <typename T>
12390  operator ParamGenerator<T>() const {
12391    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12392        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12393        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12394        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12395        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12396        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12397        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12398        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12399        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12400        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12401        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12402        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12403        static_cast<T>(v36_)};
12404    return ValuesIn(array);
12405  }
12406
12407 private:
12408  // No implementation - assignment is unsupported.
12409  void operator=(const ValueArray36& other);
12410
12411  const T1 v1_;
12412  const T2 v2_;
12413  const T3 v3_;
12414  const T4 v4_;
12415  const T5 v5_;
12416  const T6 v6_;
12417  const T7 v7_;
12418  const T8 v8_;
12419  const T9 v9_;
12420  const T10 v10_;
12421  const T11 v11_;
12422  const T12 v12_;
12423  const T13 v13_;
12424  const T14 v14_;
12425  const T15 v15_;
12426  const T16 v16_;
12427  const T17 v17_;
12428  const T18 v18_;
12429  const T19 v19_;
12430  const T20 v20_;
12431  const T21 v21_;
12432  const T22 v22_;
12433  const T23 v23_;
12434  const T24 v24_;
12435  const T25 v25_;
12436  const T26 v26_;
12437  const T27 v27_;
12438  const T28 v28_;
12439  const T29 v29_;
12440  const T30 v30_;
12441  const T31 v31_;
12442  const T32 v32_;
12443  const T33 v33_;
12444  const T34 v34_;
12445  const T35 v35_;
12446  const T36 v36_;
12447};
12448
12449template <typename T1, typename T2, typename T3, typename T4, typename T5,
12450    typename T6, typename T7, typename T8, typename T9, typename T10,
12451    typename T11, typename T12, typename T13, typename T14, typename T15,
12452    typename T16, typename T17, typename T18, typename T19, typename T20,
12453    typename T21, typename T22, typename T23, typename T24, typename T25,
12454    typename T26, typename T27, typename T28, typename T29, typename T30,
12455    typename T31, typename T32, typename T33, typename T34, typename T35,
12456    typename T36, typename T37>
12457class ValueArray37 {
12458 public:
12459  ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12460      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12461      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12462      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12463      T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12464      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12465      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
12466      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
12467      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
12468      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
12469      v36_(v36), v37_(v37) {}
12470
12471  template <typename T>
12472  operator ParamGenerator<T>() const {
12473    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12474        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12475        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12476        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12477        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12478        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12479        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12480        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12481        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12482        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12483        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12484        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12485        static_cast<T>(v36_), static_cast<T>(v37_)};
12486    return ValuesIn(array);
12487  }
12488
12489 private:
12490  // No implementation - assignment is unsupported.
12491  void operator=(const ValueArray37& other);
12492
12493  const T1 v1_;
12494  const T2 v2_;
12495  const T3 v3_;
12496  const T4 v4_;
12497  const T5 v5_;
12498  const T6 v6_;
12499  const T7 v7_;
12500  const T8 v8_;
12501  const T9 v9_;
12502  const T10 v10_;
12503  const T11 v11_;
12504  const T12 v12_;
12505  const T13 v13_;
12506  const T14 v14_;
12507  const T15 v15_;
12508  const T16 v16_;
12509  const T17 v17_;
12510  const T18 v18_;
12511  const T19 v19_;
12512  const T20 v20_;
12513  const T21 v21_;
12514  const T22 v22_;
12515  const T23 v23_;
12516  const T24 v24_;
12517  const T25 v25_;
12518  const T26 v26_;
12519  const T27 v27_;
12520  const T28 v28_;
12521  const T29 v29_;
12522  const T30 v30_;
12523  const T31 v31_;
12524  const T32 v32_;
12525  const T33 v33_;
12526  const T34 v34_;
12527  const T35 v35_;
12528  const T36 v36_;
12529  const T37 v37_;
12530};
12531
12532template <typename T1, typename T2, typename T3, typename T4, typename T5,
12533    typename T6, typename T7, typename T8, typename T9, typename T10,
12534    typename T11, typename T12, typename T13, typename T14, typename T15,
12535    typename T16, typename T17, typename T18, typename T19, typename T20,
12536    typename T21, typename T22, typename T23, typename T24, typename T25,
12537    typename T26, typename T27, typename T28, typename T29, typename T30,
12538    typename T31, typename T32, typename T33, typename T34, typename T35,
12539    typename T36, typename T37, typename T38>
12540class ValueArray38 {
12541 public:
12542  ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12543      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12544      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12545      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12546      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
12547      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12548      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12549      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12550      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12551      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12552      v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
12553
12554  template <typename T>
12555  operator ParamGenerator<T>() const {
12556    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12557        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12558        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12559        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12560        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12561        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12562        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12563        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12564        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12565        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12566        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12567        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12568        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
12569    return ValuesIn(array);
12570  }
12571
12572 private:
12573  // No implementation - assignment is unsupported.
12574  void operator=(const ValueArray38& other);
12575
12576  const T1 v1_;
12577  const T2 v2_;
12578  const T3 v3_;
12579  const T4 v4_;
12580  const T5 v5_;
12581  const T6 v6_;
12582  const T7 v7_;
12583  const T8 v8_;
12584  const T9 v9_;
12585  const T10 v10_;
12586  const T11 v11_;
12587  const T12 v12_;
12588  const T13 v13_;
12589  const T14 v14_;
12590  const T15 v15_;
12591  const T16 v16_;
12592  const T17 v17_;
12593  const T18 v18_;
12594  const T19 v19_;
12595  const T20 v20_;
12596  const T21 v21_;
12597  const T22 v22_;
12598  const T23 v23_;
12599  const T24 v24_;
12600  const T25 v25_;
12601  const T26 v26_;
12602  const T27 v27_;
12603  const T28 v28_;
12604  const T29 v29_;
12605  const T30 v30_;
12606  const T31 v31_;
12607  const T32 v32_;
12608  const T33 v33_;
12609  const T34 v34_;
12610  const T35 v35_;
12611  const T36 v36_;
12612  const T37 v37_;
12613  const T38 v38_;
12614};
12615
12616template <typename T1, typename T2, typename T3, typename T4, typename T5,
12617    typename T6, typename T7, typename T8, typename T9, typename T10,
12618    typename T11, typename T12, typename T13, typename T14, typename T15,
12619    typename T16, typename T17, typename T18, typename T19, typename T20,
12620    typename T21, typename T22, typename T23, typename T24, typename T25,
12621    typename T26, typename T27, typename T28, typename T29, typename T30,
12622    typename T31, typename T32, typename T33, typename T34, typename T35,
12623    typename T36, typename T37, typename T38, typename T39>
12624class ValueArray39 {
12625 public:
12626  ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12627      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12628      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12629      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12630      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
12631      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12632      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12633      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12634      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12635      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12636      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
12637
12638  template <typename T>
12639  operator ParamGenerator<T>() const {
12640    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12641        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12642        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12643        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12644        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12645        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12646        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12647        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12648        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12649        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12650        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12651        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12652        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12653        static_cast<T>(v39_)};
12654    return ValuesIn(array);
12655  }
12656
12657 private:
12658  // No implementation - assignment is unsupported.
12659  void operator=(const ValueArray39& other);
12660
12661  const T1 v1_;
12662  const T2 v2_;
12663  const T3 v3_;
12664  const T4 v4_;
12665  const T5 v5_;
12666  const T6 v6_;
12667  const T7 v7_;
12668  const T8 v8_;
12669  const T9 v9_;
12670  const T10 v10_;
12671  const T11 v11_;
12672  const T12 v12_;
12673  const T13 v13_;
12674  const T14 v14_;
12675  const T15 v15_;
12676  const T16 v16_;
12677  const T17 v17_;
12678  const T18 v18_;
12679  const T19 v19_;
12680  const T20 v20_;
12681  const T21 v21_;
12682  const T22 v22_;
12683  const T23 v23_;
12684  const T24 v24_;
12685  const T25 v25_;
12686  const T26 v26_;
12687  const T27 v27_;
12688  const T28 v28_;
12689  const T29 v29_;
12690  const T30 v30_;
12691  const T31 v31_;
12692  const T32 v32_;
12693  const T33 v33_;
12694  const T34 v34_;
12695  const T35 v35_;
12696  const T36 v36_;
12697  const T37 v37_;
12698  const T38 v38_;
12699  const T39 v39_;
12700};
12701
12702template <typename T1, typename T2, typename T3, typename T4, typename T5,
12703    typename T6, typename T7, typename T8, typename T9, typename T10,
12704    typename T11, typename T12, typename T13, typename T14, typename T15,
12705    typename T16, typename T17, typename T18, typename T19, typename T20,
12706    typename T21, typename T22, typename T23, typename T24, typename T25,
12707    typename T26, typename T27, typename T28, typename T29, typename T30,
12708    typename T31, typename T32, typename T33, typename T34, typename T35,
12709    typename T36, typename T37, typename T38, typename T39, typename T40>
12710class ValueArray40 {
12711 public:
12712  ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12713      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12714      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12715      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12716      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
12717      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12718      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12719      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12720      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12721      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
12722      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
12723      v40_(v40) {}
12724
12725  template <typename T>
12726  operator ParamGenerator<T>() const {
12727    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12728        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12729        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12730        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12731        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12732        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12733        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12734        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12735        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12736        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12737        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12738        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12739        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12740        static_cast<T>(v39_), static_cast<T>(v40_)};
12741    return ValuesIn(array);
12742  }
12743
12744 private:
12745  // No implementation - assignment is unsupported.
12746  void operator=(const ValueArray40& other);
12747
12748  const T1 v1_;
12749  const T2 v2_;
12750  const T3 v3_;
12751  const T4 v4_;
12752  const T5 v5_;
12753  const T6 v6_;
12754  const T7 v7_;
12755  const T8 v8_;
12756  const T9 v9_;
12757  const T10 v10_;
12758  const T11 v11_;
12759  const T12 v12_;
12760  const T13 v13_;
12761  const T14 v14_;
12762  const T15 v15_;
12763  const T16 v16_;
12764  const T17 v17_;
12765  const T18 v18_;
12766  const T19 v19_;
12767  const T20 v20_;
12768  const T21 v21_;
12769  const T22 v22_;
12770  const T23 v23_;
12771  const T24 v24_;
12772  const T25 v25_;
12773  const T26 v26_;
12774  const T27 v27_;
12775  const T28 v28_;
12776  const T29 v29_;
12777  const T30 v30_;
12778  const T31 v31_;
12779  const T32 v32_;
12780  const T33 v33_;
12781  const T34 v34_;
12782  const T35 v35_;
12783  const T36 v36_;
12784  const T37 v37_;
12785  const T38 v38_;
12786  const T39 v39_;
12787  const T40 v40_;
12788};
12789
12790template <typename T1, typename T2, typename T3, typename T4, typename T5,
12791    typename T6, typename T7, typename T8, typename T9, typename T10,
12792    typename T11, typename T12, typename T13, typename T14, typename T15,
12793    typename T16, typename T17, typename T18, typename T19, typename T20,
12794    typename T21, typename T22, typename T23, typename T24, typename T25,
12795    typename T26, typename T27, typename T28, typename T29, typename T30,
12796    typename T31, typename T32, typename T33, typename T34, typename T35,
12797    typename T36, typename T37, typename T38, typename T39, typename T40,
12798    typename T41>
12799class ValueArray41 {
12800 public:
12801  ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12802      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12803      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12804      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12805      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
12806      T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12807      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12808      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12809      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12810      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12811      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12812      v39_(v39), v40_(v40), v41_(v41) {}
12813
12814  template <typename T>
12815  operator ParamGenerator<T>() const {
12816    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12817        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12818        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12819        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12820        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12821        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12822        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12823        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12824        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12825        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12826        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12827        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12828        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12829        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
12830    return ValuesIn(array);
12831  }
12832
12833 private:
12834  // No implementation - assignment is unsupported.
12835  void operator=(const ValueArray41& other);
12836
12837  const T1 v1_;
12838  const T2 v2_;
12839  const T3 v3_;
12840  const T4 v4_;
12841  const T5 v5_;
12842  const T6 v6_;
12843  const T7 v7_;
12844  const T8 v8_;
12845  const T9 v9_;
12846  const T10 v10_;
12847  const T11 v11_;
12848  const T12 v12_;
12849  const T13 v13_;
12850  const T14 v14_;
12851  const T15 v15_;
12852  const T16 v16_;
12853  const T17 v17_;
12854  const T18 v18_;
12855  const T19 v19_;
12856  const T20 v20_;
12857  const T21 v21_;
12858  const T22 v22_;
12859  const T23 v23_;
12860  const T24 v24_;
12861  const T25 v25_;
12862  const T26 v26_;
12863  const T27 v27_;
12864  const T28 v28_;
12865  const T29 v29_;
12866  const T30 v30_;
12867  const T31 v31_;
12868  const T32 v32_;
12869  const T33 v33_;
12870  const T34 v34_;
12871  const T35 v35_;
12872  const T36 v36_;
12873  const T37 v37_;
12874  const T38 v38_;
12875  const T39 v39_;
12876  const T40 v40_;
12877  const T41 v41_;
12878};
12879
12880template <typename T1, typename T2, typename T3, typename T4, typename T5,
12881    typename T6, typename T7, typename T8, typename T9, typename T10,
12882    typename T11, typename T12, typename T13, typename T14, typename T15,
12883    typename T16, typename T17, typename T18, typename T19, typename T20,
12884    typename T21, typename T22, typename T23, typename T24, typename T25,
12885    typename T26, typename T27, typename T28, typename T29, typename T30,
12886    typename T31, typename T32, typename T33, typename T34, typename T35,
12887    typename T36, typename T37, typename T38, typename T39, typename T40,
12888    typename T41, typename T42>
12889class ValueArray42 {
12890 public:
12891  ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12892      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12893      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12894      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12895      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12896      T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12897      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12898      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12899      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12900      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12901      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12902      v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
12903
12904  template <typename T>
12905  operator ParamGenerator<T>() const {
12906    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12907        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12908        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12909        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12910        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12911        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12912        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12913        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12914        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12915        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12916        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12917        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12918        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12919        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
12920        static_cast<T>(v42_)};
12921    return ValuesIn(array);
12922  }
12923
12924 private:
12925  // No implementation - assignment is unsupported.
12926  void operator=(const ValueArray42& other);
12927
12928  const T1 v1_;
12929  const T2 v2_;
12930  const T3 v3_;
12931  const T4 v4_;
12932  const T5 v5_;
12933  const T6 v6_;
12934  const T7 v7_;
12935  const T8 v8_;
12936  const T9 v9_;
12937  const T10 v10_;
12938  const T11 v11_;
12939  const T12 v12_;
12940  const T13 v13_;
12941  const T14 v14_;
12942  const T15 v15_;
12943  const T16 v16_;
12944  const T17 v17_;
12945  const T18 v18_;
12946  const T19 v19_;
12947  const T20 v20_;
12948  const T21 v21_;
12949  const T22 v22_;
12950  const T23 v23_;
12951  const T24 v24_;
12952  const T25 v25_;
12953  const T26 v26_;
12954  const T27 v27_;
12955  const T28 v28_;
12956  const T29 v29_;
12957  const T30 v30_;
12958  const T31 v31_;
12959  const T32 v32_;
12960  const T33 v33_;
12961  const T34 v34_;
12962  const T35 v35_;
12963  const T36 v36_;
12964  const T37 v37_;
12965  const T38 v38_;
12966  const T39 v39_;
12967  const T40 v40_;
12968  const T41 v41_;
12969  const T42 v42_;
12970};
12971
12972template <typename T1, typename T2, typename T3, typename T4, typename T5,
12973    typename T6, typename T7, typename T8, typename T9, typename T10,
12974    typename T11, typename T12, typename T13, typename T14, typename T15,
12975    typename T16, typename T17, typename T18, typename T19, typename T20,
12976    typename T21, typename T22, typename T23, typename T24, typename T25,
12977    typename T26, typename T27, typename T28, typename T29, typename T30,
12978    typename T31, typename T32, typename T33, typename T34, typename T35,
12979    typename T36, typename T37, typename T38, typename T39, typename T40,
12980    typename T41, typename T42, typename T43>
12981class ValueArray43 {
12982 public:
12983  ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12984      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12985      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12986      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12987      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12988      T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12989      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12990      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12991      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12992      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12993      v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
12994      v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
12995
12996  template <typename T>
12997  operator ParamGenerator<T>() const {
12998    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12999        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13000        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13001        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13002        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13003        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13004        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13005        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13006        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13007        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13008        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13009        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13010        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13011        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13012        static_cast<T>(v42_), static_cast<T>(v43_)};
13013    return ValuesIn(array);
13014  }
13015
13016 private:
13017  // No implementation - assignment is unsupported.
13018  void operator=(const ValueArray43& other);
13019
13020  const T1 v1_;
13021  const T2 v2_;
13022  const T3 v3_;
13023  const T4 v4_;
13024  const T5 v5_;
13025  const T6 v6_;
13026  const T7 v7_;
13027  const T8 v8_;
13028  const T9 v9_;
13029  const T10 v10_;
13030  const T11 v11_;
13031  const T12 v12_;
13032  const T13 v13_;
13033  const T14 v14_;
13034  const T15 v15_;
13035  const T16 v16_;
13036  const T17 v17_;
13037  const T18 v18_;
13038  const T19 v19_;
13039  const T20 v20_;
13040  const T21 v21_;
13041  const T22 v22_;
13042  const T23 v23_;
13043  const T24 v24_;
13044  const T25 v25_;
13045  const T26 v26_;
13046  const T27 v27_;
13047  const T28 v28_;
13048  const T29 v29_;
13049  const T30 v30_;
13050  const T31 v31_;
13051  const T32 v32_;
13052  const T33 v33_;
13053  const T34 v34_;
13054  const T35 v35_;
13055  const T36 v36_;
13056  const T37 v37_;
13057  const T38 v38_;
13058  const T39 v39_;
13059  const T40 v40_;
13060  const T41 v41_;
13061  const T42 v42_;
13062  const T43 v43_;
13063};
13064
13065template <typename T1, typename T2, typename T3, typename T4, typename T5,
13066    typename T6, typename T7, typename T8, typename T9, typename T10,
13067    typename T11, typename T12, typename T13, typename T14, typename T15,
13068    typename T16, typename T17, typename T18, typename T19, typename T20,
13069    typename T21, typename T22, typename T23, typename T24, typename T25,
13070    typename T26, typename T27, typename T28, typename T29, typename T30,
13071    typename T31, typename T32, typename T33, typename T34, typename T35,
13072    typename T36, typename T37, typename T38, typename T39, typename T40,
13073    typename T41, typename T42, typename T43, typename T44>
13074class ValueArray44 {
13075 public:
13076  ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13077      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13078      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13079      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13080      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13081      T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
13082      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
13083      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
13084      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
13085      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
13086      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
13087      v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
13088      v43_(v43), v44_(v44) {}
13089
13090  template <typename T>
13091  operator ParamGenerator<T>() const {
13092    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13093        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13094        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13095        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13096        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13097        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13098        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13099        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13100        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13101        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13102        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13103        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13104        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13105        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13106        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
13107    return ValuesIn(array);
13108  }
13109
13110 private:
13111  // No implementation - assignment is unsupported.
13112  void operator=(const ValueArray44& other);
13113
13114  const T1 v1_;
13115  const T2 v2_;
13116  const T3 v3_;
13117  const T4 v4_;
13118  const T5 v5_;
13119  const T6 v6_;
13120  const T7 v7_;
13121  const T8 v8_;
13122  const T9 v9_;
13123  const T10 v10_;
13124  const T11 v11_;
13125  const T12 v12_;
13126  const T13 v13_;
13127  const T14 v14_;
13128  const T15 v15_;
13129  const T16 v16_;
13130  const T17 v17_;
13131  const T18 v18_;
13132  const T19 v19_;
13133  const T20 v20_;
13134  const T21 v21_;
13135  const T22 v22_;
13136  const T23 v23_;
13137  const T24 v24_;
13138  const T25 v25_;
13139  const T26 v26_;
13140  const T27 v27_;
13141  const T28 v28_;
13142  const T29 v29_;
13143  const T30 v30_;
13144  const T31 v31_;
13145  const T32 v32_;
13146  const T33 v33_;
13147  const T34 v34_;
13148  const T35 v35_;
13149  const T36 v36_;
13150  const T37 v37_;
13151  const T38 v38_;
13152  const T39 v39_;
13153  const T40 v40_;
13154  const T41 v41_;
13155  const T42 v42_;
13156  const T43 v43_;
13157  const T44 v44_;
13158};
13159
13160template <typename T1, typename T2, typename T3, typename T4, typename T5,
13161    typename T6, typename T7, typename T8, typename T9, typename T10,
13162    typename T11, typename T12, typename T13, typename T14, typename T15,
13163    typename T16, typename T17, typename T18, typename T19, typename T20,
13164    typename T21, typename T22, typename T23, typename T24, typename T25,
13165    typename T26, typename T27, typename T28, typename T29, typename T30,
13166    typename T31, typename T32, typename T33, typename T34, typename T35,
13167    typename T36, typename T37, typename T38, typename T39, typename T40,
13168    typename T41, typename T42, typename T43, typename T44, typename T45>
13169class ValueArray45 {
13170 public:
13171  ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13172      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13173      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13174      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13175      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13176      T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
13177      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
13178      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
13179      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
13180      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
13181      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
13182      v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
13183      v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
13184
13185  template <typename T>
13186  operator ParamGenerator<T>() const {
13187    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13188        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13189        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13190        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13191        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13192        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13193        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13194        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13195        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13196        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13197        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13198        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13199        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13200        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13201        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13202        static_cast<T>(v45_)};
13203    return ValuesIn(array);
13204  }
13205
13206 private:
13207  // No implementation - assignment is unsupported.
13208  void operator=(const ValueArray45& other);
13209
13210  const T1 v1_;
13211  const T2 v2_;
13212  const T3 v3_;
13213  const T4 v4_;
13214  const T5 v5_;
13215  const T6 v6_;
13216  const T7 v7_;
13217  const T8 v8_;
13218  const T9 v9_;
13219  const T10 v10_;
13220  const T11 v11_;
13221  const T12 v12_;
13222  const T13 v13_;
13223  const T14 v14_;
13224  const T15 v15_;
13225  const T16 v16_;
13226  const T17 v17_;
13227  const T18 v18_;
13228  const T19 v19_;
13229  const T20 v20_;
13230  const T21 v21_;
13231  const T22 v22_;
13232  const T23 v23_;
13233  const T24 v24_;
13234  const T25 v25_;
13235  const T26 v26_;
13236  const T27 v27_;
13237  const T28 v28_;
13238  const T29 v29_;
13239  const T30 v30_;
13240  const T31 v31_;
13241  const T32 v32_;
13242  const T33 v33_;
13243  const T34 v34_;
13244  const T35 v35_;
13245  const T36 v36_;
13246  const T37 v37_;
13247  const T38 v38_;
13248  const T39 v39_;
13249  const T40 v40_;
13250  const T41 v41_;
13251  const T42 v42_;
13252  const T43 v43_;
13253  const T44 v44_;
13254  const T45 v45_;
13255};
13256
13257template <typename T1, typename T2, typename T3, typename T4, typename T5,
13258    typename T6, typename T7, typename T8, typename T9, typename T10,
13259    typename T11, typename T12, typename T13, typename T14, typename T15,
13260    typename T16, typename T17, typename T18, typename T19, typename T20,
13261    typename T21, typename T22, typename T23, typename T24, typename T25,
13262    typename T26, typename T27, typename T28, typename T29, typename T30,
13263    typename T31, typename T32, typename T33, typename T34, typename T35,
13264    typename T36, typename T37, typename T38, typename T39, typename T40,
13265    typename T41, typename T42, typename T43, typename T44, typename T45,
13266    typename T46>
13267class ValueArray46 {
13268 public:
13269  ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13270      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13271      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13272      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13273      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13274      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
13275      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13276      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13277      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13278      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13279      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13280      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13281      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
13282
13283  template <typename T>
13284  operator ParamGenerator<T>() const {
13285    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13286        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13287        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13288        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13289        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13290        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13291        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13292        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13293        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13294        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13295        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13296        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13297        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13298        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13299        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13300        static_cast<T>(v45_), static_cast<T>(v46_)};
13301    return ValuesIn(array);
13302  }
13303
13304 private:
13305  // No implementation - assignment is unsupported.
13306  void operator=(const ValueArray46& other);
13307
13308  const T1 v1_;
13309  const T2 v2_;
13310  const T3 v3_;
13311  const T4 v4_;
13312  const T5 v5_;
13313  const T6 v6_;
13314  const T7 v7_;
13315  const T8 v8_;
13316  const T9 v9_;
13317  const T10 v10_;
13318  const T11 v11_;
13319  const T12 v12_;
13320  const T13 v13_;
13321  const T14 v14_;
13322  const T15 v15_;
13323  const T16 v16_;
13324  const T17 v17_;
13325  const T18 v18_;
13326  const T19 v19_;
13327  const T20 v20_;
13328  const T21 v21_;
13329  const T22 v22_;
13330  const T23 v23_;
13331  const T24 v24_;
13332  const T25 v25_;
13333  const T26 v26_;
13334  const T27 v27_;
13335  const T28 v28_;
13336  const T29 v29_;
13337  const T30 v30_;
13338  const T31 v31_;
13339  const T32 v32_;
13340  const T33 v33_;
13341  const T34 v34_;
13342  const T35 v35_;
13343  const T36 v36_;
13344  const T37 v37_;
13345  const T38 v38_;
13346  const T39 v39_;
13347  const T40 v40_;
13348  const T41 v41_;
13349  const T42 v42_;
13350  const T43 v43_;
13351  const T44 v44_;
13352  const T45 v45_;
13353  const T46 v46_;
13354};
13355
13356template <typename T1, typename T2, typename T3, typename T4, typename T5,
13357    typename T6, typename T7, typename T8, typename T9, typename T10,
13358    typename T11, typename T12, typename T13, typename T14, typename T15,
13359    typename T16, typename T17, typename T18, typename T19, typename T20,
13360    typename T21, typename T22, typename T23, typename T24, typename T25,
13361    typename T26, typename T27, typename T28, typename T29, typename T30,
13362    typename T31, typename T32, typename T33, typename T34, typename T35,
13363    typename T36, typename T37, typename T38, typename T39, typename T40,
13364    typename T41, typename T42, typename T43, typename T44, typename T45,
13365    typename T46, typename T47>
13366class ValueArray47 {
13367 public:
13368  ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13369      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13370      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13371      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13372      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13373      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
13374      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13375      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13376      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13377      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13378      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13379      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13380      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
13381      v47_(v47) {}
13382
13383  template <typename T>
13384  operator ParamGenerator<T>() const {
13385    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13386        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13387        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13388        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13389        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13390        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13391        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13392        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13393        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13394        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13395        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13396        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13397        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13398        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13399        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13400        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
13401    return ValuesIn(array);
13402  }
13403
13404 private:
13405  // No implementation - assignment is unsupported.
13406  void operator=(const ValueArray47& other);
13407
13408  const T1 v1_;
13409  const T2 v2_;
13410  const T3 v3_;
13411  const T4 v4_;
13412  const T5 v5_;
13413  const T6 v6_;
13414  const T7 v7_;
13415  const T8 v8_;
13416  const T9 v9_;
13417  const T10 v10_;
13418  const T11 v11_;
13419  const T12 v12_;
13420  const T13 v13_;
13421  const T14 v14_;
13422  const T15 v15_;
13423  const T16 v16_;
13424  const T17 v17_;
13425  const T18 v18_;
13426  const T19 v19_;
13427  const T20 v20_;
13428  const T21 v21_;
13429  const T22 v22_;
13430  const T23 v23_;
13431  const T24 v24_;
13432  const T25 v25_;
13433  const T26 v26_;
13434  const T27 v27_;
13435  const T28 v28_;
13436  const T29 v29_;
13437  const T30 v30_;
13438  const T31 v31_;
13439  const T32 v32_;
13440  const T33 v33_;
13441  const T34 v34_;
13442  const T35 v35_;
13443  const T36 v36_;
13444  const T37 v37_;
13445  const T38 v38_;
13446  const T39 v39_;
13447  const T40 v40_;
13448  const T41 v41_;
13449  const T42 v42_;
13450  const T43 v43_;
13451  const T44 v44_;
13452  const T45 v45_;
13453  const T46 v46_;
13454  const T47 v47_;
13455};
13456
13457template <typename T1, typename T2, typename T3, typename T4, typename T5,
13458    typename T6, typename T7, typename T8, typename T9, typename T10,
13459    typename T11, typename T12, typename T13, typename T14, typename T15,
13460    typename T16, typename T17, typename T18, typename T19, typename T20,
13461    typename T21, typename T22, typename T23, typename T24, typename T25,
13462    typename T26, typename T27, typename T28, typename T29, typename T30,
13463    typename T31, typename T32, typename T33, typename T34, typename T35,
13464    typename T36, typename T37, typename T38, typename T39, typename T40,
13465    typename T41, typename T42, typename T43, typename T44, typename T45,
13466    typename T46, typename T47, typename T48>
13467class ValueArray48 {
13468 public:
13469  ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13470      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13471      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13472      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13473      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13474      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
13475      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13476      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13477      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13478      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
13479      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
13480      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
13481      v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
13482      v46_(v46), v47_(v47), v48_(v48) {}
13483
13484  template <typename T>
13485  operator ParamGenerator<T>() const {
13486    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13487        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13488        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13489        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13490        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13491        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13492        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13493        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13494        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13495        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13496        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13497        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13498        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13499        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13500        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13501        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13502        static_cast<T>(v48_)};
13503    return ValuesIn(array);
13504  }
13505
13506 private:
13507  // No implementation - assignment is unsupported.
13508  void operator=(const ValueArray48& other);
13509
13510  const T1 v1_;
13511  const T2 v2_;
13512  const T3 v3_;
13513  const T4 v4_;
13514  const T5 v5_;
13515  const T6 v6_;
13516  const T7 v7_;
13517  const T8 v8_;
13518  const T9 v9_;
13519  const T10 v10_;
13520  const T11 v11_;
13521  const T12 v12_;
13522  const T13 v13_;
13523  const T14 v14_;
13524  const T15 v15_;
13525  const T16 v16_;
13526  const T17 v17_;
13527  const T18 v18_;
13528  const T19 v19_;
13529  const T20 v20_;
13530  const T21 v21_;
13531  const T22 v22_;
13532  const T23 v23_;
13533  const T24 v24_;
13534  const T25 v25_;
13535  const T26 v26_;
13536  const T27 v27_;
13537  const T28 v28_;
13538  const T29 v29_;
13539  const T30 v30_;
13540  const T31 v31_;
13541  const T32 v32_;
13542  const T33 v33_;
13543  const T34 v34_;
13544  const T35 v35_;
13545  const T36 v36_;
13546  const T37 v37_;
13547  const T38 v38_;
13548  const T39 v39_;
13549  const T40 v40_;
13550  const T41 v41_;
13551  const T42 v42_;
13552  const T43 v43_;
13553  const T44 v44_;
13554  const T45 v45_;
13555  const T46 v46_;
13556  const T47 v47_;
13557  const T48 v48_;
13558};
13559
13560template <typename T1, typename T2, typename T3, typename T4, typename T5,
13561    typename T6, typename T7, typename T8, typename T9, typename T10,
13562    typename T11, typename T12, typename T13, typename T14, typename T15,
13563    typename T16, typename T17, typename T18, typename T19, typename T20,
13564    typename T21, typename T22, typename T23, typename T24, typename T25,
13565    typename T26, typename T27, typename T28, typename T29, typename T30,
13566    typename T31, typename T32, typename T33, typename T34, typename T35,
13567    typename T36, typename T37, typename T38, typename T39, typename T40,
13568    typename T41, typename T42, typename T43, typename T44, typename T45,
13569    typename T46, typename T47, typename T48, typename T49>
13570class ValueArray49 {
13571 public:
13572  ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13573      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13574      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13575      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13576      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13577      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
13578      T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13579      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13580      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13581      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13582      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13583      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13584      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13585      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
13586
13587  template <typename T>
13588  operator ParamGenerator<T>() const {
13589    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13590        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13591        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13592        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13593        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13594        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13595        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13596        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13597        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13598        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13599        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13600        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13601        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13602        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13603        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13604        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13605        static_cast<T>(v48_), static_cast<T>(v49_)};
13606    return ValuesIn(array);
13607  }
13608
13609 private:
13610  // No implementation - assignment is unsupported.
13611  void operator=(const ValueArray49& other);
13612
13613  const T1 v1_;
13614  const T2 v2_;
13615  const T3 v3_;
13616  const T4 v4_;
13617  const T5 v5_;
13618  const T6 v6_;
13619  const T7 v7_;
13620  const T8 v8_;
13621  const T9 v9_;
13622  const T10 v10_;
13623  const T11 v11_;
13624  const T12 v12_;
13625  const T13 v13_;
13626  const T14 v14_;
13627  const T15 v15_;
13628  const T16 v16_;
13629  const T17 v17_;
13630  const T18 v18_;
13631  const T19 v19_;
13632  const T20 v20_;
13633  const T21 v21_;
13634  const T22 v22_;
13635  const T23 v23_;
13636  const T24 v24_;
13637  const T25 v25_;
13638  const T26 v26_;
13639  const T27 v27_;
13640  const T28 v28_;
13641  const T29 v29_;
13642  const T30 v30_;
13643  const T31 v31_;
13644  const T32 v32_;
13645  const T33 v33_;
13646  const T34 v34_;
13647  const T35 v35_;
13648  const T36 v36_;
13649  const T37 v37_;
13650  const T38 v38_;
13651  const T39 v39_;
13652  const T40 v40_;
13653  const T41 v41_;
13654  const T42 v42_;
13655  const T43 v43_;
13656  const T44 v44_;
13657  const T45 v45_;
13658  const T46 v46_;
13659  const T47 v47_;
13660  const T48 v48_;
13661  const T49 v49_;
13662};
13663
13664template <typename T1, typename T2, typename T3, typename T4, typename T5,
13665    typename T6, typename T7, typename T8, typename T9, typename T10,
13666    typename T11, typename T12, typename T13, typename T14, typename T15,
13667    typename T16, typename T17, typename T18, typename T19, typename T20,
13668    typename T21, typename T22, typename T23, typename T24, typename T25,
13669    typename T26, typename T27, typename T28, typename T29, typename T30,
13670    typename T31, typename T32, typename T33, typename T34, typename T35,
13671    typename T36, typename T37, typename T38, typename T39, typename T40,
13672    typename T41, typename T42, typename T43, typename T44, typename T45,
13673    typename T46, typename T47, typename T48, typename T49, typename T50>
13674class ValueArray50 {
13675 public:
13676  ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13677      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13678      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13679      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13680      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13681      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
13682      T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13683      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13684      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13685      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13686      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13687      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13688      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13689      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
13690
13691  template <typename T>
13692  operator ParamGenerator<T>() const {
13693    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13694        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13695        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13696        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13697        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13698        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13699        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13700        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13701        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13702        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13703        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13704        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13705        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13706        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13707        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13708        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13709        static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
13710    return ValuesIn(array);
13711  }
13712
13713 private:
13714  // No implementation - assignment is unsupported.
13715  void operator=(const ValueArray50& other);
13716
13717  const T1 v1_;
13718  const T2 v2_;
13719  const T3 v3_;
13720  const T4 v4_;
13721  const T5 v5_;
13722  const T6 v6_;
13723  const T7 v7_;
13724  const T8 v8_;
13725  const T9 v9_;
13726  const T10 v10_;
13727  const T11 v11_;
13728  const T12 v12_;
13729  const T13 v13_;
13730  const T14 v14_;
13731  const T15 v15_;
13732  const T16 v16_;
13733  const T17 v17_;
13734  const T18 v18_;
13735  const T19 v19_;
13736  const T20 v20_;
13737  const T21 v21_;
13738  const T22 v22_;
13739  const T23 v23_;
13740  const T24 v24_;
13741  const T25 v25_;
13742  const T26 v26_;
13743  const T27 v27_;
13744  const T28 v28_;
13745  const T29 v29_;
13746  const T30 v30_;
13747  const T31 v31_;
13748  const T32 v32_;
13749  const T33 v33_;
13750  const T34 v34_;
13751  const T35 v35_;
13752  const T36 v36_;
13753  const T37 v37_;
13754  const T38 v38_;
13755  const T39 v39_;
13756  const T40 v40_;
13757  const T41 v41_;
13758  const T42 v42_;
13759  const T43 v43_;
13760  const T44 v44_;
13761  const T45 v45_;
13762  const T46 v46_;
13763  const T47 v47_;
13764  const T48 v48_;
13765  const T49 v49_;
13766  const T50 v50_;
13767};
13768
13769# if GTEST_HAS_COMBINE
13770// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
13771//
13772// Generates values from the Cartesian product of values produced
13773// by the argument generators.
13774//
13775template <typename T1, typename T2>
13776class CartesianProductGenerator2
13777    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
13778 public:
13779  typedef ::std::tr1::tuple<T1, T2> ParamType;
13780
13781  CartesianProductGenerator2(const ParamGenerator<T1>& g1,
13782      const ParamGenerator<T2>& g2)
13783      : g1_(g1), g2_(g2) {}
13784  virtual ~CartesianProductGenerator2() {}
13785
13786  virtual ParamIteratorInterface<ParamType>* Begin() const {
13787    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
13788  }
13789  virtual ParamIteratorInterface<ParamType>* End() const {
13790    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
13791  }
13792
13793 private:
13794  class Iterator : public ParamIteratorInterface<ParamType> {
13795   public:
13796    Iterator(const ParamGeneratorInterface<ParamType>* base,
13797      const ParamGenerator<T1>& g1,
13798      const typename ParamGenerator<T1>::iterator& current1,
13799      const ParamGenerator<T2>& g2,
13800      const typename ParamGenerator<T2>::iterator& current2)
13801        : base_(base),
13802          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13803          begin2_(g2.begin()), end2_(g2.end()), current2_(current2)    {
13804      ComputeCurrentValue();
13805    }
13806    virtual ~Iterator() {}
13807
13808    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13809      return base_;
13810    }
13811    // Advance should not be called on beyond-of-range iterators
13812    // so no component iterators must be beyond end of range, either.
13813    virtual void Advance() {
13814      assert(!AtEnd());
13815      ++current2_;
13816      if (current2_ == end2_) {
13817        current2_ = begin2_;
13818        ++current1_;
13819      }
13820      ComputeCurrentValue();
13821    }
13822    virtual ParamIteratorInterface<ParamType>* Clone() const {
13823      return new Iterator(*this);
13824    }
13825    virtual const ParamType* Current() const { return &current_value_; }
13826    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13827      // Having the same base generator guarantees that the other
13828      // iterator is of the same type and we can downcast.
13829      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13830          << "The program attempted to compare iterators "
13831          << "from different generators." << std::endl;
13832      const Iterator* typed_other =
13833          CheckedDowncastToActualType<const Iterator>(&other);
13834      // We must report iterators equal if they both point beyond their
13835      // respective ranges. That can happen in a variety of fashions,
13836      // so we have to consult AtEnd().
13837      return (AtEnd() && typed_other->AtEnd()) ||
13838         (
13839          current1_ == typed_other->current1_ &&
13840          current2_ == typed_other->current2_);
13841    }
13842
13843   private:
13844    Iterator(const Iterator& other)
13845        : base_(other.base_),
13846        begin1_(other.begin1_),
13847        end1_(other.end1_),
13848        current1_(other.current1_),
13849        begin2_(other.begin2_),
13850        end2_(other.end2_),
13851        current2_(other.current2_) {
13852      ComputeCurrentValue();
13853    }
13854
13855    void ComputeCurrentValue() {
13856      if (!AtEnd())
13857        current_value_ = ParamType(*current1_, *current2_);
13858    }
13859    bool AtEnd() const {
13860      // We must report iterator past the end of the range when either of the
13861      // component iterators has reached the end of its range.
13862      return
13863          current1_ == end1_ ||
13864          current2_ == end2_;
13865    }
13866
13867    // No implementation - assignment is unsupported.
13868    void operator=(const Iterator& other);
13869
13870    const ParamGeneratorInterface<ParamType>* const base_;
13871    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13872    // current[i]_ is the actual traversing iterator.
13873    const typename ParamGenerator<T1>::iterator begin1_;
13874    const typename ParamGenerator<T1>::iterator end1_;
13875    typename ParamGenerator<T1>::iterator current1_;
13876    const typename ParamGenerator<T2>::iterator begin2_;
13877    const typename ParamGenerator<T2>::iterator end2_;
13878    typename ParamGenerator<T2>::iterator current2_;
13879    ParamType current_value_;
13880  };  // class CartesianProductGenerator2::Iterator
13881
13882  // No implementation - assignment is unsupported.
13883  void operator=(const CartesianProductGenerator2& other);
13884
13885  const ParamGenerator<T1> g1_;
13886  const ParamGenerator<T2> g2_;
13887};  // class CartesianProductGenerator2
13888
13889
13890template <typename T1, typename T2, typename T3>
13891class CartesianProductGenerator3
13892    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
13893 public:
13894  typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
13895
13896  CartesianProductGenerator3(const ParamGenerator<T1>& g1,
13897      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
13898      : g1_(g1), g2_(g2), g3_(g3) {}
13899  virtual ~CartesianProductGenerator3() {}
13900
13901  virtual ParamIteratorInterface<ParamType>* Begin() const {
13902    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
13903        g3_.begin());
13904  }
13905  virtual ParamIteratorInterface<ParamType>* End() const {
13906    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
13907  }
13908
13909 private:
13910  class Iterator : public ParamIteratorInterface<ParamType> {
13911   public:
13912    Iterator(const ParamGeneratorInterface<ParamType>* base,
13913      const ParamGenerator<T1>& g1,
13914      const typename ParamGenerator<T1>::iterator& current1,
13915      const ParamGenerator<T2>& g2,
13916      const typename ParamGenerator<T2>::iterator& current2,
13917      const ParamGenerator<T3>& g3,
13918      const typename ParamGenerator<T3>::iterator& current3)
13919        : base_(base),
13920          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13921          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
13922          begin3_(g3.begin()), end3_(g3.end()), current3_(current3)    {
13923      ComputeCurrentValue();
13924    }
13925    virtual ~Iterator() {}
13926
13927    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13928      return base_;
13929    }
13930    // Advance should not be called on beyond-of-range iterators
13931    // so no component iterators must be beyond end of range, either.
13932    virtual void Advance() {
13933      assert(!AtEnd());
13934      ++current3_;
13935      if (current3_ == end3_) {
13936        current3_ = begin3_;
13937        ++current2_;
13938      }
13939      if (current2_ == end2_) {
13940        current2_ = begin2_;
13941        ++current1_;
13942      }
13943      ComputeCurrentValue();
13944    }
13945    virtual ParamIteratorInterface<ParamType>* Clone() const {
13946      return new Iterator(*this);
13947    }
13948    virtual const ParamType* Current() const { return &current_value_; }
13949    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13950      // Having the same base generator guarantees that the other
13951      // iterator is of the same type and we can downcast.
13952      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13953          << "The program attempted to compare iterators "
13954          << "from different generators." << std::endl;
13955      const Iterator* typed_other =
13956          CheckedDowncastToActualType<const Iterator>(&other);
13957      // We must report iterators equal if they both point beyond their
13958      // respective ranges. That can happen in a variety of fashions,
13959      // so we have to consult AtEnd().
13960      return (AtEnd() && typed_other->AtEnd()) ||
13961         (
13962          current1_ == typed_other->current1_ &&
13963          current2_ == typed_other->current2_ &&
13964          current3_ == typed_other->current3_);
13965    }
13966
13967   private:
13968    Iterator(const Iterator& other)
13969        : base_(other.base_),
13970        begin1_(other.begin1_),
13971        end1_(other.end1_),
13972        current1_(other.current1_),
13973        begin2_(other.begin2_),
13974        end2_(other.end2_),
13975        current2_(other.current2_),
13976        begin3_(other.begin3_),
13977        end3_(other.end3_),
13978        current3_(other.current3_) {
13979      ComputeCurrentValue();
13980    }
13981
13982    void ComputeCurrentValue() {
13983      if (!AtEnd())
13984        current_value_ = ParamType(*current1_, *current2_, *current3_);
13985    }
13986    bool AtEnd() const {
13987      // We must report iterator past the end of the range when either of the
13988      // component iterators has reached the end of its range.
13989      return
13990          current1_ == end1_ ||
13991          current2_ == end2_ ||
13992          current3_ == end3_;
13993    }
13994
13995    // No implementation - assignment is unsupported.
13996    void operator=(const Iterator& other);
13997
13998    const ParamGeneratorInterface<ParamType>* const base_;
13999    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14000    // current[i]_ is the actual traversing iterator.
14001    const typename ParamGenerator<T1>::iterator begin1_;
14002    const typename ParamGenerator<T1>::iterator end1_;
14003    typename ParamGenerator<T1>::iterator current1_;
14004    const typename ParamGenerator<T2>::iterator begin2_;
14005    const typename ParamGenerator<T2>::iterator end2_;
14006    typename ParamGenerator<T2>::iterator current2_;
14007    const typename ParamGenerator<T3>::iterator begin3_;
14008    const typename ParamGenerator<T3>::iterator end3_;
14009    typename ParamGenerator<T3>::iterator current3_;
14010    ParamType current_value_;
14011  };  // class CartesianProductGenerator3::Iterator
14012
14013  // No implementation - assignment is unsupported.
14014  void operator=(const CartesianProductGenerator3& other);
14015
14016  const ParamGenerator<T1> g1_;
14017  const ParamGenerator<T2> g2_;
14018  const ParamGenerator<T3> g3_;
14019};  // class CartesianProductGenerator3
14020
14021
14022template <typename T1, typename T2, typename T3, typename T4>
14023class CartesianProductGenerator4
14024    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
14025 public:
14026  typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
14027
14028  CartesianProductGenerator4(const ParamGenerator<T1>& g1,
14029      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14030      const ParamGenerator<T4>& g4)
14031      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
14032  virtual ~CartesianProductGenerator4() {}
14033
14034  virtual ParamIteratorInterface<ParamType>* Begin() const {
14035    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14036        g3_.begin(), g4_, g4_.begin());
14037  }
14038  virtual ParamIteratorInterface<ParamType>* End() const {
14039    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14040        g4_, g4_.end());
14041  }
14042
14043 private:
14044  class Iterator : public ParamIteratorInterface<ParamType> {
14045   public:
14046    Iterator(const ParamGeneratorInterface<ParamType>* base,
14047      const ParamGenerator<T1>& g1,
14048      const typename ParamGenerator<T1>::iterator& current1,
14049      const ParamGenerator<T2>& g2,
14050      const typename ParamGenerator<T2>::iterator& current2,
14051      const ParamGenerator<T3>& g3,
14052      const typename ParamGenerator<T3>::iterator& current3,
14053      const ParamGenerator<T4>& g4,
14054      const typename ParamGenerator<T4>::iterator& current4)
14055        : base_(base),
14056          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14057          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14058          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14059          begin4_(g4.begin()), end4_(g4.end()), current4_(current4)    {
14060      ComputeCurrentValue();
14061    }
14062    virtual ~Iterator() {}
14063
14064    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14065      return base_;
14066    }
14067    // Advance should not be called on beyond-of-range iterators
14068    // so no component iterators must be beyond end of range, either.
14069    virtual void Advance() {
14070      assert(!AtEnd());
14071      ++current4_;
14072      if (current4_ == end4_) {
14073        current4_ = begin4_;
14074        ++current3_;
14075      }
14076      if (current3_ == end3_) {
14077        current3_ = begin3_;
14078        ++current2_;
14079      }
14080      if (current2_ == end2_) {
14081        current2_ = begin2_;
14082        ++current1_;
14083      }
14084      ComputeCurrentValue();
14085    }
14086    virtual ParamIteratorInterface<ParamType>* Clone() const {
14087      return new Iterator(*this);
14088    }
14089    virtual const ParamType* Current() const { return &current_value_; }
14090    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14091      // Having the same base generator guarantees that the other
14092      // iterator is of the same type and we can downcast.
14093      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14094          << "The program attempted to compare iterators "
14095          << "from different generators." << std::endl;
14096      const Iterator* typed_other =
14097          CheckedDowncastToActualType<const Iterator>(&other);
14098      // We must report iterators equal if they both point beyond their
14099      // respective ranges. That can happen in a variety of fashions,
14100      // so we have to consult AtEnd().
14101      return (AtEnd() && typed_other->AtEnd()) ||
14102         (
14103          current1_ == typed_other->current1_ &&
14104          current2_ == typed_other->current2_ &&
14105          current3_ == typed_other->current3_ &&
14106          current4_ == typed_other->current4_);
14107    }
14108
14109   private:
14110    Iterator(const Iterator& other)
14111        : base_(other.base_),
14112        begin1_(other.begin1_),
14113        end1_(other.end1_),
14114        current1_(other.current1_),
14115        begin2_(other.begin2_),
14116        end2_(other.end2_),
14117        current2_(other.current2_),
14118        begin3_(other.begin3_),
14119        end3_(other.end3_),
14120        current3_(other.current3_),
14121        begin4_(other.begin4_),
14122        end4_(other.end4_),
14123        current4_(other.current4_) {
14124      ComputeCurrentValue();
14125    }
14126
14127    void ComputeCurrentValue() {
14128      if (!AtEnd())
14129        current_value_ = ParamType(*current1_, *current2_, *current3_,
14130            *current4_);
14131    }
14132    bool AtEnd() const {
14133      // We must report iterator past the end of the range when either of the
14134      // component iterators has reached the end of its range.
14135      return
14136          current1_ == end1_ ||
14137          current2_ == end2_ ||
14138          current3_ == end3_ ||
14139          current4_ == end4_;
14140    }
14141
14142    // No implementation - assignment is unsupported.
14143    void operator=(const Iterator& other);
14144
14145    const ParamGeneratorInterface<ParamType>* const base_;
14146    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14147    // current[i]_ is the actual traversing iterator.
14148    const typename ParamGenerator<T1>::iterator begin1_;
14149    const typename ParamGenerator<T1>::iterator end1_;
14150    typename ParamGenerator<T1>::iterator current1_;
14151    const typename ParamGenerator<T2>::iterator begin2_;
14152    const typename ParamGenerator<T2>::iterator end2_;
14153    typename ParamGenerator<T2>::iterator current2_;
14154    const typename ParamGenerator<T3>::iterator begin3_;
14155    const typename ParamGenerator<T3>::iterator end3_;
14156    typename ParamGenerator<T3>::iterator current3_;
14157    const typename ParamGenerator<T4>::iterator begin4_;
14158    const typename ParamGenerator<T4>::iterator end4_;
14159    typename ParamGenerator<T4>::iterator current4_;
14160    ParamType current_value_;
14161  };  // class CartesianProductGenerator4::Iterator
14162
14163  // No implementation - assignment is unsupported.
14164  void operator=(const CartesianProductGenerator4& other);
14165
14166  const ParamGenerator<T1> g1_;
14167  const ParamGenerator<T2> g2_;
14168  const ParamGenerator<T3> g3_;
14169  const ParamGenerator<T4> g4_;
14170};  // class CartesianProductGenerator4
14171
14172
14173template <typename T1, typename T2, typename T3, typename T4, typename T5>
14174class CartesianProductGenerator5
14175    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
14176 public:
14177  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
14178
14179  CartesianProductGenerator5(const ParamGenerator<T1>& g1,
14180      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14181      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
14182      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
14183  virtual ~CartesianProductGenerator5() {}
14184
14185  virtual ParamIteratorInterface<ParamType>* Begin() const {
14186    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14187        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
14188  }
14189  virtual ParamIteratorInterface<ParamType>* End() const {
14190    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14191        g4_, g4_.end(), g5_, g5_.end());
14192  }
14193
14194 private:
14195  class Iterator : public ParamIteratorInterface<ParamType> {
14196   public:
14197    Iterator(const ParamGeneratorInterface<ParamType>* base,
14198      const ParamGenerator<T1>& g1,
14199      const typename ParamGenerator<T1>::iterator& current1,
14200      const ParamGenerator<T2>& g2,
14201      const typename ParamGenerator<T2>::iterator& current2,
14202      const ParamGenerator<T3>& g3,
14203      const typename ParamGenerator<T3>::iterator& current3,
14204      const ParamGenerator<T4>& g4,
14205      const typename ParamGenerator<T4>::iterator& current4,
14206      const ParamGenerator<T5>& g5,
14207      const typename ParamGenerator<T5>::iterator& current5)
14208        : base_(base),
14209          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14210          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14211          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14212          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14213          begin5_(g5.begin()), end5_(g5.end()), current5_(current5)    {
14214      ComputeCurrentValue();
14215    }
14216    virtual ~Iterator() {}
14217
14218    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14219      return base_;
14220    }
14221    // Advance should not be called on beyond-of-range iterators
14222    // so no component iterators must be beyond end of range, either.
14223    virtual void Advance() {
14224      assert(!AtEnd());
14225      ++current5_;
14226      if (current5_ == end5_) {
14227        current5_ = begin5_;
14228        ++current4_;
14229      }
14230      if (current4_ == end4_) {
14231        current4_ = begin4_;
14232        ++current3_;
14233      }
14234      if (current3_ == end3_) {
14235        current3_ = begin3_;
14236        ++current2_;
14237      }
14238      if (current2_ == end2_) {
14239        current2_ = begin2_;
14240        ++current1_;
14241      }
14242      ComputeCurrentValue();
14243    }
14244    virtual ParamIteratorInterface<ParamType>* Clone() const {
14245      return new Iterator(*this);
14246    }
14247    virtual const ParamType* Current() const { return &current_value_; }
14248    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14249      // Having the same base generator guarantees that the other
14250      // iterator is of the same type and we can downcast.
14251      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14252          << "The program attempted to compare iterators "
14253          << "from different generators." << std::endl;
14254      const Iterator* typed_other =
14255          CheckedDowncastToActualType<const Iterator>(&other);
14256      // We must report iterators equal if they both point beyond their
14257      // respective ranges. That can happen in a variety of fashions,
14258      // so we have to consult AtEnd().
14259      return (AtEnd() && typed_other->AtEnd()) ||
14260         (
14261          current1_ == typed_other->current1_ &&
14262          current2_ == typed_other->current2_ &&
14263          current3_ == typed_other->current3_ &&
14264          current4_ == typed_other->current4_ &&
14265          current5_ == typed_other->current5_);
14266    }
14267
14268   private:
14269    Iterator(const Iterator& other)
14270        : base_(other.base_),
14271        begin1_(other.begin1_),
14272        end1_(other.end1_),
14273        current1_(other.current1_),
14274        begin2_(other.begin2_),
14275        end2_(other.end2_),
14276        current2_(other.current2_),
14277        begin3_(other.begin3_),
14278        end3_(other.end3_),
14279        current3_(other.current3_),
14280        begin4_(other.begin4_),
14281        end4_(other.end4_),
14282        current4_(other.current4_),
14283        begin5_(other.begin5_),
14284        end5_(other.end5_),
14285        current5_(other.current5_) {
14286      ComputeCurrentValue();
14287    }
14288
14289    void ComputeCurrentValue() {
14290      if (!AtEnd())
14291        current_value_ = ParamType(*current1_, *current2_, *current3_,
14292            *current4_, *current5_);
14293    }
14294    bool AtEnd() const {
14295      // We must report iterator past the end of the range when either of the
14296      // component iterators has reached the end of its range.
14297      return
14298          current1_ == end1_ ||
14299          current2_ == end2_ ||
14300          current3_ == end3_ ||
14301          current4_ == end4_ ||
14302          current5_ == end5_;
14303    }
14304
14305    // No implementation - assignment is unsupported.
14306    void operator=(const Iterator& other);
14307
14308    const ParamGeneratorInterface<ParamType>* const base_;
14309    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14310    // current[i]_ is the actual traversing iterator.
14311    const typename ParamGenerator<T1>::iterator begin1_;
14312    const typename ParamGenerator<T1>::iterator end1_;
14313    typename ParamGenerator<T1>::iterator current1_;
14314    const typename ParamGenerator<T2>::iterator begin2_;
14315    const typename ParamGenerator<T2>::iterator end2_;
14316    typename ParamGenerator<T2>::iterator current2_;
14317    const typename ParamGenerator<T3>::iterator begin3_;
14318    const typename ParamGenerator<T3>::iterator end3_;
14319    typename ParamGenerator<T3>::iterator current3_;
14320    const typename ParamGenerator<T4>::iterator begin4_;
14321    const typename ParamGenerator<T4>::iterator end4_;
14322    typename ParamGenerator<T4>::iterator current4_;
14323    const typename ParamGenerator<T5>::iterator begin5_;
14324    const typename ParamGenerator<T5>::iterator end5_;
14325    typename ParamGenerator<T5>::iterator current5_;
14326    ParamType current_value_;
14327  };  // class CartesianProductGenerator5::Iterator
14328
14329  // No implementation - assignment is unsupported.
14330  void operator=(const CartesianProductGenerator5& other);
14331
14332  const ParamGenerator<T1> g1_;
14333  const ParamGenerator<T2> g2_;
14334  const ParamGenerator<T3> g3_;
14335  const ParamGenerator<T4> g4_;
14336  const ParamGenerator<T5> g5_;
14337};  // class CartesianProductGenerator5
14338
14339
14340template <typename T1, typename T2, typename T3, typename T4, typename T5,
14341    typename T6>
14342class CartesianProductGenerator6
14343    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
14344        T6> > {
14345 public:
14346  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
14347
14348  CartesianProductGenerator6(const ParamGenerator<T1>& g1,
14349      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14350      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14351      const ParamGenerator<T6>& g6)
14352      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
14353  virtual ~CartesianProductGenerator6() {}
14354
14355  virtual ParamIteratorInterface<ParamType>* Begin() const {
14356    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14357        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
14358  }
14359  virtual ParamIteratorInterface<ParamType>* End() const {
14360    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14361        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
14362  }
14363
14364 private:
14365  class Iterator : public ParamIteratorInterface<ParamType> {
14366   public:
14367    Iterator(const ParamGeneratorInterface<ParamType>* base,
14368      const ParamGenerator<T1>& g1,
14369      const typename ParamGenerator<T1>::iterator& current1,
14370      const ParamGenerator<T2>& g2,
14371      const typename ParamGenerator<T2>::iterator& current2,
14372      const ParamGenerator<T3>& g3,
14373      const typename ParamGenerator<T3>::iterator& current3,
14374      const ParamGenerator<T4>& g4,
14375      const typename ParamGenerator<T4>::iterator& current4,
14376      const ParamGenerator<T5>& g5,
14377      const typename ParamGenerator<T5>::iterator& current5,
14378      const ParamGenerator<T6>& g6,
14379      const typename ParamGenerator<T6>::iterator& current6)
14380        : base_(base),
14381          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14382          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14383          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14384          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14385          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14386          begin6_(g6.begin()), end6_(g6.end()), current6_(current6)    {
14387      ComputeCurrentValue();
14388    }
14389    virtual ~Iterator() {}
14390
14391    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14392      return base_;
14393    }
14394    // Advance should not be called on beyond-of-range iterators
14395    // so no component iterators must be beyond end of range, either.
14396    virtual void Advance() {
14397      assert(!AtEnd());
14398      ++current6_;
14399      if (current6_ == end6_) {
14400        current6_ = begin6_;
14401        ++current5_;
14402      }
14403      if (current5_ == end5_) {
14404        current5_ = begin5_;
14405        ++current4_;
14406      }
14407      if (current4_ == end4_) {
14408        current4_ = begin4_;
14409        ++current3_;
14410      }
14411      if (current3_ == end3_) {
14412        current3_ = begin3_;
14413        ++current2_;
14414      }
14415      if (current2_ == end2_) {
14416        current2_ = begin2_;
14417        ++current1_;
14418      }
14419      ComputeCurrentValue();
14420    }
14421    virtual ParamIteratorInterface<ParamType>* Clone() const {
14422      return new Iterator(*this);
14423    }
14424    virtual const ParamType* Current() const { return &current_value_; }
14425    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14426      // Having the same base generator guarantees that the other
14427      // iterator is of the same type and we can downcast.
14428      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14429          << "The program attempted to compare iterators "
14430          << "from different generators." << std::endl;
14431      const Iterator* typed_other =
14432          CheckedDowncastToActualType<const Iterator>(&other);
14433      // We must report iterators equal if they both point beyond their
14434      // respective ranges. That can happen in a variety of fashions,
14435      // so we have to consult AtEnd().
14436      return (AtEnd() && typed_other->AtEnd()) ||
14437         (
14438          current1_ == typed_other->current1_ &&
14439          current2_ == typed_other->current2_ &&
14440          current3_ == typed_other->current3_ &&
14441          current4_ == typed_other->current4_ &&
14442          current5_ == typed_other->current5_ &&
14443          current6_ == typed_other->current6_);
14444    }
14445
14446   private:
14447    Iterator(const Iterator& other)
14448        : base_(other.base_),
14449        begin1_(other.begin1_),
14450        end1_(other.end1_),
14451        current1_(other.current1_),
14452        begin2_(other.begin2_),
14453        end2_(other.end2_),
14454        current2_(other.current2_),
14455        begin3_(other.begin3_),
14456        end3_(other.end3_),
14457        current3_(other.current3_),
14458        begin4_(other.begin4_),
14459        end4_(other.end4_),
14460        current4_(other.current4_),
14461        begin5_(other.begin5_),
14462        end5_(other.end5_),
14463        current5_(other.current5_),
14464        begin6_(other.begin6_),
14465        end6_(other.end6_),
14466        current6_(other.current6_) {
14467      ComputeCurrentValue();
14468    }
14469
14470    void ComputeCurrentValue() {
14471      if (!AtEnd())
14472        current_value_ = ParamType(*current1_, *current2_, *current3_,
14473            *current4_, *current5_, *current6_);
14474    }
14475    bool AtEnd() const {
14476      // We must report iterator past the end of the range when either of the
14477      // component iterators has reached the end of its range.
14478      return
14479          current1_ == end1_ ||
14480          current2_ == end2_ ||
14481          current3_ == end3_ ||
14482          current4_ == end4_ ||
14483          current5_ == end5_ ||
14484          current6_ == end6_;
14485    }
14486
14487    // No implementation - assignment is unsupported.
14488    void operator=(const Iterator& other);
14489
14490    const ParamGeneratorInterface<ParamType>* const base_;
14491    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14492    // current[i]_ is the actual traversing iterator.
14493    const typename ParamGenerator<T1>::iterator begin1_;
14494    const typename ParamGenerator<T1>::iterator end1_;
14495    typename ParamGenerator<T1>::iterator current1_;
14496    const typename ParamGenerator<T2>::iterator begin2_;
14497    const typename ParamGenerator<T2>::iterator end2_;
14498    typename ParamGenerator<T2>::iterator current2_;
14499    const typename ParamGenerator<T3>::iterator begin3_;
14500    const typename ParamGenerator<T3>::iterator end3_;
14501    typename ParamGenerator<T3>::iterator current3_;
14502    const typename ParamGenerator<T4>::iterator begin4_;
14503    const typename ParamGenerator<T4>::iterator end4_;
14504    typename ParamGenerator<T4>::iterator current4_;
14505    const typename ParamGenerator<T5>::iterator begin5_;
14506    const typename ParamGenerator<T5>::iterator end5_;
14507    typename ParamGenerator<T5>::iterator current5_;
14508    const typename ParamGenerator<T6>::iterator begin6_;
14509    const typename ParamGenerator<T6>::iterator end6_;
14510    typename ParamGenerator<T6>::iterator current6_;
14511    ParamType current_value_;
14512  };  // class CartesianProductGenerator6::Iterator
14513
14514  // No implementation - assignment is unsupported.
14515  void operator=(const CartesianProductGenerator6& other);
14516
14517  const ParamGenerator<T1> g1_;
14518  const ParamGenerator<T2> g2_;
14519  const ParamGenerator<T3> g3_;
14520  const ParamGenerator<T4> g4_;
14521  const ParamGenerator<T5> g5_;
14522  const ParamGenerator<T6> g6_;
14523};  // class CartesianProductGenerator6
14524
14525
14526template <typename T1, typename T2, typename T3, typename T4, typename T5,
14527    typename T6, typename T7>
14528class CartesianProductGenerator7
14529    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14530        T7> > {
14531 public:
14532  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
14533
14534  CartesianProductGenerator7(const ParamGenerator<T1>& g1,
14535      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14536      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14537      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
14538      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
14539  virtual ~CartesianProductGenerator7() {}
14540
14541  virtual ParamIteratorInterface<ParamType>* Begin() const {
14542    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14543        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14544        g7_.begin());
14545  }
14546  virtual ParamIteratorInterface<ParamType>* End() const {
14547    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14548        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
14549  }
14550
14551 private:
14552  class Iterator : public ParamIteratorInterface<ParamType> {
14553   public:
14554    Iterator(const ParamGeneratorInterface<ParamType>* base,
14555      const ParamGenerator<T1>& g1,
14556      const typename ParamGenerator<T1>::iterator& current1,
14557      const ParamGenerator<T2>& g2,
14558      const typename ParamGenerator<T2>::iterator& current2,
14559      const ParamGenerator<T3>& g3,
14560      const typename ParamGenerator<T3>::iterator& current3,
14561      const ParamGenerator<T4>& g4,
14562      const typename ParamGenerator<T4>::iterator& current4,
14563      const ParamGenerator<T5>& g5,
14564      const typename ParamGenerator<T5>::iterator& current5,
14565      const ParamGenerator<T6>& g6,
14566      const typename ParamGenerator<T6>::iterator& current6,
14567      const ParamGenerator<T7>& g7,
14568      const typename ParamGenerator<T7>::iterator& current7)
14569        : base_(base),
14570          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14571          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14572          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14573          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14574          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14575          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14576          begin7_(g7.begin()), end7_(g7.end()), current7_(current7)    {
14577      ComputeCurrentValue();
14578    }
14579    virtual ~Iterator() {}
14580
14581    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14582      return base_;
14583    }
14584    // Advance should not be called on beyond-of-range iterators
14585    // so no component iterators must be beyond end of range, either.
14586    virtual void Advance() {
14587      assert(!AtEnd());
14588      ++current7_;
14589      if (current7_ == end7_) {
14590        current7_ = begin7_;
14591        ++current6_;
14592      }
14593      if (current6_ == end6_) {
14594        current6_ = begin6_;
14595        ++current5_;
14596      }
14597      if (current5_ == end5_) {
14598        current5_ = begin5_;
14599        ++current4_;
14600      }
14601      if (current4_ == end4_) {
14602        current4_ = begin4_;
14603        ++current3_;
14604      }
14605      if (current3_ == end3_) {
14606        current3_ = begin3_;
14607        ++current2_;
14608      }
14609      if (current2_ == end2_) {
14610        current2_ = begin2_;
14611        ++current1_;
14612      }
14613      ComputeCurrentValue();
14614    }
14615    virtual ParamIteratorInterface<ParamType>* Clone() const {
14616      return new Iterator(*this);
14617    }
14618    virtual const ParamType* Current() const { return &current_value_; }
14619    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14620      // Having the same base generator guarantees that the other
14621      // iterator is of the same type and we can downcast.
14622      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14623          << "The program attempted to compare iterators "
14624          << "from different generators." << std::endl;
14625      const Iterator* typed_other =
14626          CheckedDowncastToActualType<const Iterator>(&other);
14627      // We must report iterators equal if they both point beyond their
14628      // respective ranges. That can happen in a variety of fashions,
14629      // so we have to consult AtEnd().
14630      return (AtEnd() && typed_other->AtEnd()) ||
14631         (
14632          current1_ == typed_other->current1_ &&
14633          current2_ == typed_other->current2_ &&
14634          current3_ == typed_other->current3_ &&
14635          current4_ == typed_other->current4_ &&
14636          current5_ == typed_other->current5_ &&
14637          current6_ == typed_other->current6_ &&
14638          current7_ == typed_other->current7_);
14639    }
14640
14641   private:
14642    Iterator(const Iterator& other)
14643        : base_(other.base_),
14644        begin1_(other.begin1_),
14645        end1_(other.end1_),
14646        current1_(other.current1_),
14647        begin2_(other.begin2_),
14648        end2_(other.end2_),
14649        current2_(other.current2_),
14650        begin3_(other.begin3_),
14651        end3_(other.end3_),
14652        current3_(other.current3_),
14653        begin4_(other.begin4_),
14654        end4_(other.end4_),
14655        current4_(other.current4_),
14656        begin5_(other.begin5_),
14657        end5_(other.end5_),
14658        current5_(other.current5_),
14659        begin6_(other.begin6_),
14660        end6_(other.end6_),
14661        current6_(other.current6_),
14662        begin7_(other.begin7_),
14663        end7_(other.end7_),
14664        current7_(other.current7_) {
14665      ComputeCurrentValue();
14666    }
14667
14668    void ComputeCurrentValue() {
14669      if (!AtEnd())
14670        current_value_ = ParamType(*current1_, *current2_, *current3_,
14671            *current4_, *current5_, *current6_, *current7_);
14672    }
14673    bool AtEnd() const {
14674      // We must report iterator past the end of the range when either of the
14675      // component iterators has reached the end of its range.
14676      return
14677          current1_ == end1_ ||
14678          current2_ == end2_ ||
14679          current3_ == end3_ ||
14680          current4_ == end4_ ||
14681          current5_ == end5_ ||
14682          current6_ == end6_ ||
14683          current7_ == end7_;
14684    }
14685
14686    // No implementation - assignment is unsupported.
14687    void operator=(const Iterator& other);
14688
14689    const ParamGeneratorInterface<ParamType>* const base_;
14690    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14691    // current[i]_ is the actual traversing iterator.
14692    const typename ParamGenerator<T1>::iterator begin1_;
14693    const typename ParamGenerator<T1>::iterator end1_;
14694    typename ParamGenerator<T1>::iterator current1_;
14695    const typename ParamGenerator<T2>::iterator begin2_;
14696    const typename ParamGenerator<T2>::iterator end2_;
14697    typename ParamGenerator<T2>::iterator current2_;
14698    const typename ParamGenerator<T3>::iterator begin3_;
14699    const typename ParamGenerator<T3>::iterator end3_;
14700    typename ParamGenerator<T3>::iterator current3_;
14701    const typename ParamGenerator<T4>::iterator begin4_;
14702    const typename ParamGenerator<T4>::iterator end4_;
14703    typename ParamGenerator<T4>::iterator current4_;
14704    const typename ParamGenerator<T5>::iterator begin5_;
14705    const typename ParamGenerator<T5>::iterator end5_;
14706    typename ParamGenerator<T5>::iterator current5_;
14707    const typename ParamGenerator<T6>::iterator begin6_;
14708    const typename ParamGenerator<T6>::iterator end6_;
14709    typename ParamGenerator<T6>::iterator current6_;
14710    const typename ParamGenerator<T7>::iterator begin7_;
14711    const typename ParamGenerator<T7>::iterator end7_;
14712    typename ParamGenerator<T7>::iterator current7_;
14713    ParamType current_value_;
14714  };  // class CartesianProductGenerator7::Iterator
14715
14716  // No implementation - assignment is unsupported.
14717  void operator=(const CartesianProductGenerator7& other);
14718
14719  const ParamGenerator<T1> g1_;
14720  const ParamGenerator<T2> g2_;
14721  const ParamGenerator<T3> g3_;
14722  const ParamGenerator<T4> g4_;
14723  const ParamGenerator<T5> g5_;
14724  const ParamGenerator<T6> g6_;
14725  const ParamGenerator<T7> g7_;
14726};  // class CartesianProductGenerator7
14727
14728
14729template <typename T1, typename T2, typename T3, typename T4, typename T5,
14730    typename T6, typename T7, typename T8>
14731class CartesianProductGenerator8
14732    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14733        T7, T8> > {
14734 public:
14735  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
14736
14737  CartesianProductGenerator8(const ParamGenerator<T1>& g1,
14738      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14739      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14740      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14741      const ParamGenerator<T8>& g8)
14742      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
14743          g8_(g8) {}
14744  virtual ~CartesianProductGenerator8() {}
14745
14746  virtual ParamIteratorInterface<ParamType>* Begin() const {
14747    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14748        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14749        g7_.begin(), g8_, g8_.begin());
14750  }
14751  virtual ParamIteratorInterface<ParamType>* End() const {
14752    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14753        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14754        g8_.end());
14755  }
14756
14757 private:
14758  class Iterator : public ParamIteratorInterface<ParamType> {
14759   public:
14760    Iterator(const ParamGeneratorInterface<ParamType>* base,
14761      const ParamGenerator<T1>& g1,
14762      const typename ParamGenerator<T1>::iterator& current1,
14763      const ParamGenerator<T2>& g2,
14764      const typename ParamGenerator<T2>::iterator& current2,
14765      const ParamGenerator<T3>& g3,
14766      const typename ParamGenerator<T3>::iterator& current3,
14767      const ParamGenerator<T4>& g4,
14768      const typename ParamGenerator<T4>::iterator& current4,
14769      const ParamGenerator<T5>& g5,
14770      const typename ParamGenerator<T5>::iterator& current5,
14771      const ParamGenerator<T6>& g6,
14772      const typename ParamGenerator<T6>::iterator& current6,
14773      const ParamGenerator<T7>& g7,
14774      const typename ParamGenerator<T7>::iterator& current7,
14775      const ParamGenerator<T8>& g8,
14776      const typename ParamGenerator<T8>::iterator& current8)
14777        : base_(base),
14778          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14779          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14780          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14781          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14782          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14783          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14784          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
14785          begin8_(g8.begin()), end8_(g8.end()), current8_(current8)    {
14786      ComputeCurrentValue();
14787    }
14788    virtual ~Iterator() {}
14789
14790    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14791      return base_;
14792    }
14793    // Advance should not be called on beyond-of-range iterators
14794    // so no component iterators must be beyond end of range, either.
14795    virtual void Advance() {
14796      assert(!AtEnd());
14797      ++current8_;
14798      if (current8_ == end8_) {
14799        current8_ = begin8_;
14800        ++current7_;
14801      }
14802      if (current7_ == end7_) {
14803        current7_ = begin7_;
14804        ++current6_;
14805      }
14806      if (current6_ == end6_) {
14807        current6_ = begin6_;
14808        ++current5_;
14809      }
14810      if (current5_ == end5_) {
14811        current5_ = begin5_;
14812        ++current4_;
14813      }
14814      if (current4_ == end4_) {
14815        current4_ = begin4_;
14816        ++current3_;
14817      }
14818      if (current3_ == end3_) {
14819        current3_ = begin3_;
14820        ++current2_;
14821      }
14822      if (current2_ == end2_) {
14823        current2_ = begin2_;
14824        ++current1_;
14825      }
14826      ComputeCurrentValue();
14827    }
14828    virtual ParamIteratorInterface<ParamType>* Clone() const {
14829      return new Iterator(*this);
14830    }
14831    virtual const ParamType* Current() const { return &current_value_; }
14832    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14833      // Having the same base generator guarantees that the other
14834      // iterator is of the same type and we can downcast.
14835      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14836          << "The program attempted to compare iterators "
14837          << "from different generators." << std::endl;
14838      const Iterator* typed_other =
14839          CheckedDowncastToActualType<const Iterator>(&other);
14840      // We must report iterators equal if they both point beyond their
14841      // respective ranges. That can happen in a variety of fashions,
14842      // so we have to consult AtEnd().
14843      return (AtEnd() && typed_other->AtEnd()) ||
14844         (
14845          current1_ == typed_other->current1_ &&
14846          current2_ == typed_other->current2_ &&
14847          current3_ == typed_other->current3_ &&
14848          current4_ == typed_other->current4_ &&
14849          current5_ == typed_other->current5_ &&
14850          current6_ == typed_other->current6_ &&
14851          current7_ == typed_other->current7_ &&
14852          current8_ == typed_other->current8_);
14853    }
14854
14855   private:
14856    Iterator(const Iterator& other)
14857        : base_(other.base_),
14858        begin1_(other.begin1_),
14859        end1_(other.end1_),
14860        current1_(other.current1_),
14861        begin2_(other.begin2_),
14862        end2_(other.end2_),
14863        current2_(other.current2_),
14864        begin3_(other.begin3_),
14865        end3_(other.end3_),
14866        current3_(other.current3_),
14867        begin4_(other.begin4_),
14868        end4_(other.end4_),
14869        current4_(other.current4_),
14870        begin5_(other.begin5_),
14871        end5_(other.end5_),
14872        current5_(other.current5_),
14873        begin6_(other.begin6_),
14874        end6_(other.end6_),
14875        current6_(other.current6_),
14876        begin7_(other.begin7_),
14877        end7_(other.end7_),
14878        current7_(other.current7_),
14879        begin8_(other.begin8_),
14880        end8_(other.end8_),
14881        current8_(other.current8_) {
14882      ComputeCurrentValue();
14883    }
14884
14885    void ComputeCurrentValue() {
14886      if (!AtEnd())
14887        current_value_ = ParamType(*current1_, *current2_, *current3_,
14888            *current4_, *current5_, *current6_, *current7_, *current8_);
14889    }
14890    bool AtEnd() const {
14891      // We must report iterator past the end of the range when either of the
14892      // component iterators has reached the end of its range.
14893      return
14894          current1_ == end1_ ||
14895          current2_ == end2_ ||
14896          current3_ == end3_ ||
14897          current4_ == end4_ ||
14898          current5_ == end5_ ||
14899          current6_ == end6_ ||
14900          current7_ == end7_ ||
14901          current8_ == end8_;
14902    }
14903
14904    // No implementation - assignment is unsupported.
14905    void operator=(const Iterator& other);
14906
14907    const ParamGeneratorInterface<ParamType>* const base_;
14908    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14909    // current[i]_ is the actual traversing iterator.
14910    const typename ParamGenerator<T1>::iterator begin1_;
14911    const typename ParamGenerator<T1>::iterator end1_;
14912    typename ParamGenerator<T1>::iterator current1_;
14913    const typename ParamGenerator<T2>::iterator begin2_;
14914    const typename ParamGenerator<T2>::iterator end2_;
14915    typename ParamGenerator<T2>::iterator current2_;
14916    const typename ParamGenerator<T3>::iterator begin3_;
14917    const typename ParamGenerator<T3>::iterator end3_;
14918    typename ParamGenerator<T3>::iterator current3_;
14919    const typename ParamGenerator<T4>::iterator begin4_;
14920    const typename ParamGenerator<T4>::iterator end4_;
14921    typename ParamGenerator<T4>::iterator current4_;
14922    const typename ParamGenerator<T5>::iterator begin5_;
14923    const typename ParamGenerator<T5>::iterator end5_;
14924    typename ParamGenerator<T5>::iterator current5_;
14925    const typename ParamGenerator<T6>::iterator begin6_;
14926    const typename ParamGenerator<T6>::iterator end6_;
14927    typename ParamGenerator<T6>::iterator current6_;
14928    const typename ParamGenerator<T7>::iterator begin7_;
14929    const typename ParamGenerator<T7>::iterator end7_;
14930    typename ParamGenerator<T7>::iterator current7_;
14931    const typename ParamGenerator<T8>::iterator begin8_;
14932    const typename ParamGenerator<T8>::iterator end8_;
14933    typename ParamGenerator<T8>::iterator current8_;
14934    ParamType current_value_;
14935  };  // class CartesianProductGenerator8::Iterator
14936
14937  // No implementation - assignment is unsupported.
14938  void operator=(const CartesianProductGenerator8& other);
14939
14940  const ParamGenerator<T1> g1_;
14941  const ParamGenerator<T2> g2_;
14942  const ParamGenerator<T3> g3_;
14943  const ParamGenerator<T4> g4_;
14944  const ParamGenerator<T5> g5_;
14945  const ParamGenerator<T6> g6_;
14946  const ParamGenerator<T7> g7_;
14947  const ParamGenerator<T8> g8_;
14948};  // class CartesianProductGenerator8
14949
14950
14951template <typename T1, typename T2, typename T3, typename T4, typename T5,
14952    typename T6, typename T7, typename T8, typename T9>
14953class CartesianProductGenerator9
14954    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14955        T7, T8, T9> > {
14956 public:
14957  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
14958
14959  CartesianProductGenerator9(const ParamGenerator<T1>& g1,
14960      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14961      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14962      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14963      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
14964      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
14965          g9_(g9) {}
14966  virtual ~CartesianProductGenerator9() {}
14967
14968  virtual ParamIteratorInterface<ParamType>* Begin() const {
14969    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14970        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14971        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
14972  }
14973  virtual ParamIteratorInterface<ParamType>* End() const {
14974    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14975        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14976        g8_.end(), g9_, g9_.end());
14977  }
14978
14979 private:
14980  class Iterator : public ParamIteratorInterface<ParamType> {
14981   public:
14982    Iterator(const ParamGeneratorInterface<ParamType>* base,
14983      const ParamGenerator<T1>& g1,
14984      const typename ParamGenerator<T1>::iterator& current1,
14985      const ParamGenerator<T2>& g2,
14986      const typename ParamGenerator<T2>::iterator& current2,
14987      const ParamGenerator<T3>& g3,
14988      const typename ParamGenerator<T3>::iterator& current3,
14989      const ParamGenerator<T4>& g4,
14990      const typename ParamGenerator<T4>::iterator& current4,
14991      const ParamGenerator<T5>& g5,
14992      const typename ParamGenerator<T5>::iterator& current5,
14993      const ParamGenerator<T6>& g6,
14994      const typename ParamGenerator<T6>::iterator& current6,
14995      const ParamGenerator<T7>& g7,
14996      const typename ParamGenerator<T7>::iterator& current7,
14997      const ParamGenerator<T8>& g8,
14998      const typename ParamGenerator<T8>::iterator& current8,
14999      const ParamGenerator<T9>& g9,
15000      const typename ParamGenerator<T9>::iterator& current9)
15001        : base_(base),
15002          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15003          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15004          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15005          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15006          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15007          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15008          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15009          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15010          begin9_(g9.begin()), end9_(g9.end()), current9_(current9)    {
15011      ComputeCurrentValue();
15012    }
15013    virtual ~Iterator() {}
15014
15015    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15016      return base_;
15017    }
15018    // Advance should not be called on beyond-of-range iterators
15019    // so no component iterators must be beyond end of range, either.
15020    virtual void Advance() {
15021      assert(!AtEnd());
15022      ++current9_;
15023      if (current9_ == end9_) {
15024        current9_ = begin9_;
15025        ++current8_;
15026      }
15027      if (current8_ == end8_) {
15028        current8_ = begin8_;
15029        ++current7_;
15030      }
15031      if (current7_ == end7_) {
15032        current7_ = begin7_;
15033        ++current6_;
15034      }
15035      if (current6_ == end6_) {
15036        current6_ = begin6_;
15037        ++current5_;
15038      }
15039      if (current5_ == end5_) {
15040        current5_ = begin5_;
15041        ++current4_;
15042      }
15043      if (current4_ == end4_) {
15044        current4_ = begin4_;
15045        ++current3_;
15046      }
15047      if (current3_ == end3_) {
15048        current3_ = begin3_;
15049        ++current2_;
15050      }
15051      if (current2_ == end2_) {
15052        current2_ = begin2_;
15053        ++current1_;
15054      }
15055      ComputeCurrentValue();
15056    }
15057    virtual ParamIteratorInterface<ParamType>* Clone() const {
15058      return new Iterator(*this);
15059    }
15060    virtual const ParamType* Current() const { return &current_value_; }
15061    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15062      // Having the same base generator guarantees that the other
15063      // iterator is of the same type and we can downcast.
15064      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15065          << "The program attempted to compare iterators "
15066          << "from different generators." << std::endl;
15067      const Iterator* typed_other =
15068          CheckedDowncastToActualType<const Iterator>(&other);
15069      // We must report iterators equal if they both point beyond their
15070      // respective ranges. That can happen in a variety of fashions,
15071      // so we have to consult AtEnd().
15072      return (AtEnd() && typed_other->AtEnd()) ||
15073         (
15074          current1_ == typed_other->current1_ &&
15075          current2_ == typed_other->current2_ &&
15076          current3_ == typed_other->current3_ &&
15077          current4_ == typed_other->current4_ &&
15078          current5_ == typed_other->current5_ &&
15079          current6_ == typed_other->current6_ &&
15080          current7_ == typed_other->current7_ &&
15081          current8_ == typed_other->current8_ &&
15082          current9_ == typed_other->current9_);
15083    }
15084
15085   private:
15086    Iterator(const Iterator& other)
15087        : base_(other.base_),
15088        begin1_(other.begin1_),
15089        end1_(other.end1_),
15090        current1_(other.current1_),
15091        begin2_(other.begin2_),
15092        end2_(other.end2_),
15093        current2_(other.current2_),
15094        begin3_(other.begin3_),
15095        end3_(other.end3_),
15096        current3_(other.current3_),
15097        begin4_(other.begin4_),
15098        end4_(other.end4_),
15099        current4_(other.current4_),
15100        begin5_(other.begin5_),
15101        end5_(other.end5_),
15102        current5_(other.current5_),
15103        begin6_(other.begin6_),
15104        end6_(other.end6_),
15105        current6_(other.current6_),
15106        begin7_(other.begin7_),
15107        end7_(other.end7_),
15108        current7_(other.current7_),
15109        begin8_(other.begin8_),
15110        end8_(other.end8_),
15111        current8_(other.current8_),
15112        begin9_(other.begin9_),
15113        end9_(other.end9_),
15114        current9_(other.current9_) {
15115      ComputeCurrentValue();
15116    }
15117
15118    void ComputeCurrentValue() {
15119      if (!AtEnd())
15120        current_value_ = ParamType(*current1_, *current2_, *current3_,
15121            *current4_, *current5_, *current6_, *current7_, *current8_,
15122            *current9_);
15123    }
15124    bool AtEnd() const {
15125      // We must report iterator past the end of the range when either of the
15126      // component iterators has reached the end of its range.
15127      return
15128          current1_ == end1_ ||
15129          current2_ == end2_ ||
15130          current3_ == end3_ ||
15131          current4_ == end4_ ||
15132          current5_ == end5_ ||
15133          current6_ == end6_ ||
15134          current7_ == end7_ ||
15135          current8_ == end8_ ||
15136          current9_ == end9_;
15137    }
15138
15139    // No implementation - assignment is unsupported.
15140    void operator=(const Iterator& other);
15141
15142    const ParamGeneratorInterface<ParamType>* const base_;
15143    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15144    // current[i]_ is the actual traversing iterator.
15145    const typename ParamGenerator<T1>::iterator begin1_;
15146    const typename ParamGenerator<T1>::iterator end1_;
15147    typename ParamGenerator<T1>::iterator current1_;
15148    const typename ParamGenerator<T2>::iterator begin2_;
15149    const typename ParamGenerator<T2>::iterator end2_;
15150    typename ParamGenerator<T2>::iterator current2_;
15151    const typename ParamGenerator<T3>::iterator begin3_;
15152    const typename ParamGenerator<T3>::iterator end3_;
15153    typename ParamGenerator<T3>::iterator current3_;
15154    const typename ParamGenerator<T4>::iterator begin4_;
15155    const typename ParamGenerator<T4>::iterator end4_;
15156    typename ParamGenerator<T4>::iterator current4_;
15157    const typename ParamGenerator<T5>::iterator begin5_;
15158    const typename ParamGenerator<T5>::iterator end5_;
15159    typename ParamGenerator<T5>::iterator current5_;
15160    const typename ParamGenerator<T6>::iterator begin6_;
15161    const typename ParamGenerator<T6>::iterator end6_;
15162    typename ParamGenerator<T6>::iterator current6_;
15163    const typename ParamGenerator<T7>::iterator begin7_;
15164    const typename ParamGenerator<T7>::iterator end7_;
15165    typename ParamGenerator<T7>::iterator current7_;
15166    const typename ParamGenerator<T8>::iterator begin8_;
15167    const typename ParamGenerator<T8>::iterator end8_;
15168    typename ParamGenerator<T8>::iterator current8_;
15169    const typename ParamGenerator<T9>::iterator begin9_;
15170    const typename ParamGenerator<T9>::iterator end9_;
15171    typename ParamGenerator<T9>::iterator current9_;
15172    ParamType current_value_;
15173  };  // class CartesianProductGenerator9::Iterator
15174
15175  // No implementation - assignment is unsupported.
15176  void operator=(const CartesianProductGenerator9& other);
15177
15178  const ParamGenerator<T1> g1_;
15179  const ParamGenerator<T2> g2_;
15180  const ParamGenerator<T3> g3_;
15181  const ParamGenerator<T4> g4_;
15182  const ParamGenerator<T5> g5_;
15183  const ParamGenerator<T6> g6_;
15184  const ParamGenerator<T7> g7_;
15185  const ParamGenerator<T8> g8_;
15186  const ParamGenerator<T9> g9_;
15187};  // class CartesianProductGenerator9
15188
15189
15190template <typename T1, typename T2, typename T3, typename T4, typename T5,
15191    typename T6, typename T7, typename T8, typename T9, typename T10>
15192class CartesianProductGenerator10
15193    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15194        T7, T8, T9, T10> > {
15195 public:
15196  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
15197
15198  CartesianProductGenerator10(const ParamGenerator<T1>& g1,
15199      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15200      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15201      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
15202      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
15203      const ParamGenerator<T10>& g10)
15204      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15205          g9_(g9), g10_(g10) {}
15206  virtual ~CartesianProductGenerator10() {}
15207
15208  virtual ParamIteratorInterface<ParamType>* Begin() const {
15209    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15210        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
15211        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
15212  }
15213  virtual ParamIteratorInterface<ParamType>* End() const {
15214    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15215        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
15216        g8_.end(), g9_, g9_.end(), g10_, g10_.end());
15217  }
15218
15219 private:
15220  class Iterator : public ParamIteratorInterface<ParamType> {
15221   public:
15222    Iterator(const ParamGeneratorInterface<ParamType>* base,
15223      const ParamGenerator<T1>& g1,
15224      const typename ParamGenerator<T1>::iterator& current1,
15225      const ParamGenerator<T2>& g2,
15226      const typename ParamGenerator<T2>::iterator& current2,
15227      const ParamGenerator<T3>& g3,
15228      const typename ParamGenerator<T3>::iterator& current3,
15229      const ParamGenerator<T4>& g4,
15230      const typename ParamGenerator<T4>::iterator& current4,
15231      const ParamGenerator<T5>& g5,
15232      const typename ParamGenerator<T5>::iterator& current5,
15233      const ParamGenerator<T6>& g6,
15234      const typename ParamGenerator<T6>::iterator& current6,
15235      const ParamGenerator<T7>& g7,
15236      const typename ParamGenerator<T7>::iterator& current7,
15237      const ParamGenerator<T8>& g8,
15238      const typename ParamGenerator<T8>::iterator& current8,
15239      const ParamGenerator<T9>& g9,
15240      const typename ParamGenerator<T9>::iterator& current9,
15241      const ParamGenerator<T10>& g10,
15242      const typename ParamGenerator<T10>::iterator& current10)
15243        : base_(base),
15244          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15245          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15246          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15247          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15248          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15249          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15250          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15251          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15252          begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
15253          begin10_(g10.begin()), end10_(g10.end()), current10_(current10)    {
15254      ComputeCurrentValue();
15255    }
15256    virtual ~Iterator() {}
15257
15258    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15259      return base_;
15260    }
15261    // Advance should not be called on beyond-of-range iterators
15262    // so no component iterators must be beyond end of range, either.
15263    virtual void Advance() {
15264      assert(!AtEnd());
15265      ++current10_;
15266      if (current10_ == end10_) {
15267        current10_ = begin10_;
15268        ++current9_;
15269      }
15270      if (current9_ == end9_) {
15271        current9_ = begin9_;
15272        ++current8_;
15273      }
15274      if (current8_ == end8_) {
15275        current8_ = begin8_;
15276        ++current7_;
15277      }
15278      if (current7_ == end7_) {
15279        current7_ = begin7_;
15280        ++current6_;
15281      }
15282      if (current6_ == end6_) {
15283        current6_ = begin6_;
15284        ++current5_;
15285      }
15286      if (current5_ == end5_) {
15287        current5_ = begin5_;
15288        ++current4_;
15289      }
15290      if (current4_ == end4_) {
15291        current4_ = begin4_;
15292        ++current3_;
15293      }
15294      if (current3_ == end3_) {
15295        current3_ = begin3_;
15296        ++current2_;
15297      }
15298      if (current2_ == end2_) {
15299        current2_ = begin2_;
15300        ++current1_;
15301      }
15302      ComputeCurrentValue();
15303    }
15304    virtual ParamIteratorInterface<ParamType>* Clone() const {
15305      return new Iterator(*this);
15306    }
15307    virtual const ParamType* Current() const { return &current_value_; }
15308    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15309      // Having the same base generator guarantees that the other
15310      // iterator is of the same type and we can downcast.
15311      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15312          << "The program attempted to compare iterators "
15313          << "from different generators." << std::endl;
15314      const Iterator* typed_other =
15315          CheckedDowncastToActualType<const Iterator>(&other);
15316      // We must report iterators equal if they both point beyond their
15317      // respective ranges. That can happen in a variety of fashions,
15318      // so we have to consult AtEnd().
15319      return (AtEnd() && typed_other->AtEnd()) ||
15320         (
15321          current1_ == typed_other->current1_ &&
15322          current2_ == typed_other->current2_ &&
15323          current3_ == typed_other->current3_ &&
15324          current4_ == typed_other->current4_ &&
15325          current5_ == typed_other->current5_ &&
15326          current6_ == typed_other->current6_ &&
15327          current7_ == typed_other->current7_ &&
15328          current8_ == typed_other->current8_ &&
15329          current9_ == typed_other->current9_ &&
15330          current10_ == typed_other->current10_);
15331    }
15332
15333   private:
15334    Iterator(const Iterator& other)
15335        : base_(other.base_),
15336        begin1_(other.begin1_),
15337        end1_(other.end1_),
15338        current1_(other.current1_),
15339        begin2_(other.begin2_),
15340        end2_(other.end2_),
15341        current2_(other.current2_),
15342        begin3_(other.begin3_),
15343        end3_(other.end3_),
15344        current3_(other.current3_),
15345        begin4_(other.begin4_),
15346        end4_(other.end4_),
15347        current4_(other.current4_),
15348        begin5_(other.begin5_),
15349        end5_(other.end5_),
15350        current5_(other.current5_),
15351        begin6_(other.begin6_),
15352        end6_(other.end6_),
15353        current6_(other.current6_),
15354        begin7_(other.begin7_),
15355        end7_(other.end7_),
15356        current7_(other.current7_),
15357        begin8_(other.begin8_),
15358        end8_(other.end8_),
15359        current8_(other.current8_),
15360        begin9_(other.begin9_),
15361        end9_(other.end9_),
15362        current9_(other.current9_),
15363        begin10_(other.begin10_),
15364        end10_(other.end10_),
15365        current10_(other.current10_) {
15366      ComputeCurrentValue();
15367    }
15368
15369    void ComputeCurrentValue() {
15370      if (!AtEnd())
15371        current_value_ = ParamType(*current1_, *current2_, *current3_,
15372            *current4_, *current5_, *current6_, *current7_, *current8_,
15373            *current9_, *current10_);
15374    }
15375    bool AtEnd() const {
15376      // We must report iterator past the end of the range when either of the
15377      // component iterators has reached the end of its range.
15378      return
15379          current1_ == end1_ ||
15380          current2_ == end2_ ||
15381          current3_ == end3_ ||
15382          current4_ == end4_ ||
15383          current5_ == end5_ ||
15384          current6_ == end6_ ||
15385          current7_ == end7_ ||
15386          current8_ == end8_ ||
15387          current9_ == end9_ ||
15388          current10_ == end10_;
15389    }
15390
15391    // No implementation - assignment is unsupported.
15392    void operator=(const Iterator& other);
15393
15394    const ParamGeneratorInterface<ParamType>* const base_;
15395    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15396    // current[i]_ is the actual traversing iterator.
15397    const typename ParamGenerator<T1>::iterator begin1_;
15398    const typename ParamGenerator<T1>::iterator end1_;
15399    typename ParamGenerator<T1>::iterator current1_;
15400    const typename ParamGenerator<T2>::iterator begin2_;
15401    const typename ParamGenerator<T2>::iterator end2_;
15402    typename ParamGenerator<T2>::iterator current2_;
15403    const typename ParamGenerator<T3>::iterator begin3_;
15404    const typename ParamGenerator<T3>::iterator end3_;
15405    typename ParamGenerator<T3>::iterator current3_;
15406    const typename ParamGenerator<T4>::iterator begin4_;
15407    const typename ParamGenerator<T4>::iterator end4_;
15408    typename ParamGenerator<T4>::iterator current4_;
15409    const typename ParamGenerator<T5>::iterator begin5_;
15410    const typename ParamGenerator<T5>::iterator end5_;
15411    typename ParamGenerator<T5>::iterator current5_;
15412    const typename ParamGenerator<T6>::iterator begin6_;
15413    const typename ParamGenerator<T6>::iterator end6_;
15414    typename ParamGenerator<T6>::iterator current6_;
15415    const typename ParamGenerator<T7>::iterator begin7_;
15416    const typename ParamGenerator<T7>::iterator end7_;
15417    typename ParamGenerator<T7>::iterator current7_;
15418    const typename ParamGenerator<T8>::iterator begin8_;
15419    const typename ParamGenerator<T8>::iterator end8_;
15420    typename ParamGenerator<T8>::iterator current8_;
15421    const typename ParamGenerator<T9>::iterator begin9_;
15422    const typename ParamGenerator<T9>::iterator end9_;
15423    typename ParamGenerator<T9>::iterator current9_;
15424    const typename ParamGenerator<T10>::iterator begin10_;
15425    const typename ParamGenerator<T10>::iterator end10_;
15426    typename ParamGenerator<T10>::iterator current10_;
15427    ParamType current_value_;
15428  };  // class CartesianProductGenerator10::Iterator
15429
15430  // No implementation - assignment is unsupported.
15431  void operator=(const CartesianProductGenerator10& other);
15432
15433  const ParamGenerator<T1> g1_;
15434  const ParamGenerator<T2> g2_;
15435  const ParamGenerator<T3> g3_;
15436  const ParamGenerator<T4> g4_;
15437  const ParamGenerator<T5> g5_;
15438  const ParamGenerator<T6> g6_;
15439  const ParamGenerator<T7> g7_;
15440  const ParamGenerator<T8> g8_;
15441  const ParamGenerator<T9> g9_;
15442  const ParamGenerator<T10> g10_;
15443};  // class CartesianProductGenerator10
15444
15445
15446// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15447//
15448// Helper classes providing Combine() with polymorphic features. They allow
15449// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
15450// convertible to U.
15451//
15452template <class Generator1, class Generator2>
15453class CartesianProductHolder2 {
15454 public:
15455CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
15456      : g1_(g1), g2_(g2) {}
15457  template <typename T1, typename T2>
15458  operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
15459    return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
15460        new CartesianProductGenerator2<T1, T2>(
15461        static_cast<ParamGenerator<T1> >(g1_),
15462        static_cast<ParamGenerator<T2> >(g2_)));
15463  }
15464
15465 private:
15466  // No implementation - assignment is unsupported.
15467  void operator=(const CartesianProductHolder2& other);
15468
15469  const Generator1 g1_;
15470  const Generator2 g2_;
15471};  // class CartesianProductHolder2
15472
15473template <class Generator1, class Generator2, class Generator3>
15474class CartesianProductHolder3 {
15475 public:
15476CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
15477    const Generator3& g3)
15478      : g1_(g1), g2_(g2), g3_(g3) {}
15479  template <typename T1, typename T2, typename T3>
15480  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
15481    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
15482        new CartesianProductGenerator3<T1, T2, T3>(
15483        static_cast<ParamGenerator<T1> >(g1_),
15484        static_cast<ParamGenerator<T2> >(g2_),
15485        static_cast<ParamGenerator<T3> >(g3_)));
15486  }
15487
15488 private:
15489  // No implementation - assignment is unsupported.
15490  void operator=(const CartesianProductHolder3& other);
15491
15492  const Generator1 g1_;
15493  const Generator2 g2_;
15494  const Generator3 g3_;
15495};  // class CartesianProductHolder3
15496
15497template <class Generator1, class Generator2, class Generator3,
15498    class Generator4>
15499class CartesianProductHolder4 {
15500 public:
15501CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
15502    const Generator3& g3, const Generator4& g4)
15503      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
15504  template <typename T1, typename T2, typename T3, typename T4>
15505  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
15506    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
15507        new CartesianProductGenerator4<T1, T2, T3, T4>(
15508        static_cast<ParamGenerator<T1> >(g1_),
15509        static_cast<ParamGenerator<T2> >(g2_),
15510        static_cast<ParamGenerator<T3> >(g3_),
15511        static_cast<ParamGenerator<T4> >(g4_)));
15512  }
15513
15514 private:
15515  // No implementation - assignment is unsupported.
15516  void operator=(const CartesianProductHolder4& other);
15517
15518  const Generator1 g1_;
15519  const Generator2 g2_;
15520  const Generator3 g3_;
15521  const Generator4 g4_;
15522};  // class CartesianProductHolder4
15523
15524template <class Generator1, class Generator2, class Generator3,
15525    class Generator4, class Generator5>
15526class CartesianProductHolder5 {
15527 public:
15528CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
15529    const Generator3& g3, const Generator4& g4, const Generator5& g5)
15530      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
15531  template <typename T1, typename T2, typename T3, typename T4, typename T5>
15532  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
15533    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
15534        new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
15535        static_cast<ParamGenerator<T1> >(g1_),
15536        static_cast<ParamGenerator<T2> >(g2_),
15537        static_cast<ParamGenerator<T3> >(g3_),
15538        static_cast<ParamGenerator<T4> >(g4_),
15539        static_cast<ParamGenerator<T5> >(g5_)));
15540  }
15541
15542 private:
15543  // No implementation - assignment is unsupported.
15544  void operator=(const CartesianProductHolder5& other);
15545
15546  const Generator1 g1_;
15547  const Generator2 g2_;
15548  const Generator3 g3_;
15549  const Generator4 g4_;
15550  const Generator5 g5_;
15551};  // class CartesianProductHolder5
15552
15553template <class Generator1, class Generator2, class Generator3,
15554    class Generator4, class Generator5, class Generator6>
15555class CartesianProductHolder6 {
15556 public:
15557CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
15558    const Generator3& g3, const Generator4& g4, const Generator5& g5,
15559    const Generator6& g6)
15560      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
15561  template <typename T1, typename T2, typename T3, typename T4, typename T5,
15562      typename T6>
15563  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
15564    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
15565        new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
15566        static_cast<ParamGenerator<T1> >(g1_),
15567        static_cast<ParamGenerator<T2> >(g2_),
15568        static_cast<ParamGenerator<T3> >(g3_),
15569        static_cast<ParamGenerator<T4> >(g4_),
15570        static_cast<ParamGenerator<T5> >(g5_),
15571        static_cast<ParamGenerator<T6> >(g6_)));
15572  }
15573
15574 private:
15575  // No implementation - assignment is unsupported.
15576  void operator=(const CartesianProductHolder6& other);
15577
15578  const Generator1 g1_;
15579  const Generator2 g2_;
15580  const Generator3 g3_;
15581  const Generator4 g4_;
15582  const Generator5 g5_;
15583  const Generator6 g6_;
15584};  // class CartesianProductHolder6
15585
15586template <class Generator1, class Generator2, class Generator3,
15587    class Generator4, class Generator5, class Generator6, class Generator7>
15588class CartesianProductHolder7 {
15589 public:
15590CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
15591    const Generator3& g3, const Generator4& g4, const Generator5& g5,
15592    const Generator6& g6, const Generator7& g7)
15593      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
15594  template <typename T1, typename T2, typename T3, typename T4, typename T5,
15595      typename T6, typename T7>
15596  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15597      T7> >() const {
15598    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
15599        new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
15600        static_cast<ParamGenerator<T1> >(g1_),
15601        static_cast<ParamGenerator<T2> >(g2_),
15602        static_cast<ParamGenerator<T3> >(g3_),
15603        static_cast<ParamGenerator<T4> >(g4_),
15604        static_cast<ParamGenerator<T5> >(g5_),
15605        static_cast<ParamGenerator<T6> >(g6_),
15606        static_cast<ParamGenerator<T7> >(g7_)));
15607  }
15608
15609 private:
15610  // No implementation - assignment is unsupported.
15611  void operator=(const CartesianProductHolder7& other);
15612
15613  const Generator1 g1_;
15614  const Generator2 g2_;
15615  const Generator3 g3_;
15616  const Generator4 g4_;
15617  const Generator5 g5_;
15618  const Generator6 g6_;
15619  const Generator7 g7_;
15620};  // class CartesianProductHolder7
15621
15622template <class Generator1, class Generator2, class Generator3,
15623    class Generator4, class Generator5, class Generator6, class Generator7,
15624    class Generator8>
15625class CartesianProductHolder8 {
15626 public:
15627CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
15628    const Generator3& g3, const Generator4& g4, const Generator5& g5,
15629    const Generator6& g6, const Generator7& g7, const Generator8& g8)
15630      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
15631          g8_(g8) {}
15632  template <typename T1, typename T2, typename T3, typename T4, typename T5,
15633      typename T6, typename T7, typename T8>
15634  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
15635      T8> >() const {
15636    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
15637        new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
15638        static_cast<ParamGenerator<T1> >(g1_),
15639        static_cast<ParamGenerator<T2> >(g2_),
15640        static_cast<ParamGenerator<T3> >(g3_),
15641        static_cast<ParamGenerator<T4> >(g4_),
15642        static_cast<ParamGenerator<T5> >(g5_),
15643        static_cast<ParamGenerator<T6> >(g6_),
15644        static_cast<ParamGenerator<T7> >(g7_),
15645        static_cast<ParamGenerator<T8> >(g8_)));
15646  }
15647
15648 private:
15649  // No implementation - assignment is unsupported.
15650  void operator=(const CartesianProductHolder8& other);
15651
15652  const Generator1 g1_;
15653  const Generator2 g2_;
15654  const Generator3 g3_;
15655  const Generator4 g4_;
15656  const Generator5 g5_;
15657  const Generator6 g6_;
15658  const Generator7 g7_;
15659  const Generator8 g8_;
15660};  // class CartesianProductHolder8
15661
15662template <class Generator1, class Generator2, class Generator3,
15663    class Generator4, class Generator5, class Generator6, class Generator7,
15664    class Generator8, class Generator9>
15665class CartesianProductHolder9 {
15666 public:
15667CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
15668    const Generator3& g3, const Generator4& g4, const Generator5& g5,
15669    const Generator6& g6, const Generator7& g7, const Generator8& g8,
15670    const Generator9& g9)
15671      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15672          g9_(g9) {}
15673  template <typename T1, typename T2, typename T3, typename T4, typename T5,
15674      typename T6, typename T7, typename T8, typename T9>
15675  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15676      T9> >() const {
15677    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15678        T9> >(
15679        new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
15680        static_cast<ParamGenerator<T1> >(g1_),
15681        static_cast<ParamGenerator<T2> >(g2_),
15682        static_cast<ParamGenerator<T3> >(g3_),
15683        static_cast<ParamGenerator<T4> >(g4_),
15684        static_cast<ParamGenerator<T5> >(g5_),
15685        static_cast<ParamGenerator<T6> >(g6_),
15686        static_cast<ParamGenerator<T7> >(g7_),
15687        static_cast<ParamGenerator<T8> >(g8_),
15688        static_cast<ParamGenerator<T9> >(g9_)));
15689  }
15690
15691 private:
15692  // No implementation - assignment is unsupported.
15693  void operator=(const CartesianProductHolder9& other);
15694
15695  const Generator1 g1_;
15696  const Generator2 g2_;
15697  const Generator3 g3_;
15698  const Generator4 g4_;
15699  const Generator5 g5_;
15700  const Generator6 g6_;
15701  const Generator7 g7_;
15702  const Generator8 g8_;
15703  const Generator9 g9_;
15704};  // class CartesianProductHolder9
15705
15706template <class Generator1, class Generator2, class Generator3,
15707    class Generator4, class Generator5, class Generator6, class Generator7,
15708    class Generator8, class Generator9, class Generator10>
15709class CartesianProductHolder10 {
15710 public:
15711CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
15712    const Generator3& g3, const Generator4& g4, const Generator5& g5,
15713    const Generator6& g6, const Generator7& g7, const Generator8& g8,
15714    const Generator9& g9, const Generator10& g10)
15715      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15716          g9_(g9), g10_(g10) {}
15717  template <typename T1, typename T2, typename T3, typename T4, typename T5,
15718      typename T6, typename T7, typename T8, typename T9, typename T10>
15719  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15720      T9, T10> >() const {
15721    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15722        T9, T10> >(
15723        new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
15724            T10>(
15725        static_cast<ParamGenerator<T1> >(g1_),
15726        static_cast<ParamGenerator<T2> >(g2_),
15727        static_cast<ParamGenerator<T3> >(g3_),
15728        static_cast<ParamGenerator<T4> >(g4_),
15729        static_cast<ParamGenerator<T5> >(g5_),
15730        static_cast<ParamGenerator<T6> >(g6_),
15731        static_cast<ParamGenerator<T7> >(g7_),
15732        static_cast<ParamGenerator<T8> >(g8_),
15733        static_cast<ParamGenerator<T9> >(g9_),
15734        static_cast<ParamGenerator<T10> >(g10_)));
15735  }
15736
15737 private:
15738  // No implementation - assignment is unsupported.
15739  void operator=(const CartesianProductHolder10& other);
15740
15741  const Generator1 g1_;
15742  const Generator2 g2_;
15743  const Generator3 g3_;
15744  const Generator4 g4_;
15745  const Generator5 g5_;
15746  const Generator6 g6_;
15747  const Generator7 g7_;
15748  const Generator8 g8_;
15749  const Generator9 g9_;
15750  const Generator10 g10_;
15751};  // class CartesianProductHolder10
15752
15753# endif  // GTEST_HAS_COMBINE
15754
15755}  // namespace internal
15756}  // namespace testing
15757
15758#endif  //  GTEST_HAS_PARAM_TEST
15759
15760#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
15761
15762#if GTEST_HAS_PARAM_TEST
15763
15764namespace testing {
15765
15766// Functions producing parameter generators.
15767//
15768// Google Test uses these generators to produce parameters for value-
15769// parameterized tests. When a parameterized test case is instantiated
15770// with a particular generator, Google Test creates and runs tests
15771// for each element in the sequence produced by the generator.
15772//
15773// In the following sample, tests from test case FooTest are instantiated
15774// each three times with parameter values 3, 5, and 8:
15775//
15776// class FooTest : public TestWithParam<int> { ... };
15777//
15778// TEST_P(FooTest, TestThis) {
15779// }
15780// TEST_P(FooTest, TestThat) {
15781// }
15782// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
15783//
15784
15785// Range() returns generators providing sequences of values in a range.
15786//
15787// Synopsis:
15788// Range(start, end)
15789//   - returns a generator producing a sequence of values {start, start+1,
15790//     start+2, ..., }.
15791// Range(start, end, step)
15792//   - returns a generator producing a sequence of values {start, start+step,
15793//     start+step+step, ..., }.
15794// Notes:
15795//   * The generated sequences never include end. For example, Range(1, 5)
15796//     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
15797//     returns a generator producing {1, 3, 5, 7}.
15798//   * start and end must have the same type. That type may be any integral or
15799//     floating-point type or a user defined type satisfying these conditions:
15800//     * It must be assignable (have operator=() defined).
15801//     * It must have operator+() (operator+(int-compatible type) for
15802//       two-operand version).
15803//     * It must have operator<() defined.
15804//     Elements in the resulting sequences will also have that type.
15805//   * Condition start < end must be satisfied in order for resulting sequences
15806//     to contain any elements.
15807//
15808template <typename T, typename IncrementT>
15809internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
15810  return internal::ParamGenerator<T>(
15811      new internal::RangeGenerator<T, IncrementT>(start, end, step));
15812}
15813
15814template <typename T>
15815internal::ParamGenerator<T> Range(T start, T end) {
15816  return Range(start, end, 1);
15817}
15818
15819// ValuesIn() function allows generation of tests with parameters coming from
15820// a container.
15821//
15822// Synopsis:
15823// ValuesIn(const T (&array)[N])
15824//   - returns a generator producing sequences with elements from
15825//     a C-style array.
15826// ValuesIn(const Container& container)
15827//   - returns a generator producing sequences with elements from
15828//     an STL-style container.
15829// ValuesIn(Iterator begin, Iterator end)
15830//   - returns a generator producing sequences with elements from
15831//     a range [begin, end) defined by a pair of STL-style iterators. These
15832//     iterators can also be plain C pointers.
15833//
15834// Please note that ValuesIn copies the values from the containers
15835// passed in and keeps them to generate tests in RUN_ALL_TESTS().
15836//
15837// Examples:
15838//
15839// This instantiates tests from test case StringTest
15840// each with C-string values of "foo", "bar", and "baz":
15841//
15842// const char* strings[] = {"foo", "bar", "baz"};
15843// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
15844//
15845// This instantiates tests from test case StlStringTest
15846// each with STL strings with values "a" and "b":
15847//
15848// ::std::vector< ::std::string> GetParameterStrings() {
15849//   ::std::vector< ::std::string> v;
15850//   v.push_back("a");
15851//   v.push_back("b");
15852//   return v;
15853// }
15854//
15855// INSTANTIATE_TEST_CASE_P(CharSequence,
15856//                         StlStringTest,
15857//                         ValuesIn(GetParameterStrings()));
15858//
15859//
15860// This will also instantiate tests from CharTest
15861// each with parameter values 'a' and 'b':
15862//
15863// ::std::list<char> GetParameterChars() {
15864//   ::std::list<char> list;
15865//   list.push_back('a');
15866//   list.push_back('b');
15867//   return list;
15868// }
15869// ::std::list<char> l = GetParameterChars();
15870// INSTANTIATE_TEST_CASE_P(CharSequence2,
15871//                         CharTest,
15872//                         ValuesIn(l.begin(), l.end()));
15873//
15874template <typename ForwardIterator>
15875internal::ParamGenerator<
15876  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
15877ValuesIn(ForwardIterator begin, ForwardIterator end) {
15878  typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
15879      ::value_type ParamType;
15880  return internal::ParamGenerator<ParamType>(
15881      new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
15882}
15883
15884template <typename T, size_t N>
15885internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
15886  return ValuesIn(array, array + N);
15887}
15888
15889template <class Container>
15890internal::ParamGenerator<typename Container::value_type> ValuesIn(
15891    const Container& container) {
15892  return ValuesIn(container.begin(), container.end());
15893}
15894
15895// Values() allows generating tests from explicitly specified list of
15896// parameters.
15897//
15898// Synopsis:
15899// Values(T v1, T v2, ..., T vN)
15900//   - returns a generator producing sequences with elements v1, v2, ..., vN.
15901//
15902// For example, this instantiates tests from test case BarTest each
15903// with values "one", "two", and "three":
15904//
15905// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
15906//
15907// This instantiates tests from test case BazTest each with values 1, 2, 3.5.
15908// The exact type of values will depend on the type of parameter in BazTest.
15909//
15910// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
15911//
15912// Currently, Values() supports from 1 to 50 parameters.
15913//
15914template <typename T1>
15915internal::ValueArray1<T1> Values(T1 v1) {
15916  return internal::ValueArray1<T1>(v1);
15917}
15918
15919template <typename T1, typename T2>
15920internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
15921  return internal::ValueArray2<T1, T2>(v1, v2);
15922}
15923
15924template <typename T1, typename T2, typename T3>
15925internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
15926  return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
15927}
15928
15929template <typename T1, typename T2, typename T3, typename T4>
15930internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
15931  return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
15932}
15933
15934template <typename T1, typename T2, typename T3, typename T4, typename T5>
15935internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
15936    T5 v5) {
15937  return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
15938}
15939
15940template <typename T1, typename T2, typename T3, typename T4, typename T5,
15941    typename T6>
15942internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
15943    T4 v4, T5 v5, T6 v6) {
15944  return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
15945}
15946
15947template <typename T1, typename T2, typename T3, typename T4, typename T5,
15948    typename T6, typename T7>
15949internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
15950    T4 v4, T5 v5, T6 v6, T7 v7) {
15951  return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
15952      v6, v7);
15953}
15954
15955template <typename T1, typename T2, typename T3, typename T4, typename T5,
15956    typename T6, typename T7, typename T8>
15957internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
15958    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
15959  return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
15960      v5, v6, v7, v8);
15961}
15962
15963template <typename T1, typename T2, typename T3, typename T4, typename T5,
15964    typename T6, typename T7, typename T8, typename T9>
15965internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
15966    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
15967  return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
15968      v4, v5, v6, v7, v8, v9);
15969}
15970
15971template <typename T1, typename T2, typename T3, typename T4, typename T5,
15972    typename T6, typename T7, typename T8, typename T9, typename T10>
15973internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
15974    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
15975  return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
15976      v2, v3, v4, v5, v6, v7, v8, v9, v10);
15977}
15978
15979template <typename T1, typename T2, typename T3, typename T4, typename T5,
15980    typename T6, typename T7, typename T8, typename T9, typename T10,
15981    typename T11>
15982internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
15983    T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15984    T10 v10, T11 v11) {
15985  return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
15986      T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
15987}
15988
15989template <typename T1, typename T2, typename T3, typename T4, typename T5,
15990    typename T6, typename T7, typename T8, typename T9, typename T10,
15991    typename T11, typename T12>
15992internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15993    T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15994    T10 v10, T11 v11, T12 v12) {
15995  return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15996      T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
15997}
15998
15999template <typename T1, typename T2, typename T3, typename T4, typename T5,
16000    typename T6, typename T7, typename T8, typename T9, typename T10,
16001    typename T11, typename T12, typename T13>
16002internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
16003    T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16004    T10 v10, T11 v11, T12 v12, T13 v13) {
16005  return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16006      T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
16007}
16008
16009template <typename T1, typename T2, typename T3, typename T4, typename T5,
16010    typename T6, typename T7, typename T8, typename T9, typename T10,
16011    typename T11, typename T12, typename T13, typename T14>
16012internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16013    T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16014    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
16015  return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16016      T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16017      v14);
16018}
16019
16020template <typename T1, typename T2, typename T3, typename T4, typename T5,
16021    typename T6, typename T7, typename T8, typename T9, typename T10,
16022    typename T11, typename T12, typename T13, typename T14, typename T15>
16023internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16024    T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16025    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
16026  return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16027      T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16028      v13, v14, v15);
16029}
16030
16031template <typename T1, typename T2, typename T3, typename T4, typename T5,
16032    typename T6, typename T7, typename T8, typename T9, typename T10,
16033    typename T11, typename T12, typename T13, typename T14, typename T15,
16034    typename T16>
16035internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16036    T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16037    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16038    T16 v16) {
16039  return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16040      T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16041      v12, v13, v14, v15, v16);
16042}
16043
16044template <typename T1, typename T2, typename T3, typename T4, typename T5,
16045    typename T6, typename T7, typename T8, typename T9, typename T10,
16046    typename T11, typename T12, typename T13, typename T14, typename T15,
16047    typename T16, typename T17>
16048internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16049    T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16050    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16051    T16 v16, T17 v17) {
16052  return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16053      T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16054      v11, v12, v13, v14, v15, v16, v17);
16055}
16056
16057template <typename T1, typename T2, typename T3, typename T4, typename T5,
16058    typename T6, typename T7, typename T8, typename T9, typename T10,
16059    typename T11, typename T12, typename T13, typename T14, typename T15,
16060    typename T16, typename T17, typename T18>
16061internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16062    T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16063    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16064    T16 v16, T17 v17, T18 v18) {
16065  return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16066      T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16067      v10, v11, v12, v13, v14, v15, v16, v17, v18);
16068}
16069
16070template <typename T1, typename T2, typename T3, typename T4, typename T5,
16071    typename T6, typename T7, typename T8, typename T9, typename T10,
16072    typename T11, typename T12, typename T13, typename T14, typename T15,
16073    typename T16, typename T17, typename T18, typename T19>
16074internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16075    T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16076    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16077    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
16078  return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16079      T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
16080      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
16081}
16082
16083template <typename T1, typename T2, typename T3, typename T4, typename T5,
16084    typename T6, typename T7, typename T8, typename T9, typename T10,
16085    typename T11, typename T12, typename T13, typename T14, typename T15,
16086    typename T16, typename T17, typename T18, typename T19, typename T20>
16087internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16088    T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16089    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16090    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
16091  return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16092      T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
16093      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
16094}
16095
16096template <typename T1, typename T2, typename T3, typename T4, typename T5,
16097    typename T6, typename T7, typename T8, typename T9, typename T10,
16098    typename T11, typename T12, typename T13, typename T14, typename T15,
16099    typename T16, typename T17, typename T18, typename T19, typename T20,
16100    typename T21>
16101internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16102    T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16103    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16104    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
16105  return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16106      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
16107      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
16108}
16109
16110template <typename T1, typename T2, typename T3, typename T4, typename T5,
16111    typename T6, typename T7, typename T8, typename T9, typename T10,
16112    typename T11, typename T12, typename T13, typename T14, typename T15,
16113    typename T16, typename T17, typename T18, typename T19, typename T20,
16114    typename T21, typename T22>
16115internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16116    T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
16117    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16118    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16119    T21 v21, T22 v22) {
16120  return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16121      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
16122      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16123      v20, v21, v22);
16124}
16125
16126template <typename T1, typename T2, typename T3, typename T4, typename T5,
16127    typename T6, typename T7, typename T8, typename T9, typename T10,
16128    typename T11, typename T12, typename T13, typename T14, typename T15,
16129    typename T16, typename T17, typename T18, typename T19, typename T20,
16130    typename T21, typename T22, typename T23>
16131internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16132    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
16133    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16134    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16135    T21 v21, T22 v22, T23 v23) {
16136  return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16137      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
16138      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16139      v20, v21, v22, v23);
16140}
16141
16142template <typename T1, typename T2, typename T3, typename T4, typename T5,
16143    typename T6, typename T7, typename T8, typename T9, typename T10,
16144    typename T11, typename T12, typename T13, typename T14, typename T15,
16145    typename T16, typename T17, typename T18, typename T19, typename T20,
16146    typename T21, typename T22, typename T23, typename T24>
16147internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16148    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
16149    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16150    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16151    T21 v21, T22 v22, T23 v23, T24 v24) {
16152  return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16153      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
16154      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16155      v19, v20, v21, v22, v23, v24);
16156}
16157
16158template <typename T1, typename T2, typename T3, typename T4, typename T5,
16159    typename T6, typename T7, typename T8, typename T9, typename T10,
16160    typename T11, typename T12, typename T13, typename T14, typename T15,
16161    typename T16, typename T17, typename T18, typename T19, typename T20,
16162    typename T21, typename T22, typename T23, typename T24, typename T25>
16163internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16164    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
16165    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16166    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16167    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
16168  return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16169      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
16170      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16171      v18, v19, v20, v21, v22, v23, v24, v25);
16172}
16173
16174template <typename T1, typename T2, typename T3, typename T4, typename T5,
16175    typename T6, typename T7, typename T8, typename T9, typename T10,
16176    typename T11, typename T12, typename T13, typename T14, typename T15,
16177    typename T16, typename T17, typename T18, typename T19, typename T20,
16178    typename T21, typename T22, typename T23, typename T24, typename T25,
16179    typename T26>
16180internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16181    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16182    T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16183    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16184    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16185    T26 v26) {
16186  return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16187      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16188      T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16189      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
16190}
16191
16192template <typename T1, typename T2, typename T3, typename T4, typename T5,
16193    typename T6, typename T7, typename T8, typename T9, typename T10,
16194    typename T11, typename T12, typename T13, typename T14, typename T15,
16195    typename T16, typename T17, typename T18, typename T19, typename T20,
16196    typename T21, typename T22, typename T23, typename T24, typename T25,
16197    typename T26, typename T27>
16198internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16199    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
16200    T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16201    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16202    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16203    T26 v26, T27 v27) {
16204  return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16205      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16206      T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16207      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
16208}
16209
16210template <typename T1, typename T2, typename T3, typename T4, typename T5,
16211    typename T6, typename T7, typename T8, typename T9, typename T10,
16212    typename T11, typename T12, typename T13, typename T14, typename T15,
16213    typename T16, typename T17, typename T18, typename T19, typename T20,
16214    typename T21, typename T22, typename T23, typename T24, typename T25,
16215    typename T26, typename T27, typename T28>
16216internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16217    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
16218    T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16219    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16220    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16221    T26 v26, T27 v27, T28 v28) {
16222  return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16223      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16224      T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16225      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16226      v28);
16227}
16228
16229template <typename T1, typename T2, typename T3, typename T4, typename T5,
16230    typename T6, typename T7, typename T8, typename T9, typename T10,
16231    typename T11, typename T12, typename T13, typename T14, typename T15,
16232    typename T16, typename T17, typename T18, typename T19, typename T20,
16233    typename T21, typename T22, typename T23, typename T24, typename T25,
16234    typename T26, typename T27, typename T28, typename T29>
16235internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16236    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16237    T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16238    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16239    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16240    T26 v26, T27 v27, T28 v28, T29 v29) {
16241  return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16242      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16243      T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16244      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16245      v27, v28, v29);
16246}
16247
16248template <typename T1, typename T2, typename T3, typename T4, typename T5,
16249    typename T6, typename T7, typename T8, typename T9, typename T10,
16250    typename T11, typename T12, typename T13, typename T14, typename T15,
16251    typename T16, typename T17, typename T18, typename T19, typename T20,
16252    typename T21, typename T22, typename T23, typename T24, typename T25,
16253    typename T26, typename T27, typename T28, typename T29, typename T30>
16254internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16255    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16256    T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16257    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16258    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16259    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
16260  return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16261      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16262      T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16263      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16264      v26, v27, v28, v29, v30);
16265}
16266
16267template <typename T1, typename T2, typename T3, typename T4, typename T5,
16268    typename T6, typename T7, typename T8, typename T9, typename T10,
16269    typename T11, typename T12, typename T13, typename T14, typename T15,
16270    typename T16, typename T17, typename T18, typename T19, typename T20,
16271    typename T21, typename T22, typename T23, typename T24, typename T25,
16272    typename T26, typename T27, typename T28, typename T29, typename T30,
16273    typename T31>
16274internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16275    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16276    T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16277    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16278    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16279    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
16280  return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16281      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16282      T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16283      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16284      v25, v26, v27, v28, v29, v30, v31);
16285}
16286
16287template <typename T1, typename T2, typename T3, typename T4, typename T5,
16288    typename T6, typename T7, typename T8, typename T9, typename T10,
16289    typename T11, typename T12, typename T13, typename T14, typename T15,
16290    typename T16, typename T17, typename T18, typename T19, typename T20,
16291    typename T21, typename T22, typename T23, typename T24, typename T25,
16292    typename T26, typename T27, typename T28, typename T29, typename T30,
16293    typename T31, typename T32>
16294internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16295    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16296    T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16297    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16298    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16299    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16300    T32 v32) {
16301  return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16302      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16303      T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16304      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16305      v24, v25, v26, v27, v28, v29, v30, v31, v32);
16306}
16307
16308template <typename T1, typename T2, typename T3, typename T4, typename T5,
16309    typename T6, typename T7, typename T8, typename T9, typename T10,
16310    typename T11, typename T12, typename T13, typename T14, typename T15,
16311    typename T16, typename T17, typename T18, typename T19, typename T20,
16312    typename T21, typename T22, typename T23, typename T24, typename T25,
16313    typename T26, typename T27, typename T28, typename T29, typename T30,
16314    typename T31, typename T32, typename T33>
16315internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16316    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16317    T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16318    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16319    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16320    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16321    T32 v32, T33 v33) {
16322  return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16323      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16324      T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
16325      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16326      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
16327}
16328
16329template <typename T1, typename T2, typename T3, typename T4, typename T5,
16330    typename T6, typename T7, typename T8, typename T9, typename T10,
16331    typename T11, typename T12, typename T13, typename T14, typename T15,
16332    typename T16, typename T17, typename T18, typename T19, typename T20,
16333    typename T21, typename T22, typename T23, typename T24, typename T25,
16334    typename T26, typename T27, typename T28, typename T29, typename T30,
16335    typename T31, typename T32, typename T33, typename T34>
16336internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16337    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16338    T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16339    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16340    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16341    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16342    T31 v31, T32 v32, T33 v33, T34 v34) {
16343  return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16344      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16345      T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
16346      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16347      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
16348}
16349
16350template <typename T1, typename T2, typename T3, typename T4, typename T5,
16351    typename T6, typename T7, typename T8, typename T9, typename T10,
16352    typename T11, typename T12, typename T13, typename T14, typename T15,
16353    typename T16, typename T17, typename T18, typename T19, typename T20,
16354    typename T21, typename T22, typename T23, typename T24, typename T25,
16355    typename T26, typename T27, typename T28, typename T29, typename T30,
16356    typename T31, typename T32, typename T33, typename T34, typename T35>
16357internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16358    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16359    T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16360    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16361    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16362    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16363    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
16364  return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16365      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16366      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
16367      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16368      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
16369}
16370
16371template <typename T1, typename T2, typename T3, typename T4, typename T5,
16372    typename T6, typename T7, typename T8, typename T9, typename T10,
16373    typename T11, typename T12, typename T13, typename T14, typename T15,
16374    typename T16, typename T17, typename T18, typename T19, typename T20,
16375    typename T21, typename T22, typename T23, typename T24, typename T25,
16376    typename T26, typename T27, typename T28, typename T29, typename T30,
16377    typename T31, typename T32, typename T33, typename T34, typename T35,
16378    typename T36>
16379internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16380    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16381    T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16382    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16383    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16384    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16385    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
16386  return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16387      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16388      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
16389      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16390      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16391      v34, v35, v36);
16392}
16393
16394template <typename T1, typename T2, typename T3, typename T4, typename T5,
16395    typename T6, typename T7, typename T8, typename T9, typename T10,
16396    typename T11, typename T12, typename T13, typename T14, typename T15,
16397    typename T16, typename T17, typename T18, typename T19, typename T20,
16398    typename T21, typename T22, typename T23, typename T24, typename T25,
16399    typename T26, typename T27, typename T28, typename T29, typename T30,
16400    typename T31, typename T32, typename T33, typename T34, typename T35,
16401    typename T36, typename T37>
16402internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16403    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16404    T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
16405    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16406    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16407    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16408    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16409    T37 v37) {
16410  return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16411      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16412      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
16413      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16414      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16415      v34, v35, v36, v37);
16416}
16417
16418template <typename T1, typename T2, typename T3, typename T4, typename T5,
16419    typename T6, typename T7, typename T8, typename T9, typename T10,
16420    typename T11, typename T12, typename T13, typename T14, typename T15,
16421    typename T16, typename T17, typename T18, typename T19, typename T20,
16422    typename T21, typename T22, typename T23, typename T24, typename T25,
16423    typename T26, typename T27, typename T28, typename T29, typename T30,
16424    typename T31, typename T32, typename T33, typename T34, typename T35,
16425    typename T36, typename T37, typename T38>
16426internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16427    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16428    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
16429    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16430    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16431    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16432    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16433    T37 v37, T38 v38) {
16434  return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16435      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16436      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
16437      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16438      v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
16439      v33, v34, v35, v36, v37, v38);
16440}
16441
16442template <typename T1, typename T2, typename T3, typename T4, typename T5,
16443    typename T6, typename T7, typename T8, typename T9, typename T10,
16444    typename T11, typename T12, typename T13, typename T14, typename T15,
16445    typename T16, typename T17, typename T18, typename T19, typename T20,
16446    typename T21, typename T22, typename T23, typename T24, typename T25,
16447    typename T26, typename T27, typename T28, typename T29, typename T30,
16448    typename T31, typename T32, typename T33, typename T34, typename T35,
16449    typename T36, typename T37, typename T38, typename T39>
16450internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16451    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16452    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
16453    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16454    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16455    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16456    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16457    T37 v37, T38 v38, T39 v39) {
16458  return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16459      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16460      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
16461      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16462      v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
16463      v32, v33, v34, v35, v36, v37, v38, v39);
16464}
16465
16466template <typename T1, typename T2, typename T3, typename T4, typename T5,
16467    typename T6, typename T7, typename T8, typename T9, typename T10,
16468    typename T11, typename T12, typename T13, typename T14, typename T15,
16469    typename T16, typename T17, typename T18, typename T19, typename T20,
16470    typename T21, typename T22, typename T23, typename T24, typename T25,
16471    typename T26, typename T27, typename T28, typename T29, typename T30,
16472    typename T31, typename T32, typename T33, typename T34, typename T35,
16473    typename T36, typename T37, typename T38, typename T39, typename T40>
16474internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16475    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16476    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
16477    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16478    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16479    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
16480    T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
16481    T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
16482  return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16483      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16484      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16485      T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16486      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
16487      v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
16488}
16489
16490template <typename T1, typename T2, typename T3, typename T4, typename T5,
16491    typename T6, typename T7, typename T8, typename T9, typename T10,
16492    typename T11, typename T12, typename T13, typename T14, typename T15,
16493    typename T16, typename T17, typename T18, typename T19, typename T20,
16494    typename T21, typename T22, typename T23, typename T24, typename T25,
16495    typename T26, typename T27, typename T28, typename T29, typename T30,
16496    typename T31, typename T32, typename T33, typename T34, typename T35,
16497    typename T36, typename T37, typename T38, typename T39, typename T40,
16498    typename T41>
16499internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16500    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16501    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
16502    T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16503    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16504    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16505    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16506    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
16507  return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16508      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16509      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16510      T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16511      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
16512      v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
16513}
16514
16515template <typename T1, typename T2, typename T3, typename T4, typename T5,
16516    typename T6, typename T7, typename T8, typename T9, typename T10,
16517    typename T11, typename T12, typename T13, typename T14, typename T15,
16518    typename T16, typename T17, typename T18, typename T19, typename T20,
16519    typename T21, typename T22, typename T23, typename T24, typename T25,
16520    typename T26, typename T27, typename T28, typename T29, typename T30,
16521    typename T31, typename T32, typename T33, typename T34, typename T35,
16522    typename T36, typename T37, typename T38, typename T39, typename T40,
16523    typename T41, typename T42>
16524internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16525    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16526    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
16527    T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16528    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16529    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16530    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16531    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16532    T42 v42) {
16533  return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16534      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16535      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16536      T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16537      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16538      v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
16539      v42);
16540}
16541
16542template <typename T1, typename T2, typename T3, typename T4, typename T5,
16543    typename T6, typename T7, typename T8, typename T9, typename T10,
16544    typename T11, typename T12, typename T13, typename T14, typename T15,
16545    typename T16, typename T17, typename T18, typename T19, typename T20,
16546    typename T21, typename T22, typename T23, typename T24, typename T25,
16547    typename T26, typename T27, typename T28, typename T29, typename T30,
16548    typename T31, typename T32, typename T33, typename T34, typename T35,
16549    typename T36, typename T37, typename T38, typename T39, typename T40,
16550    typename T41, typename T42, typename T43>
16551internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16552    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16553    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
16554    T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16555    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16556    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16557    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16558    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16559    T42 v42, T43 v43) {
16560  return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16561      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16562      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16563      T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16564      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16565      v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
16566      v41, v42, v43);
16567}
16568
16569template <typename T1, typename T2, typename T3, typename T4, typename T5,
16570    typename T6, typename T7, typename T8, typename T9, typename T10,
16571    typename T11, typename T12, typename T13, typename T14, typename T15,
16572    typename T16, typename T17, typename T18, typename T19, typename T20,
16573    typename T21, typename T22, typename T23, typename T24, typename T25,
16574    typename T26, typename T27, typename T28, typename T29, typename T30,
16575    typename T31, typename T32, typename T33, typename T34, typename T35,
16576    typename T36, typename T37, typename T38, typename T39, typename T40,
16577    typename T41, typename T42, typename T43, typename T44>
16578internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16579    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16580    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16581    T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16582    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16583    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16584    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16585    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16586    T42 v42, T43 v43, T44 v44) {
16587  return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16588      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16589      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16590      T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16591      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16592      v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
16593      v40, v41, v42, v43, v44);
16594}
16595
16596template <typename T1, typename T2, typename T3, typename T4, typename T5,
16597    typename T6, typename T7, typename T8, typename T9, typename T10,
16598    typename T11, typename T12, typename T13, typename T14, typename T15,
16599    typename T16, typename T17, typename T18, typename T19, typename T20,
16600    typename T21, typename T22, typename T23, typename T24, typename T25,
16601    typename T26, typename T27, typename T28, typename T29, typename T30,
16602    typename T31, typename T32, typename T33, typename T34, typename T35,
16603    typename T36, typename T37, typename T38, typename T39, typename T40,
16604    typename T41, typename T42, typename T43, typename T44, typename T45>
16605internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16606    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16607    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16608    T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16609    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16610    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16611    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
16612    T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
16613    T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
16614  return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16615      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16616      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16617      T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16618      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16619      v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
16620      v39, v40, v41, v42, v43, v44, v45);
16621}
16622
16623template <typename T1, typename T2, typename T3, typename T4, typename T5,
16624    typename T6, typename T7, typename T8, typename T9, typename T10,
16625    typename T11, typename T12, typename T13, typename T14, typename T15,
16626    typename T16, typename T17, typename T18, typename T19, typename T20,
16627    typename T21, typename T22, typename T23, typename T24, typename T25,
16628    typename T26, typename T27, typename T28, typename T29, typename T30,
16629    typename T31, typename T32, typename T33, typename T34, typename T35,
16630    typename T36, typename T37, typename T38, typename T39, typename T40,
16631    typename T41, typename T42, typename T43, typename T44, typename T45,
16632    typename T46>
16633internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16634    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16635    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16636    T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16637    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16638    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16639    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16640    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16641    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
16642  return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16643      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16644      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16645      T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16646      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16647      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16648      v38, v39, v40, v41, v42, v43, v44, v45, v46);
16649}
16650
16651template <typename T1, typename T2, typename T3, typename T4, typename T5,
16652    typename T6, typename T7, typename T8, typename T9, typename T10,
16653    typename T11, typename T12, typename T13, typename T14, typename T15,
16654    typename T16, typename T17, typename T18, typename T19, typename T20,
16655    typename T21, typename T22, typename T23, typename T24, typename T25,
16656    typename T26, typename T27, typename T28, typename T29, typename T30,
16657    typename T31, typename T32, typename T33, typename T34, typename T35,
16658    typename T36, typename T37, typename T38, typename T39, typename T40,
16659    typename T41, typename T42, typename T43, typename T44, typename T45,
16660    typename T46, typename T47>
16661internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16662    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16663    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16664    T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16665    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16666    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16667    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16668    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16669    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
16670  return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16671      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16672      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16673      T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
16674      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16675      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16676      v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
16677}
16678
16679template <typename T1, typename T2, typename T3, typename T4, typename T5,
16680    typename T6, typename T7, typename T8, typename T9, typename T10,
16681    typename T11, typename T12, typename T13, typename T14, typename T15,
16682    typename T16, typename T17, typename T18, typename T19, typename T20,
16683    typename T21, typename T22, typename T23, typename T24, typename T25,
16684    typename T26, typename T27, typename T28, typename T29, typename T30,
16685    typename T31, typename T32, typename T33, typename T34, typename T35,
16686    typename T36, typename T37, typename T38, typename T39, typename T40,
16687    typename T41, typename T42, typename T43, typename T44, typename T45,
16688    typename T46, typename T47, typename T48>
16689internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16690    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16691    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16692    T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16693    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16694    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16695    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16696    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16697    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
16698    T48 v48) {
16699  return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16700      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16701      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16702      T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
16703      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16704      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
16705      v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
16706}
16707
16708template <typename T1, typename T2, typename T3, typename T4, typename T5,
16709    typename T6, typename T7, typename T8, typename T9, typename T10,
16710    typename T11, typename T12, typename T13, typename T14, typename T15,
16711    typename T16, typename T17, typename T18, typename T19, typename T20,
16712    typename T21, typename T22, typename T23, typename T24, typename T25,
16713    typename T26, typename T27, typename T28, typename T29, typename T30,
16714    typename T31, typename T32, typename T33, typename T34, typename T35,
16715    typename T36, typename T37, typename T38, typename T39, typename T40,
16716    typename T41, typename T42, typename T43, typename T44, typename T45,
16717    typename T46, typename T47, typename T48, typename T49>
16718internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16719    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16720    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16721    T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16722    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16723    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16724    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16725    T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
16726    T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
16727    T47 v47, T48 v48, T49 v49) {
16728  return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16729      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16730      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16731      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
16732      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16733      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
16734      v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
16735}
16736
16737template <typename T1, typename T2, typename T3, typename T4, typename T5,
16738    typename T6, typename T7, typename T8, typename T9, typename T10,
16739    typename T11, typename T12, typename T13, typename T14, typename T15,
16740    typename T16, typename T17, typename T18, typename T19, typename T20,
16741    typename T21, typename T22, typename T23, typename T24, typename T25,
16742    typename T26, typename T27, typename T28, typename T29, typename T30,
16743    typename T31, typename T32, typename T33, typename T34, typename T35,
16744    typename T36, typename T37, typename T38, typename T39, typename T40,
16745    typename T41, typename T42, typename T43, typename T44, typename T45,
16746    typename T46, typename T47, typename T48, typename T49, typename T50>
16747internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16748    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16749    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16750    T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16751    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16752    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16753    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16754    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
16755    T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
16756    T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
16757  return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16758      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16759      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16760      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
16761      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16762      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16763      v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
16764      v48, v49, v50);
16765}
16766
16767// Bool() allows generating tests with parameters in a set of (false, true).
16768//
16769// Synopsis:
16770// Bool()
16771//   - returns a generator producing sequences with elements {false, true}.
16772//
16773// It is useful when testing code that depends on Boolean flags. Combinations
16774// of multiple flags can be tested when several Bool()'s are combined using
16775// Combine() function.
16776//
16777// In the following example all tests in the test case FlagDependentTest
16778// will be instantiated twice with parameters false and true.
16779//
16780// class FlagDependentTest : public testing::TestWithParam<bool> {
16781//   virtual void SetUp() {
16782//     external_flag = GetParam();
16783//   }
16784// }
16785// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
16786//
16787inline internal::ParamGenerator<bool> Bool() {
16788  return Values(false, true);
16789}
16790
16791# if GTEST_HAS_COMBINE
16792// Combine() allows the user to combine two or more sequences to produce
16793// values of a Cartesian product of those sequences' elements.
16794//
16795// Synopsis:
16796// Combine(gen1, gen2, ..., genN)
16797//   - returns a generator producing sequences with elements coming from
16798//     the Cartesian product of elements from the sequences generated by
16799//     gen1, gen2, ..., genN. The sequence elements will have a type of
16800//     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
16801//     of elements from sequences produces by gen1, gen2, ..., genN.
16802//
16803// Combine can have up to 10 arguments. This number is currently limited
16804// by the maximum number of elements in the tuple implementation used by Google
16805// Test.
16806//
16807// Example:
16808//
16809// This will instantiate tests in test case AnimalTest each one with
16810// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
16811// tuple("dog", BLACK), and tuple("dog", WHITE):
16812//
16813// enum Color { BLACK, GRAY, WHITE };
16814// class AnimalTest
16815//     : public testing::TestWithParam<tuple<const char*, Color> > {...};
16816//
16817// TEST_P(AnimalTest, AnimalLooksNice) {...}
16818//
16819// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
16820//                         Combine(Values("cat", "dog"),
16821//                                 Values(BLACK, WHITE)));
16822//
16823// This will instantiate tests in FlagDependentTest with all variations of two
16824// Boolean flags:
16825//
16826// class FlagDependentTest
16827//     : public testing::TestWithParam<tuple<bool, bool> > {
16828//   virtual void SetUp() {
16829//     // Assigns external_flag_1 and external_flag_2 values from the tuple.
16830//     tie(external_flag_1, external_flag_2) = GetParam();
16831//   }
16832// };
16833//
16834// TEST_P(FlagDependentTest, TestFeature1) {
16835//   // Test your code using external_flag_1 and external_flag_2 here.
16836// }
16837// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
16838//                         Combine(Bool(), Bool()));
16839//
16840template <typename Generator1, typename Generator2>
16841internal::CartesianProductHolder2<Generator1, Generator2> Combine(
16842    const Generator1& g1, const Generator2& g2) {
16843  return internal::CartesianProductHolder2<Generator1, Generator2>(
16844      g1, g2);
16845}
16846
16847template <typename Generator1, typename Generator2, typename Generator3>
16848internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
16849    const Generator1& g1, const Generator2& g2, const Generator3& g3) {
16850  return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
16851      g1, g2, g3);
16852}
16853
16854template <typename Generator1, typename Generator2, typename Generator3,
16855    typename Generator4>
16856internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16857    Generator4> Combine(
16858    const Generator1& g1, const Generator2& g2, const Generator3& g3,
16859        const Generator4& g4) {
16860  return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16861      Generator4>(
16862      g1, g2, g3, g4);
16863}
16864
16865template <typename Generator1, typename Generator2, typename Generator3,
16866    typename Generator4, typename Generator5>
16867internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16868    Generator4, Generator5> Combine(
16869    const Generator1& g1, const Generator2& g2, const Generator3& g3,
16870        const Generator4& g4, const Generator5& g5) {
16871  return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16872      Generator4, Generator5>(
16873      g1, g2, g3, g4, g5);
16874}
16875
16876template <typename Generator1, typename Generator2, typename Generator3,
16877    typename Generator4, typename Generator5, typename Generator6>
16878internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16879    Generator4, Generator5, Generator6> Combine(
16880    const Generator1& g1, const Generator2& g2, const Generator3& g3,
16881        const Generator4& g4, const Generator5& g5, const Generator6& g6) {
16882  return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16883      Generator4, Generator5, Generator6>(
16884      g1, g2, g3, g4, g5, g6);
16885}
16886
16887template <typename Generator1, typename Generator2, typename Generator3,
16888    typename Generator4, typename Generator5, typename Generator6,
16889    typename Generator7>
16890internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16891    Generator4, Generator5, Generator6, Generator7> Combine(
16892    const Generator1& g1, const Generator2& g2, const Generator3& g3,
16893        const Generator4& g4, const Generator5& g5, const Generator6& g6,
16894        const Generator7& g7) {
16895  return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16896      Generator4, Generator5, Generator6, Generator7>(
16897      g1, g2, g3, g4, g5, g6, g7);
16898}
16899
16900template <typename Generator1, typename Generator2, typename Generator3,
16901    typename Generator4, typename Generator5, typename Generator6,
16902    typename Generator7, typename Generator8>
16903internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16904    Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
16905    const Generator1& g1, const Generator2& g2, const Generator3& g3,
16906        const Generator4& g4, const Generator5& g5, const Generator6& g6,
16907        const Generator7& g7, const Generator8& g8) {
16908  return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16909      Generator4, Generator5, Generator6, Generator7, Generator8>(
16910      g1, g2, g3, g4, g5, g6, g7, g8);
16911}
16912
16913template <typename Generator1, typename Generator2, typename Generator3,
16914    typename Generator4, typename Generator5, typename Generator6,
16915    typename Generator7, typename Generator8, typename Generator9>
16916internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16917    Generator4, Generator5, Generator6, Generator7, Generator8,
16918    Generator9> Combine(
16919    const Generator1& g1, const Generator2& g2, const Generator3& g3,
16920        const Generator4& g4, const Generator5& g5, const Generator6& g6,
16921        const Generator7& g7, const Generator8& g8, const Generator9& g9) {
16922  return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16923      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
16924      g1, g2, g3, g4, g5, g6, g7, g8, g9);
16925}
16926
16927template <typename Generator1, typename Generator2, typename Generator3,
16928    typename Generator4, typename Generator5, typename Generator6,
16929    typename Generator7, typename Generator8, typename Generator9,
16930    typename Generator10>
16931internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16932    Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16933    Generator10> Combine(
16934    const Generator1& g1, const Generator2& g2, const Generator3& g3,
16935        const Generator4& g4, const Generator5& g5, const Generator6& g6,
16936        const Generator7& g7, const Generator8& g8, const Generator9& g9,
16937        const Generator10& g10) {
16938  return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16939      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16940      Generator10>(
16941      g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
16942}
16943# endif  // GTEST_HAS_COMBINE
16944
16945
16946
16947# define TEST_P(test_case_name, test_name) \
16948  class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
16949      : public test_case_name { \
16950   public: \
16951    GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
16952    virtual void TestBody(); \
16953   private: \
16954    static int AddToRegistry() { \
16955      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
16956          GetTestCasePatternHolder<test_case_name>(\
16957              #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
16958                  #test_case_name, \
16959                  #test_name, \
16960                  new ::testing::internal::TestMetaFactory< \
16961                      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
16962      return 0; \
16963    } \
16964    static int gtest_registering_dummy_; \
16965    GTEST_DISALLOW_COPY_AND_ASSIGN_(\
16966        GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
16967  }; \
16968  int GTEST_TEST_CLASS_NAME_(test_case_name, \
16969                             test_name)::gtest_registering_dummy_ = \
16970      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
16971  void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
16972
16973# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
16974  ::testing::internal::ParamGenerator<test_case_name::ParamType> \
16975      gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
16976  int gtest_##prefix##test_case_name##_dummy_ = \
16977      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
16978          GetTestCasePatternHolder<test_case_name>(\
16979              #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
16980                  #prefix, \
16981                  &gtest_##prefix##test_case_name##_EvalGenerator_, \
16982                  __FILE__, __LINE__)
16983
16984}  // namespace testing
16985
16986#endif  // GTEST_HAS_PARAM_TEST
16987
16988#endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
16989// Copyright 2006, Google Inc.
16990// All rights reserved.
16991//
16992// Redistribution and use in source and binary forms, with or without
16993// modification, are permitted provided that the following conditions are
16994// met:
16995//
16996//     * Redistributions of source code must retain the above copyright
16997// notice, this list of conditions and the following disclaimer.
16998//     * Redistributions in binary form must reproduce the above
16999// copyright notice, this list of conditions and the following disclaimer
17000// in the documentation and/or other materials provided with the
17001// distribution.
17002//     * Neither the name of Google Inc. nor the names of its
17003// contributors may be used to endorse or promote products derived from
17004// this software without specific prior written permission.
17005//
17006// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17007// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17008// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17009// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17010// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17011// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17012// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17013// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17014// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17015// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17016// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17017//
17018// Author: wan@google.com (Zhanyong Wan)
17019//
17020// Google C++ Testing Framework definitions useful in production code.
17021
17022#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17023#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17024
17025// When you need to test the private or protected members of a class,
17026// use the FRIEND_TEST macro to declare your tests as friends of the
17027// class.  For example:
17028//
17029// class MyClass {
17030//  private:
17031//   void MyMethod();
17032//   FRIEND_TEST(MyClassTest, MyMethod);
17033// };
17034//
17035// class MyClassTest : public testing::Test {
17036//   // ...
17037// };
17038//
17039// TEST_F(MyClassTest, MyMethod) {
17040//   // Can call MyClass::MyMethod() here.
17041// }
17042
17043#define FRIEND_TEST(test_case_name, test_name)\
17044friend class test_case_name##_##test_name##_Test
17045
17046#endif  // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17047// Copyright 2008, Google Inc.
17048// All rights reserved.
17049//
17050// Redistribution and use in source and binary forms, with or without
17051// modification, are permitted provided that the following conditions are
17052// met:
17053//
17054//     * Redistributions of source code must retain the above copyright
17055// notice, this list of conditions and the following disclaimer.
17056//     * Redistributions in binary form must reproduce the above
17057// copyright notice, this list of conditions and the following disclaimer
17058// in the documentation and/or other materials provided with the
17059// distribution.
17060//     * Neither the name of Google Inc. nor the names of its
17061// contributors may be used to endorse or promote products derived from
17062// this software without specific prior written permission.
17063//
17064// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17065// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17066// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17067// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17068// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17069// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17070// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17071// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17072// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17073// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17074// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17075//
17076// Author: mheule@google.com (Markus Heule)
17077//
17078
17079#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17080#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17081
17082#include <iosfwd>
17083#include <vector>
17084
17085namespace testing {
17086
17087// A copyable object representing the result of a test part (i.e. an
17088// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
17089//
17090// Don't inherit from TestPartResult as its destructor is not virtual.
17091class GTEST_API_ TestPartResult {
17092 public:
17093  // The possible outcomes of a test part (i.e. an assertion or an
17094  // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
17095  enum Type {
17096    kSuccess,          // Succeeded.
17097    kNonFatalFailure,  // Failed but the test can continue.
17098    kFatalFailure      // Failed and the test should be terminated.
17099  };
17100
17101  // C'tor.  TestPartResult does NOT have a default constructor.
17102  // Always use this constructor (with parameters) to create a
17103  // TestPartResult object.
17104  TestPartResult(Type a_type,
17105                 const char* a_file_name,
17106                 int a_line_number,
17107                 const char* a_message)
17108      : type_(a_type),
17109        file_name_(a_file_name == NULL ? "" : a_file_name),
17110        line_number_(a_line_number),
17111        summary_(ExtractSummary(a_message)),
17112        message_(a_message) {
17113  }
17114
17115  // Gets the outcome of the test part.
17116  Type type() const { return type_; }
17117
17118  // Gets the name of the source file where the test part took place, or
17119  // NULL if it's unknown.
17120  const char* file_name() const {
17121    return file_name_.empty() ? NULL : file_name_.c_str();
17122  }
17123
17124  // Gets the line in the source file where the test part took place,
17125  // or -1 if it's unknown.
17126  int line_number() const { return line_number_; }
17127
17128  // Gets the summary of the failure message.
17129  const char* summary() const { return summary_.c_str(); }
17130
17131  // Gets the message associated with the test part.
17132  const char* message() const { return message_.c_str(); }
17133
17134  // Returns true iff the test part passed.
17135  bool passed() const { return type_ == kSuccess; }
17136
17137  // Returns true iff the test part failed.
17138  bool failed() const { return type_ != kSuccess; }
17139
17140  // Returns true iff the test part non-fatally failed.
17141  bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
17142
17143  // Returns true iff the test part fatally failed.
17144  bool fatally_failed() const { return type_ == kFatalFailure; }
17145
17146 private:
17147  Type type_;
17148
17149  // Gets the summary of the failure message by omitting the stack
17150  // trace in it.
17151  static std::string ExtractSummary(const char* message);
17152
17153  // The name of the source file where the test part took place, or
17154  // "" if the source file is unknown.
17155  std::string file_name_;
17156  // The line in the source file where the test part took place, or -1
17157  // if the line number is unknown.
17158  int line_number_;
17159  std::string summary_;  // The test failure summary.
17160  std::string message_;  // The test failure message.
17161};
17162
17163// Prints a TestPartResult object.
17164std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
17165
17166// An array of TestPartResult objects.
17167//
17168// Don't inherit from TestPartResultArray as its destructor is not
17169// virtual.
17170class GTEST_API_ TestPartResultArray {
17171 public:
17172  TestPartResultArray() {}
17173
17174  // Appends the given TestPartResult to the array.
17175  void Append(const TestPartResult& result);
17176
17177  // Returns the TestPartResult at the given index (0-based).
17178  const TestPartResult& GetTestPartResult(int index) const;
17179
17180  // Returns the number of TestPartResult objects in the array.
17181  int size() const;
17182
17183 private:
17184  std::vector<TestPartResult> array_;
17185
17186  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
17187};
17188
17189// This interface knows how to report a test part result.
17190class TestPartResultReporterInterface {
17191 public:
17192  virtual ~TestPartResultReporterInterface() {}
17193
17194  virtual void ReportTestPartResult(const TestPartResult& result) = 0;
17195};
17196
17197namespace internal {
17198
17199// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
17200// statement generates new fatal failures. To do so it registers itself as the
17201// current test part result reporter. Besides checking if fatal failures were
17202// reported, it only delegates the reporting to the former result reporter.
17203// The original result reporter is restored in the destructor.
17204// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
17205class GTEST_API_ HasNewFatalFailureHelper
17206    : public TestPartResultReporterInterface {
17207 public:
17208  HasNewFatalFailureHelper();
17209  virtual ~HasNewFatalFailureHelper();
17210  virtual void ReportTestPartResult(const TestPartResult& result);
17211  bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
17212 private:
17213  bool has_new_fatal_failure_;
17214  TestPartResultReporterInterface* original_reporter_;
17215
17216  GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
17217};
17218
17219}  // namespace internal
17220
17221}  // namespace testing
17222
17223#endif  // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17224// Copyright 2008 Google Inc.
17225// All Rights Reserved.
17226//
17227// Redistribution and use in source and binary forms, with or without
17228// modification, are permitted provided that the following conditions are
17229// met:
17230//
17231//     * Redistributions of source code must retain the above copyright
17232// notice, this list of conditions and the following disclaimer.
17233//     * Redistributions in binary form must reproduce the above
17234// copyright notice, this list of conditions and the following disclaimer
17235// in the documentation and/or other materials provided with the
17236// distribution.
17237//     * Neither the name of Google Inc. nor the names of its
17238// contributors may be used to endorse or promote products derived from
17239// this software without specific prior written permission.
17240//
17241// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17242// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17243// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17244// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17245// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17246// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17247// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17248// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17249// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17250// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17251// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17252//
17253// Author: wan@google.com (Zhanyong Wan)
17254
17255#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17256#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17257
17258// This header implements typed tests and type-parameterized tests.
17259
17260// Typed (aka type-driven) tests repeat the same test for types in a
17261// list.  You must know which types you want to test with when writing
17262// typed tests. Here's how you do it:
17263
17264#if 0
17265
17266// First, define a fixture class template.  It should be parameterized
17267// by a type.  Remember to derive it from testing::Test.
17268template <typename T>
17269class FooTest : public testing::Test {
17270 public:
17271  ...
17272  typedef std::list<T> List;
17273  static T shared_;
17274  T value_;
17275};
17276
17277// Next, associate a list of types with the test case, which will be
17278// repeated for each type in the list.  The typedef is necessary for
17279// the macro to parse correctly.
17280typedef testing::Types<char, int, unsigned int> MyTypes;
17281TYPED_TEST_CASE(FooTest, MyTypes);
17282
17283// If the type list contains only one type, you can write that type
17284// directly without Types<...>:
17285//   TYPED_TEST_CASE(FooTest, int);
17286
17287// Then, use TYPED_TEST() instead of TEST_F() to define as many typed
17288// tests for this test case as you want.
17289TYPED_TEST(FooTest, DoesBlah) {
17290  // Inside a test, refer to TypeParam to get the type parameter.
17291  // Since we are inside a derived class template, C++ requires use to
17292  // visit the members of FooTest via 'this'.
17293  TypeParam n = this->value_;
17294
17295  // To visit static members of the fixture, add the TestFixture::
17296  // prefix.
17297  n += TestFixture::shared_;
17298
17299  // To refer to typedefs in the fixture, add the "typename
17300  // TestFixture::" prefix.
17301  typename TestFixture::List values;
17302  values.push_back(n);
17303  ...
17304}
17305
17306TYPED_TEST(FooTest, HasPropertyA) { ... }
17307
17308#endif  // 0
17309
17310// Type-parameterized tests are abstract test patterns parameterized
17311// by a type.  Compared with typed tests, type-parameterized tests
17312// allow you to define the test pattern without knowing what the type
17313// parameters are.  The defined pattern can be instantiated with
17314// different types any number of times, in any number of translation
17315// units.
17316//
17317// If you are designing an interface or concept, you can define a
17318// suite of type-parameterized tests to verify properties that any
17319// valid implementation of the interface/concept should have.  Then,
17320// each implementation can easily instantiate the test suite to verify
17321// that it conforms to the requirements, without having to write
17322// similar tests repeatedly.  Here's an example:
17323
17324#if 0
17325
17326// First, define a fixture class template.  It should be parameterized
17327// by a type.  Remember to derive it from testing::Test.
17328template <typename T>
17329class FooTest : public testing::Test {
17330  ...
17331};
17332
17333// Next, declare that you will define a type-parameterized test case
17334// (the _P suffix is for "parameterized" or "pattern", whichever you
17335// prefer):
17336TYPED_TEST_CASE_P(FooTest);
17337
17338// Then, use TYPED_TEST_P() to define as many type-parameterized tests
17339// for this type-parameterized test case as you want.
17340TYPED_TEST_P(FooTest, DoesBlah) {
17341  // Inside a test, refer to TypeParam to get the type parameter.
17342  TypeParam n = 0;
17343  ...
17344}
17345
17346TYPED_TEST_P(FooTest, HasPropertyA) { ... }
17347
17348// Now the tricky part: you need to register all test patterns before
17349// you can instantiate them.  The first argument of the macro is the
17350// test case name; the rest are the names of the tests in this test
17351// case.
17352REGISTER_TYPED_TEST_CASE_P(FooTest,
17353                           DoesBlah, HasPropertyA);
17354
17355// Finally, you are free to instantiate the pattern with the types you
17356// want.  If you put the above code in a header file, you can #include
17357// it in multiple C++ source files and instantiate it multiple times.
17358//
17359// To distinguish different instances of the pattern, the first
17360// argument to the INSTANTIATE_* macro is a prefix that will be added
17361// to the actual test case name.  Remember to pick unique prefixes for
17362// different instances.
17363typedef testing::Types<char, int, unsigned int> MyTypes;
17364INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
17365
17366// If the type list contains only one type, you can write that type
17367// directly without Types<...>:
17368//   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
17369
17370#endif  // 0
17371
17372
17373// Implements typed tests.
17374
17375#if GTEST_HAS_TYPED_TEST
17376
17377// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17378//
17379// Expands to the name of the typedef for the type parameters of the
17380// given test case.
17381# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
17382
17383// The 'Types' template argument below must have spaces around it
17384// since some compilers may choke on '>>' when passing a template
17385// instance (e.g. Types<int>)
17386# define TYPED_TEST_CASE(CaseName, Types) \
17387  typedef ::testing::internal::TypeList< Types >::type \
17388      GTEST_TYPE_PARAMS_(CaseName)
17389
17390# define TYPED_TEST(CaseName, TestName) \
17391  template <typename gtest_TypeParam_> \
17392  class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
17393      : public CaseName<gtest_TypeParam_> { \
17394   private: \
17395    typedef CaseName<gtest_TypeParam_> TestFixture; \
17396    typedef gtest_TypeParam_ TypeParam; \
17397    virtual void TestBody(); \
17398  }; \
17399  bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
17400      ::testing::internal::TypeParameterizedTest< \
17401          CaseName, \
17402          ::testing::internal::TemplateSel< \
17403              GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
17404          GTEST_TYPE_PARAMS_(CaseName)>::Register(\
17405              "", #CaseName, #TestName, 0); \
17406  template <typename gtest_TypeParam_> \
17407  void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
17408
17409#endif  // GTEST_HAS_TYPED_TEST
17410
17411// Implements type-parameterized tests.
17412
17413#if GTEST_HAS_TYPED_TEST_P
17414
17415// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17416//
17417// Expands to the namespace name that the type-parameterized tests for
17418// the given type-parameterized test case are defined in.  The exact
17419// name of the namespace is subject to change without notice.
17420# define GTEST_CASE_NAMESPACE_(TestCaseName) \
17421  gtest_case_##TestCaseName##_
17422
17423// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17424//
17425// Expands to the name of the variable used to remember the names of
17426// the defined tests in the given test case.
17427# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
17428  gtest_typed_test_case_p_state_##TestCaseName##_
17429
17430// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
17431//
17432// Expands to the name of the variable used to remember the names of
17433// the registered tests in the given test case.
17434# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
17435  gtest_registered_test_names_##TestCaseName##_
17436
17437// The variables defined in the type-parameterized test macros are
17438// static as typically these macros are used in a .h file that can be
17439// #included in multiple translation units linked together.
17440# define TYPED_TEST_CASE_P(CaseName) \
17441  static ::testing::internal::TypedTestCasePState \
17442      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
17443
17444# define TYPED_TEST_P(CaseName, TestName) \
17445  namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17446  template <typename gtest_TypeParam_> \
17447  class TestName : public CaseName<gtest_TypeParam_> { \
17448   private: \
17449    typedef CaseName<gtest_TypeParam_> TestFixture; \
17450    typedef gtest_TypeParam_ TypeParam; \
17451    virtual void TestBody(); \
17452  }; \
17453  static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
17454      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
17455          __FILE__, __LINE__, #CaseName, #TestName); \
17456  } \
17457  template <typename gtest_TypeParam_> \
17458  void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
17459
17460# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
17461  namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17462  typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
17463  } \
17464  static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
17465      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
17466          __FILE__, __LINE__, #__VA_ARGS__)
17467
17468// The 'Types' template argument below must have spaces around it
17469// since some compilers may choke on '>>' when passing a template
17470// instance (e.g. Types<int>)
17471# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
17472  bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
17473      ::testing::internal::TypeParameterizedTestCase<CaseName, \
17474          GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
17475          ::testing::internal::TypeList< Types >::type>::Register(\
17476              #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
17477
17478#endif  // GTEST_HAS_TYPED_TEST_P
17479
17480#endif  // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17481
17482// Depending on the platform, different string classes are available.
17483// On Linux, in addition to ::std::string, Google also makes use of
17484// class ::string, which has the same interface as ::std::string, but
17485// has a different implementation.
17486//
17487// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
17488// ::string is available AND is a distinct type to ::std::string, or
17489// define it to 0 to indicate otherwise.
17490//
17491// If the user's ::std::string and ::string are the same class due to
17492// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
17493//
17494// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
17495// heuristically.
17496
17497namespace testing {
17498
17499// Declares the flags.
17500
17501// This flag temporary enables the disabled tests.
17502GTEST_DECLARE_bool_(also_run_disabled_tests);
17503
17504// This flag brings the debugger on an assertion failure.
17505GTEST_DECLARE_bool_(break_on_failure);
17506
17507// This flag controls whether Google Test catches all test-thrown exceptions
17508// and logs them as failures.
17509GTEST_DECLARE_bool_(catch_exceptions);
17510
17511// This flag enables using colors in terminal output. Available values are
17512// "yes" to enable colors, "no" (disable colors), or "auto" (the default)
17513// to let Google Test decide.
17514GTEST_DECLARE_string_(color);
17515
17516// This flag sets up the filter to select by name using a glob pattern
17517// the tests to run. If the filter is not given all tests are executed.
17518GTEST_DECLARE_string_(filter);
17519
17520// This flag causes the Google Test to list tests. None of the tests listed
17521// are actually run if the flag is provided.
17522GTEST_DECLARE_bool_(list_tests);
17523
17524// This flag controls whether Google Test emits a detailed XML report to a file
17525// in addition to its normal textual output.
17526GTEST_DECLARE_string_(output);
17527
17528// This flags control whether Google Test prints the elapsed time for each
17529// test.
17530GTEST_DECLARE_bool_(print_time);
17531
17532// This flag specifies the random number seed.
17533GTEST_DECLARE_int32_(random_seed);
17534
17535// This flag sets how many times the tests are repeated. The default value
17536// is 1. If the value is -1 the tests are repeating forever.
17537GTEST_DECLARE_int32_(repeat);
17538
17539// This flag controls whether Google Test includes Google Test internal
17540// stack frames in failure stack traces.
17541GTEST_DECLARE_bool_(show_internal_stack_frames);
17542
17543// When this flag is specified, tests' order is randomized on every iteration.
17544GTEST_DECLARE_bool_(shuffle);
17545
17546// This flag specifies the maximum number of stack frames to be
17547// printed in a failure message.
17548GTEST_DECLARE_int32_(stack_trace_depth);
17549
17550// When this flag is specified, a failed assertion will throw an
17551// exception if exceptions are enabled, or exit the program with a
17552// non-zero code otherwise.
17553GTEST_DECLARE_bool_(throw_on_failure);
17554
17555// When this flag is set with a "host:port" string, on supported
17556// platforms test results are streamed to the specified port on
17557// the specified host machine.
17558GTEST_DECLARE_string_(stream_result_to);
17559
17560// The upper limit for valid stack trace depths.
17561const int kMaxStackTraceDepth = 100;
17562
17563namespace internal {
17564
17565class AssertHelper;
17566class DefaultGlobalTestPartResultReporter;
17567class ExecDeathTest;
17568class NoExecDeathTest;
17569class FinalSuccessChecker;
17570class GTestFlagSaver;
17571class StreamingListenerTest;
17572class TestResultAccessor;
17573class TestEventListenersAccessor;
17574class TestEventRepeater;
17575class UnitTestRecordPropertyTestHelper;
17576class WindowsDeathTest;
17577class UnitTestImpl* GetUnitTestImpl();
17578void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
17579                                    const std::string& message);
17580
17581}  // namespace internal
17582
17583// The friend relationship of some of these classes is cyclic.
17584// If we don't forward declare them the compiler might confuse the classes
17585// in friendship clauses with same named classes on the scope.
17586class Test;
17587class TestCase;
17588class TestInfo;
17589class UnitTest;
17590
17591// A class for indicating whether an assertion was successful.  When
17592// the assertion wasn't successful, the AssertionResult object
17593// remembers a non-empty message that describes how it failed.
17594//
17595// To create an instance of this class, use one of the factory functions
17596// (AssertionSuccess() and AssertionFailure()).
17597//
17598// This class is useful for two purposes:
17599//   1. Defining predicate functions to be used with Boolean test assertions
17600//      EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
17601//   2. Defining predicate-format functions to be
17602//      used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
17603//
17604// For example, if you define IsEven predicate:
17605//
17606//   testing::AssertionResult IsEven(int n) {
17607//     if ((n % 2) == 0)
17608//       return testing::AssertionSuccess();
17609//     else
17610//       return testing::AssertionFailure() << n << " is odd";
17611//   }
17612//
17613// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
17614// will print the message
17615//
17616//   Value of: IsEven(Fib(5))
17617//     Actual: false (5 is odd)
17618//   Expected: true
17619//
17620// instead of a more opaque
17621//
17622//   Value of: IsEven(Fib(5))
17623//     Actual: false
17624//   Expected: true
17625//
17626// in case IsEven is a simple Boolean predicate.
17627//
17628// If you expect your predicate to be reused and want to support informative
17629// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
17630// about half as often as positive ones in our tests), supply messages for
17631// both success and failure cases:
17632//
17633//   testing::AssertionResult IsEven(int n) {
17634//     if ((n % 2) == 0)
17635//       return testing::AssertionSuccess() << n << " is even";
17636//     else
17637//       return testing::AssertionFailure() << n << " is odd";
17638//   }
17639//
17640// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
17641//
17642//   Value of: IsEven(Fib(6))
17643//     Actual: true (8 is even)
17644//   Expected: false
17645//
17646// NB: Predicates that support negative Boolean assertions have reduced
17647// performance in positive ones so be careful not to use them in tests
17648// that have lots (tens of thousands) of positive Boolean assertions.
17649//
17650// To use this class with EXPECT_PRED_FORMAT assertions such as:
17651//
17652//   // Verifies that Foo() returns an even number.
17653//   EXPECT_PRED_FORMAT1(IsEven, Foo());
17654//
17655// you need to define:
17656//
17657//   testing::AssertionResult IsEven(const char* expr, int n) {
17658//     if ((n % 2) == 0)
17659//       return testing::AssertionSuccess();
17660//     else
17661//       return testing::AssertionFailure()
17662//         << "Expected: " << expr << " is even\n  Actual: it's " << n;
17663//   }
17664//
17665// If Foo() returns 5, you will see the following message:
17666//
17667//   Expected: Foo() is even
17668//     Actual: it's 5
17669//
17670class GTEST_API_ AssertionResult {
17671 public:
17672  // Copy constructor.
17673  // Used in EXPECT_TRUE/FALSE(assertion_result).
17674  AssertionResult(const AssertionResult& other);
17675  // Used in the EXPECT_TRUE/FALSE(bool_expression).
17676  explicit AssertionResult(bool success) : success_(success) {}
17677
17678  // Returns true iff the assertion succeeded.
17679  operator bool() const { return success_; }  // NOLINT
17680
17681  // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
17682  AssertionResult operator!() const;
17683
17684  // Returns the text streamed into this AssertionResult. Test assertions
17685  // use it when they fail (i.e., the predicate's outcome doesn't match the
17686  // assertion's expectation). When nothing has been streamed into the
17687  // object, returns an empty string.
17688  const char* message() const {
17689    return message_.get() != NULL ?  message_->c_str() : "";
17690  }
17691  // TODO(vladl@google.com): Remove this after making sure no clients use it.
17692  // Deprecated; please use message() instead.
17693  const char* failure_message() const { return message(); }
17694
17695  // Streams a custom failure message into this object.
17696  template <typename T> AssertionResult& operator<<(const T& value) {
17697    AppendMessage(Message() << value);
17698    return *this;
17699  }
17700
17701  // Allows streaming basic output manipulators such as endl or flush into
17702  // this object.
17703  AssertionResult& operator<<(
17704      ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
17705    AppendMessage(Message() << basic_manipulator);
17706    return *this;
17707  }
17708
17709 private:
17710  // Appends the contents of message to message_.
17711  void AppendMessage(const Message& a_message) {
17712    if (message_.get() == NULL)
17713      message_.reset(new ::std::string);
17714    message_->append(a_message.GetString().c_str());
17715  }
17716
17717  // Stores result of the assertion predicate.
17718  bool success_;
17719  // Stores the message describing the condition in case the expectation
17720  // construct is not satisfied with the predicate's outcome.
17721  // Referenced via a pointer to avoid taking too much stack frame space
17722  // with test assertions.
17723  internal::scoped_ptr< ::std::string> message_;
17724
17725  GTEST_DISALLOW_ASSIGN_(AssertionResult);
17726};
17727
17728// Makes a successful assertion result.
17729GTEST_API_ AssertionResult AssertionSuccess();
17730
17731// Makes a failed assertion result.
17732GTEST_API_ AssertionResult AssertionFailure();
17733
17734// Makes a failed assertion result with the given failure message.
17735// Deprecated; use AssertionFailure() << msg.
17736GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
17737
17738// The abstract class that all tests inherit from.
17739//
17740// In Google Test, a unit test program contains one or many TestCases, and
17741// each TestCase contains one or many Tests.
17742//
17743// When you define a test using the TEST macro, you don't need to
17744// explicitly derive from Test - the TEST macro automatically does
17745// this for you.
17746//
17747// The only time you derive from Test is when defining a test fixture
17748// to be used a TEST_F.  For example:
17749//
17750//   class FooTest : public testing::Test {
17751//    protected:
17752//     virtual void SetUp() { ... }
17753//     virtual void TearDown() { ... }
17754//     ...
17755//   };
17756//
17757//   TEST_F(FooTest, Bar) { ... }
17758//   TEST_F(FooTest, Baz) { ... }
17759//
17760// Test is not copyable.
17761class GTEST_API_ Test {
17762 public:
17763  friend class TestInfo;
17764
17765  // Defines types for pointers to functions that set up and tear down
17766  // a test case.
17767  typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
17768  typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
17769
17770  // The d'tor is virtual as we intend to inherit from Test.
17771  virtual ~Test();
17772
17773  // Sets up the stuff shared by all tests in this test case.
17774  //
17775  // Google Test will call Foo::SetUpTestCase() before running the first
17776  // test in test case Foo.  Hence a sub-class can define its own
17777  // SetUpTestCase() method to shadow the one defined in the super
17778  // class.
17779  static void SetUpTestCase() {}
17780
17781  // Tears down the stuff shared by all tests in this test case.
17782  //
17783  // Google Test will call Foo::TearDownTestCase() after running the last
17784  // test in test case Foo.  Hence a sub-class can define its own
17785  // TearDownTestCase() method to shadow the one defined in the super
17786  // class.
17787  static void TearDownTestCase() {}
17788
17789  // Returns true iff the current test has a fatal failure.
17790  static bool HasFatalFailure();
17791
17792  // Returns true iff the current test has a non-fatal failure.
17793  static bool HasNonfatalFailure();
17794
17795  // Returns true iff the current test has a (either fatal or
17796  // non-fatal) failure.
17797  static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
17798
17799  // Logs a property for the current test, test case, or for the entire
17800  // invocation of the test program when used outside of the context of a
17801  // test case.  Only the last value for a given key is remembered.  These
17802  // are public static so they can be called from utility functions that are
17803  // not members of the test fixture.  Calls to RecordProperty made during
17804  // lifespan of the test (from the moment its constructor starts to the
17805  // moment its destructor finishes) will be output in XML as attributes of
17806  // the <testcase> element.  Properties recorded from fixture's
17807  // SetUpTestCase or TearDownTestCase are logged as attributes of the
17808  // corresponding <testsuite> element.  Calls to RecordProperty made in the
17809  // global context (before or after invocation of RUN_ALL_TESTS and from
17810  // SetUp/TearDown method of Environment objects registered with Google
17811  // Test) will be output as attributes of the <testsuites> element.
17812  static void RecordProperty(const std::string& key, const std::string& value);
17813  static void RecordProperty(const std::string& key, int value);
17814
17815 protected:
17816  // Creates a Test object.
17817  Test();
17818
17819  // Sets up the test fixture.
17820  virtual void SetUp();
17821
17822  // Tears down the test fixture.
17823  virtual void TearDown();
17824
17825 private:
17826  // Returns true iff the current test has the same fixture class as
17827  // the first test in the current test case.
17828  static bool HasSameFixtureClass();
17829
17830  // Runs the test after the test fixture has been set up.
17831  //
17832  // A sub-class must implement this to define the test logic.
17833  //
17834  // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
17835  // Instead, use the TEST or TEST_F macro.
17836  virtual void TestBody() = 0;
17837
17838  // Sets up, executes, and tears down the test.
17839  void Run();
17840
17841  // Deletes self.  We deliberately pick an unusual name for this
17842  // internal method to avoid clashing with names used in user TESTs.
17843  void DeleteSelf_() { delete this; }
17844
17845  // Uses a GTestFlagSaver to save and restore all Google Test flags.
17846  const internal::GTestFlagSaver* const gtest_flag_saver_;
17847
17848  // Often a user mis-spells SetUp() as Setup() and spends a long time
17849  // wondering why it is never called by Google Test.  The declaration of
17850  // the following method is solely for catching such an error at
17851  // compile time:
17852  //
17853  //   - The return type is deliberately chosen to be not void, so it
17854  //   will be a conflict if a user declares void Setup() in his test
17855  //   fixture.
17856  //
17857  //   - This method is private, so it will be another compiler error
17858  //   if a user calls it from his test fixture.
17859  //
17860  // DO NOT OVERRIDE THIS FUNCTION.
17861  //
17862  // If you see an error about overriding the following function or
17863  // about it being private, you have mis-spelled SetUp() as Setup().
17864  struct Setup_should_be_spelled_SetUp {};
17865  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
17866
17867  // We disallow copying Tests.
17868  GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
17869};
17870
17871typedef internal::TimeInMillis TimeInMillis;
17872
17873// A copyable object representing a user specified test property which can be
17874// output as a key/value string pair.
17875//
17876// Don't inherit from TestProperty as its destructor is not virtual.
17877class TestProperty {
17878 public:
17879  // C'tor.  TestProperty does NOT have a default constructor.
17880  // Always use this constructor (with parameters) to create a
17881  // TestProperty object.
17882  TestProperty(const std::string& a_key, const std::string& a_value) :
17883    key_(a_key), value_(a_value) {
17884  }
17885
17886  // Gets the user supplied key.
17887  const char* key() const {
17888    return key_.c_str();
17889  }
17890
17891  // Gets the user supplied value.
17892  const char* value() const {
17893    return value_.c_str();
17894  }
17895
17896  // Sets a new value, overriding the one supplied in the constructor.
17897  void SetValue(const std::string& new_value) {
17898    value_ = new_value;
17899  }
17900
17901 private:
17902  // The key supplied by the user.
17903  std::string key_;
17904  // The value supplied by the user.
17905  std::string value_;
17906};
17907
17908// The result of a single Test.  This includes a list of
17909// TestPartResults, a list of TestProperties, a count of how many
17910// death tests there are in the Test, and how much time it took to run
17911// the Test.
17912//
17913// TestResult is not copyable.
17914class GTEST_API_ TestResult {
17915 public:
17916  // Creates an empty TestResult.
17917  TestResult();
17918
17919  // D'tor.  Do not inherit from TestResult.
17920  ~TestResult();
17921
17922  // Gets the number of all test parts.  This is the sum of the number
17923  // of successful test parts and the number of failed test parts.
17924  int total_part_count() const;
17925
17926  // Returns the number of the test properties.
17927  int test_property_count() const;
17928
17929  // Returns true iff the test passed (i.e. no test part failed).
17930  bool Passed() const { return !Failed(); }
17931
17932  // Returns true iff the test failed.
17933  bool Failed() const;
17934
17935  // Returns true iff the test fatally failed.
17936  bool HasFatalFailure() const;
17937
17938  // Returns true iff the test has a non-fatal failure.
17939  bool HasNonfatalFailure() const;
17940
17941  // Returns the elapsed time, in milliseconds.
17942  TimeInMillis elapsed_time() const { return elapsed_time_; }
17943
17944  // Returns the i-th test part result among all the results. i can range
17945  // from 0 to test_property_count() - 1. If i is not in that range, aborts
17946  // the program.
17947  const TestPartResult& GetTestPartResult(int i) const;
17948
17949  // Returns the i-th test property. i can range from 0 to
17950  // test_property_count() - 1. If i is not in that range, aborts the
17951  // program.
17952  const TestProperty& GetTestProperty(int i) const;
17953
17954 private:
17955  friend class TestInfo;
17956  friend class TestCase;
17957  friend class UnitTest;
17958  friend class internal::DefaultGlobalTestPartResultReporter;
17959  friend class internal::ExecDeathTest;
17960  friend class internal::TestResultAccessor;
17961  friend class internal::UnitTestImpl;
17962  friend class internal::WindowsDeathTest;
17963
17964  // Gets the vector of TestPartResults.
17965  const std::vector<TestPartResult>& test_part_results() const {
17966    return test_part_results_;
17967  }
17968
17969  // Gets the vector of TestProperties.
17970  const std::vector<TestProperty>& test_properties() const {
17971    return test_properties_;
17972  }
17973
17974  // Sets the elapsed time.
17975  void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
17976
17977  // Adds a test property to the list. The property is validated and may add
17978  // a non-fatal failure if invalid (e.g., if it conflicts with reserved
17979  // key names). If a property is already recorded for the same key, the
17980  // value will be updated, rather than storing multiple values for the same
17981  // key.  xml_element specifies the element for which the property is being
17982  // recorded and is used for validation.
17983  void RecordProperty(const std::string& xml_element,
17984                      const TestProperty& test_property);
17985
17986  // Adds a failure if the key is a reserved attribute of Google Test
17987  // testcase tags.  Returns true if the property is valid.
17988  // TODO(russr): Validate attribute names are legal and human readable.
17989  static bool ValidateTestProperty(const std::string& xml_element,
17990                                   const TestProperty& test_property);
17991
17992  // Adds a test part result to the list.
17993  void AddTestPartResult(const TestPartResult& test_part_result);
17994
17995  // Returns the death test count.
17996  int death_test_count() const { return death_test_count_; }
17997
17998  // Increments the death test count, returning the new count.
17999  int increment_death_test_count() { return ++death_test_count_; }
18000
18001  // Clears the test part results.
18002  void ClearTestPartResults();
18003
18004  // Clears the object.
18005  void Clear();
18006
18007  // Protects mutable state of the property vector and of owned
18008  // properties, whose values may be updated.
18009  internal::Mutex test_properites_mutex_;
18010
18011  // The vector of TestPartResults
18012  std::vector<TestPartResult> test_part_results_;
18013  // The vector of TestProperties
18014  std::vector<TestProperty> test_properties_;
18015  // Running count of death tests.
18016  int death_test_count_;
18017  // The elapsed time, in milliseconds.
18018  TimeInMillis elapsed_time_;
18019
18020  // We disallow copying TestResult.
18021  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
18022};  // class TestResult
18023
18024// A TestInfo object stores the following information about a test:
18025//
18026//   Test case name
18027//   Test name
18028//   Whether the test should be run
18029//   A function pointer that creates the test object when invoked
18030//   Test result
18031//
18032// The constructor of TestInfo registers itself with the UnitTest
18033// singleton such that the RUN_ALL_TESTS() macro knows which tests to
18034// run.
18035class GTEST_API_ TestInfo {
18036 public:
18037  // Destructs a TestInfo object.  This function is not virtual, so
18038  // don't inherit from TestInfo.
18039  ~TestInfo();
18040
18041  // Returns the test case name.
18042  const char* test_case_name() const { return test_case_name_.c_str(); }
18043
18044  // Returns the test name.
18045  const char* name() const { return name_.c_str(); }
18046
18047  // Returns the name of the parameter type, or NULL if this is not a typed
18048  // or a type-parameterized test.
18049  const char* type_param() const {
18050    if (type_param_.get() != NULL)
18051      return type_param_->c_str();
18052    return NULL;
18053  }
18054
18055  // Returns the text representation of the value parameter, or NULL if this
18056  // is not a value-parameterized test.
18057  const char* value_param() const {
18058    if (value_param_.get() != NULL)
18059      return value_param_->c_str();
18060    return NULL;
18061  }
18062
18063  // Returns true if this test should run, that is if the test is not
18064  // disabled (or it is disabled but the also_run_disabled_tests flag has
18065  // been specified) and its full name matches the user-specified filter.
18066  //
18067  // Google Test allows the user to filter the tests by their full names.
18068  // The full name of a test Bar in test case Foo is defined as
18069  // "Foo.Bar".  Only the tests that match the filter will run.
18070  //
18071  // A filter is a colon-separated list of glob (not regex) patterns,
18072  // optionally followed by a '-' and a colon-separated list of
18073  // negative patterns (tests to exclude).  A test is run if it
18074  // matches one of the positive patterns and does not match any of
18075  // the negative patterns.
18076  //
18077  // For example, *A*:Foo.* is a filter that matches any string that
18078  // contains the character 'A' or starts with "Foo.".
18079  bool should_run() const { return should_run_; }
18080
18081  // Returns true iff this test will appear in the XML report.
18082  bool is_reportable() const {
18083    // For now, the XML report includes all tests matching the filter.
18084    // In the future, we may trim tests that are excluded because of
18085    // sharding.
18086    return matches_filter_;
18087  }
18088
18089  // Returns the result of the test.
18090  const TestResult* result() const { return &result_; }
18091
18092 private:
18093#if GTEST_HAS_DEATH_TEST
18094  friend class internal::DefaultDeathTestFactory;
18095#endif  // GTEST_HAS_DEATH_TEST
18096  friend class Test;
18097  friend class TestCase;
18098  friend class internal::UnitTestImpl;
18099  friend class internal::StreamingListenerTest;
18100  friend TestInfo* internal::MakeAndRegisterTestInfo(
18101      const char* test_case_name,
18102      const char* name,
18103      const char* type_param,
18104      const char* value_param,
18105      internal::TypeId fixture_class_id,
18106      Test::SetUpTestCaseFunc set_up_tc,
18107      Test::TearDownTestCaseFunc tear_down_tc,
18108      internal::TestFactoryBase* factory);
18109
18110  // Constructs a TestInfo object. The newly constructed instance assumes
18111  // ownership of the factory object.
18112  TestInfo(const std::string& test_case_name,
18113           const std::string& name,
18114           const char* a_type_param,   // NULL if not a type-parameterized test
18115           const char* a_value_param,  // NULL if not a value-parameterized test
18116           internal::TypeId fixture_class_id,
18117           internal::TestFactoryBase* factory);
18118
18119  // Increments the number of death tests encountered in this test so
18120  // far.
18121  int increment_death_test_count() {
18122    return result_.increment_death_test_count();
18123  }
18124
18125  // Creates the test object, runs it, records its result, and then
18126  // deletes it.
18127  void Run();
18128
18129  static void ClearTestResult(TestInfo* test_info) {
18130    test_info->result_.Clear();
18131  }
18132
18133  // These fields are immutable properties of the test.
18134  const std::string test_case_name_;     // Test case name
18135  const std::string name_;               // Test name
18136  // Name of the parameter type, or NULL if this is not a typed or a
18137  // type-parameterized test.
18138  const internal::scoped_ptr<const ::std::string> type_param_;
18139  // Text representation of the value parameter, or NULL if this is not a
18140  // value-parameterized test.
18141  const internal::scoped_ptr<const ::std::string> value_param_;
18142  const internal::TypeId fixture_class_id_;   // ID of the test fixture class
18143  bool should_run_;                 // True iff this test should run
18144  bool is_disabled_;                // True iff this test is disabled
18145  bool matches_filter_;             // True if this test matches the
18146                                    // user-specified filter.
18147  internal::TestFactoryBase* const factory_;  // The factory that creates
18148                                              // the test object
18149
18150  // This field is mutable and needs to be reset before running the
18151  // test for the second time.
18152  TestResult result_;
18153
18154  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
18155};
18156
18157// A test case, which consists of a vector of TestInfos.
18158//
18159// TestCase is not copyable.
18160class GTEST_API_ TestCase {
18161 public:
18162  // Creates a TestCase with the given name.
18163  //
18164  // TestCase does NOT have a default constructor.  Always use this
18165  // constructor to create a TestCase object.
18166  //
18167  // Arguments:
18168  //
18169  //   name:         name of the test case
18170  //   a_type_param: the name of the test's type parameter, or NULL if
18171  //                 this is not a type-parameterized test.
18172  //   set_up_tc:    pointer to the function that sets up the test case
18173  //   tear_down_tc: pointer to the function that tears down the test case
18174  TestCase(const char* name, const char* a_type_param,
18175           Test::SetUpTestCaseFunc set_up_tc,
18176           Test::TearDownTestCaseFunc tear_down_tc);
18177
18178  // Destructor of TestCase.
18179  virtual ~TestCase();
18180
18181  // Gets the name of the TestCase.
18182  const char* name() const { return name_.c_str(); }
18183
18184  // Returns the name of the parameter type, or NULL if this is not a
18185  // type-parameterized test case.
18186  const char* type_param() const {
18187    if (type_param_.get() != NULL)
18188      return type_param_->c_str();
18189    return NULL;
18190  }
18191
18192  // Returns true if any test in this test case should run.
18193  bool should_run() const { return should_run_; }
18194
18195  // Gets the number of successful tests in this test case.
18196  int successful_test_count() const;
18197
18198  // Gets the number of failed tests in this test case.
18199  int failed_test_count() const;
18200
18201  // Gets the number of disabled tests that will be reported in the XML report.
18202  int reportable_disabled_test_count() const;
18203
18204  // Gets the number of disabled tests in this test case.
18205  int disabled_test_count() const;
18206
18207  // Gets the number of tests to be printed in the XML report.
18208  int reportable_test_count() const;
18209
18210  // Get the number of tests in this test case that should run.
18211  int test_to_run_count() const;
18212
18213  // Gets the number of all tests in this test case.
18214  int total_test_count() const;
18215
18216  // Returns true iff the test case passed.
18217  bool Passed() const { return !Failed(); }
18218
18219  // Returns true iff the test case failed.
18220  bool Failed() const { return failed_test_count() > 0; }
18221
18222  // Returns the elapsed time, in milliseconds.
18223  TimeInMillis elapsed_time() const { return elapsed_time_; }
18224
18225  // Returns the i-th test among all the tests. i can range from 0 to
18226  // total_test_count() - 1. If i is not in that range, returns NULL.
18227  const TestInfo* GetTestInfo(int i) const;
18228
18229  // Returns the TestResult that holds test properties recorded during
18230  // execution of SetUpTestCase and TearDownTestCase.
18231  const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
18232
18233 private:
18234  friend class Test;
18235  friend class internal::UnitTestImpl;
18236
18237  // Gets the (mutable) vector of TestInfos in this TestCase.
18238  std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
18239
18240  // Gets the (immutable) vector of TestInfos in this TestCase.
18241  const std::vector<TestInfo*>& test_info_list() const {
18242    return test_info_list_;
18243  }
18244
18245  // Returns the i-th test among all the tests. i can range from 0 to
18246  // total_test_count() - 1. If i is not in that range, returns NULL.
18247  TestInfo* GetMutableTestInfo(int i);
18248
18249  // Sets the should_run member.
18250  void set_should_run(bool should) { should_run_ = should; }
18251
18252  // Adds a TestInfo to this test case.  Will delete the TestInfo upon
18253  // destruction of the TestCase object.
18254  void AddTestInfo(TestInfo * test_info);
18255
18256  // Clears the results of all tests in this test case.
18257  void ClearResult();
18258
18259  // Clears the results of all tests in the given test case.
18260  static void ClearTestCaseResult(TestCase* test_case) {
18261    test_case->ClearResult();
18262  }
18263
18264  // Runs every test in this TestCase.
18265  void Run();
18266
18267  // Runs SetUpTestCase() for this TestCase.  This wrapper is needed
18268  // for catching exceptions thrown from SetUpTestCase().
18269  void RunSetUpTestCase() { (*set_up_tc_)(); }
18270
18271  // Runs TearDownTestCase() for this TestCase.  This wrapper is
18272  // needed for catching exceptions thrown from TearDownTestCase().
18273  void RunTearDownTestCase() { (*tear_down_tc_)(); }
18274
18275  // Returns true iff test passed.
18276  static bool TestPassed(const TestInfo* test_info) {
18277    return test_info->should_run() && test_info->result()->Passed();
18278  }
18279
18280  // Returns true iff test failed.
18281  static bool TestFailed(const TestInfo* test_info) {
18282    return test_info->should_run() && test_info->result()->Failed();
18283  }
18284
18285  // Returns true iff the test is disabled and will be reported in the XML
18286  // report.
18287  static bool TestReportableDisabled(const TestInfo* test_info) {
18288    return test_info->is_reportable() && test_info->is_disabled_;
18289  }
18290
18291  // Returns true iff test is disabled.
18292  static bool TestDisabled(const TestInfo* test_info) {
18293    return test_info->is_disabled_;
18294  }
18295
18296  // Returns true iff this test will appear in the XML report.
18297  static bool TestReportable(const TestInfo* test_info) {
18298    return test_info->is_reportable();
18299  }
18300
18301  // Returns true if the given test should run.
18302  static bool ShouldRunTest(const TestInfo* test_info) {
18303    return test_info->should_run();
18304  }
18305
18306  // Shuffles the tests in this test case.
18307  void ShuffleTests(internal::Random* random);
18308
18309  // Restores the test order to before the first shuffle.
18310  void UnshuffleTests();
18311
18312  // Name of the test case.
18313  std::string name_;
18314  // Name of the parameter type, or NULL if this is not a typed or a
18315  // type-parameterized test.
18316  const internal::scoped_ptr<const ::std::string> type_param_;
18317  // The vector of TestInfos in their original order.  It owns the
18318  // elements in the vector.
18319  std::vector<TestInfo*> test_info_list_;
18320  // Provides a level of indirection for the test list to allow easy
18321  // shuffling and restoring the test order.  The i-th element in this
18322  // vector is the index of the i-th test in the shuffled test list.
18323  std::vector<int> test_indices_;
18324  // Pointer to the function that sets up the test case.
18325  Test::SetUpTestCaseFunc set_up_tc_;
18326  // Pointer to the function that tears down the test case.
18327  Test::TearDownTestCaseFunc tear_down_tc_;
18328  // True iff any test in this test case should run.
18329  bool should_run_;
18330  // Elapsed time, in milliseconds.
18331  TimeInMillis elapsed_time_;
18332  // Holds test properties recorded during execution of SetUpTestCase and
18333  // TearDownTestCase.
18334  TestResult ad_hoc_test_result_;
18335
18336  // We disallow copying TestCases.
18337  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
18338};
18339
18340// An Environment object is capable of setting up and tearing down an
18341// environment.  The user should subclass this to define his own
18342// environment(s).
18343//
18344// An Environment object does the set-up and tear-down in virtual
18345// methods SetUp() and TearDown() instead of the constructor and the
18346// destructor, as:
18347//
18348//   1. You cannot safely throw from a destructor.  This is a problem
18349//      as in some cases Google Test is used where exceptions are enabled, and
18350//      we may want to implement ASSERT_* using exceptions where they are
18351//      available.
18352//   2. You cannot use ASSERT_* directly in a constructor or
18353//      destructor.
18354class Environment {
18355 public:
18356  // The d'tor is virtual as we need to subclass Environment.
18357  virtual ~Environment() {}
18358
18359  // Override this to define how to set up the environment.
18360  virtual void SetUp() {}
18361
18362  // Override this to define how to tear down the environment.
18363  virtual void TearDown() {}
18364 private:
18365  // If you see an error about overriding the following function or
18366  // about it being private, you have mis-spelled SetUp() as Setup().
18367  struct Setup_should_be_spelled_SetUp {};
18368  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
18369};
18370
18371// The interface for tracing execution of tests. The methods are organized in
18372// the order the corresponding events are fired.
18373class TestEventListener {
18374 public:
18375  virtual ~TestEventListener() {}
18376
18377  // Fired before any test activity starts.
18378  virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
18379
18380  // Fired before each iteration of tests starts.  There may be more than
18381  // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
18382  // index, starting from 0.
18383  virtual void OnTestIterationStart(const UnitTest& unit_test,
18384                                    int iteration) = 0;
18385
18386  // Fired before environment set-up for each iteration of tests starts.
18387  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
18388
18389  // Fired after environment set-up for each iteration of tests ends.
18390  virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
18391
18392  // Fired before the test case starts.
18393  virtual void OnTestCaseStart(const TestCase& test_case) = 0;
18394
18395  // Fired before the test starts.
18396  virtual void OnTestStart(const TestInfo& test_info) = 0;
18397
18398  // Fired after a failed assertion or a SUCCEED() invocation.
18399  virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
18400
18401  // Fired after the test ends.
18402  virtual void OnTestEnd(const TestInfo& test_info) = 0;
18403
18404  // Fired after the test case ends.
18405  virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
18406
18407  // Fired before environment tear-down for each iteration of tests starts.
18408  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
18409
18410  // Fired after environment tear-down for each iteration of tests ends.
18411  virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
18412
18413  // Fired after each iteration of tests finishes.
18414  virtual void OnTestIterationEnd(const UnitTest& unit_test,
18415                                  int iteration) = 0;
18416
18417  // Fired after all test activities have ended.
18418  virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
18419};
18420
18421// The convenience class for users who need to override just one or two
18422// methods and are not concerned that a possible change to a signature of
18423// the methods they override will not be caught during the build.  For
18424// comments about each method please see the definition of TestEventListener
18425// above.
18426class EmptyTestEventListener : public TestEventListener {
18427 public:
18428  virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
18429  virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
18430                                    int /*iteration*/) {}
18431  virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
18432  virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
18433  virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
18434  virtual void OnTestStart(const TestInfo& /*test_info*/) {}
18435  virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
18436  virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
18437  virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
18438  virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
18439  virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
18440  virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
18441                                  int /*iteration*/) {}
18442  virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
18443};
18444
18445// TestEventListeners lets users add listeners to track events in Google Test.
18446class GTEST_API_ TestEventListeners {
18447 public:
18448  TestEventListeners();
18449  ~TestEventListeners();
18450
18451  // Appends an event listener to the end of the list. Google Test assumes
18452  // the ownership of the listener (i.e. it will delete the listener when
18453  // the test program finishes).
18454  void Append(TestEventListener* listener);
18455
18456  // Removes the given event listener from the list and returns it.  It then
18457  // becomes the caller's responsibility to delete the listener. Returns
18458  // NULL if the listener is not found in the list.
18459  TestEventListener* Release(TestEventListener* listener);
18460
18461  // Returns the standard listener responsible for the default console
18462  // output.  Can be removed from the listeners list to shut down default
18463  // console output.  Note that removing this object from the listener list
18464  // with Release transfers its ownership to the caller and makes this
18465  // function return NULL the next time.
18466  TestEventListener* default_result_printer() const {
18467    return default_result_printer_;
18468  }
18469
18470  // Returns the standard listener responsible for the default XML output
18471  // controlled by the --gtest_output=xml flag.  Can be removed from the
18472  // listeners list by users who want to shut down the default XML output
18473  // controlled by this flag and substitute it with custom one.  Note that
18474  // removing this object from the listener list with Release transfers its
18475  // ownership to the caller and makes this function return NULL the next
18476  // time.
18477  TestEventListener* default_xml_generator() const {
18478    return default_xml_generator_;
18479  }
18480
18481 private:
18482  friend class TestCase;
18483  friend class TestInfo;
18484  friend class internal::DefaultGlobalTestPartResultReporter;
18485  friend class internal::NoExecDeathTest;
18486  friend class internal::TestEventListenersAccessor;
18487  friend class internal::UnitTestImpl;
18488
18489  // Returns repeater that broadcasts the TestEventListener events to all
18490  // subscribers.
18491  TestEventListener* repeater();
18492
18493  // Sets the default_result_printer attribute to the provided listener.
18494  // The listener is also added to the listener list and previous
18495  // default_result_printer is removed from it and deleted. The listener can
18496  // also be NULL in which case it will not be added to the list. Does
18497  // nothing if the previous and the current listener objects are the same.
18498  void SetDefaultResultPrinter(TestEventListener* listener);
18499
18500  // Sets the default_xml_generator attribute to the provided listener.  The
18501  // listener is also added to the listener list and previous
18502  // default_xml_generator is removed from it and deleted. The listener can
18503  // also be NULL in which case it will not be added to the list. Does
18504  // nothing if the previous and the current listener objects are the same.
18505  void SetDefaultXmlGenerator(TestEventListener* listener);
18506
18507  // Controls whether events will be forwarded by the repeater to the
18508  // listeners in the list.
18509  bool EventForwardingEnabled() const;
18510  void SuppressEventForwarding();
18511
18512  // The actual list of listeners.
18513  internal::TestEventRepeater* repeater_;
18514  // Listener responsible for the standard result output.
18515  TestEventListener* default_result_printer_;
18516  // Listener responsible for the creation of the XML output file.
18517  TestEventListener* default_xml_generator_;
18518
18519  // We disallow copying TestEventListeners.
18520  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
18521};
18522
18523// A UnitTest consists of a vector of TestCases.
18524//
18525// This is a singleton class.  The only instance of UnitTest is
18526// created when UnitTest::GetInstance() is first called.  This
18527// instance is never deleted.
18528//
18529// UnitTest is not copyable.
18530//
18531// This class is thread-safe as long as the methods are called
18532// according to their specification.
18533class GTEST_API_ UnitTest {
18534 public:
18535  // Gets the singleton UnitTest object.  The first time this method
18536  // is called, a UnitTest object is constructed and returned.
18537  // Consecutive calls will return the same object.
18538  static UnitTest* GetInstance();
18539
18540  // Runs all tests in this UnitTest object and prints the result.
18541  // Returns 0 if successful, or 1 otherwise.
18542  //
18543  // This method can only be called from the main thread.
18544  //
18545  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18546  int Run() GTEST_MUST_USE_RESULT_;
18547
18548  // Returns the working directory when the first TEST() or TEST_F()
18549  // was executed.  The UnitTest object owns the string.
18550  const char* original_working_dir() const;
18551
18552  // Returns the TestCase object for the test that's currently running,
18553  // or NULL if no test is running.
18554  const TestCase* current_test_case() const
18555      GTEST_LOCK_EXCLUDED_(mutex_);
18556
18557  // Returns the TestInfo object for the test that's currently running,
18558  // or NULL if no test is running.
18559  const TestInfo* current_test_info() const
18560      GTEST_LOCK_EXCLUDED_(mutex_);
18561
18562  // Returns the random seed used at the start of the current test run.
18563  int random_seed() const;
18564
18565#if GTEST_HAS_PARAM_TEST
18566  // Returns the ParameterizedTestCaseRegistry object used to keep track of
18567  // value-parameterized tests and instantiate and register them.
18568  //
18569  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18570  internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
18571      GTEST_LOCK_EXCLUDED_(mutex_);
18572#endif  // GTEST_HAS_PARAM_TEST
18573
18574  // Gets the number of successful test cases.
18575  int successful_test_case_count() const;
18576
18577  // Gets the number of failed test cases.
18578  int failed_test_case_count() const;
18579
18580  // Gets the number of all test cases.
18581  int total_test_case_count() const;
18582
18583  // Gets the number of all test cases that contain at least one test
18584  // that should run.
18585  int test_case_to_run_count() const;
18586
18587  // Gets the number of successful tests.
18588  int successful_test_count() const;
18589
18590  // Gets the number of failed tests.
18591  int failed_test_count() const;
18592
18593  // Gets the number of disabled tests that will be reported in the XML report.
18594  int reportable_disabled_test_count() const;
18595
18596  // Gets the number of disabled tests.
18597  int disabled_test_count() const;
18598
18599  // Gets the number of tests to be printed in the XML report.
18600  int reportable_test_count() const;
18601
18602  // Gets the number of all tests.
18603  int total_test_count() const;
18604
18605  // Gets the number of tests that should run.
18606  int test_to_run_count() const;
18607
18608  // Gets the time of the test program start, in ms from the start of the
18609  // UNIX epoch.
18610  TimeInMillis start_timestamp() const;
18611
18612  // Gets the elapsed time, in milliseconds.
18613  TimeInMillis elapsed_time() const;
18614
18615  // Returns true iff the unit test passed (i.e. all test cases passed).
18616  bool Passed() const;
18617
18618  // Returns true iff the unit test failed (i.e. some test case failed
18619  // or something outside of all tests failed).
18620  bool Failed() const;
18621
18622  // Gets the i-th test case among all the test cases. i can range from 0 to
18623  // total_test_case_count() - 1. If i is not in that range, returns NULL.
18624  const TestCase* GetTestCase(int i) const;
18625
18626  // Returns the TestResult containing information on test failures and
18627  // properties logged outside of individual test cases.
18628  const TestResult& ad_hoc_test_result() const;
18629
18630  // Returns the list of event listeners that can be used to track events
18631  // inside Google Test.
18632  TestEventListeners& listeners();
18633
18634 private:
18635  // Registers and returns a global test environment.  When a test
18636  // program is run, all global test environments will be set-up in
18637  // the order they were registered.  After all tests in the program
18638  // have finished, all global test environments will be torn-down in
18639  // the *reverse* order they were registered.
18640  //
18641  // The UnitTest object takes ownership of the given environment.
18642  //
18643  // This method can only be called from the main thread.
18644  Environment* AddEnvironment(Environment* env);
18645
18646  // Adds a TestPartResult to the current TestResult object.  All
18647  // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
18648  // eventually call this to report their results.  The user code
18649  // should use the assertion macros instead of calling this directly.
18650  void AddTestPartResult(TestPartResult::Type result_type,
18651                         const char* file_name,
18652                         int line_number,
18653                         const std::string& message,
18654                         const std::string& os_stack_trace)
18655      GTEST_LOCK_EXCLUDED_(mutex_);
18656
18657  // Adds a TestProperty to the current TestResult object when invoked from
18658  // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
18659  // from SetUpTestCase or TearDownTestCase, or to the global property set
18660  // when invoked elsewhere.  If the result already contains a property with
18661  // the same key, the value will be updated.
18662  void RecordProperty(const std::string& key, const std::string& value);
18663
18664  // Gets the i-th test case among all the test cases. i can range from 0 to
18665  // total_test_case_count() - 1. If i is not in that range, returns NULL.
18666  TestCase* GetMutableTestCase(int i);
18667
18668  // Accessors for the implementation object.
18669  internal::UnitTestImpl* impl() { return impl_; }
18670  const internal::UnitTestImpl* impl() const { return impl_; }
18671
18672  // These classes and funcions are friends as they need to access private
18673  // members of UnitTest.
18674  friend class Test;
18675  friend class internal::AssertHelper;
18676  friend class internal::ScopedTrace;
18677  friend class internal::StreamingListenerTest;
18678  friend class internal::UnitTestRecordPropertyTestHelper;
18679  friend Environment* AddGlobalTestEnvironment(Environment* env);
18680  friend internal::UnitTestImpl* internal::GetUnitTestImpl();
18681  friend void internal::ReportFailureInUnknownLocation(
18682      TestPartResult::Type result_type,
18683      const std::string& message);
18684
18685  // Creates an empty UnitTest.
18686  UnitTest();
18687
18688  // D'tor
18689  virtual ~UnitTest();
18690
18691  // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
18692  // Google Test trace stack.
18693  void PushGTestTrace(const internal::TraceInfo& trace)
18694      GTEST_LOCK_EXCLUDED_(mutex_);
18695
18696  // Pops a trace from the per-thread Google Test trace stack.
18697  void PopGTestTrace()
18698      GTEST_LOCK_EXCLUDED_(mutex_);
18699
18700  // Protects mutable state in *impl_.  This is mutable as some const
18701  // methods need to lock it too.
18702  mutable internal::Mutex mutex_;
18703
18704  // Opaque implementation object.  This field is never changed once
18705  // the object is constructed.  We don't mark it as const here, as
18706  // doing so will cause a warning in the constructor of UnitTest.
18707  // Mutable state in *impl_ is protected by mutex_.
18708  internal::UnitTestImpl* impl_;
18709
18710  // We disallow copying UnitTest.
18711  GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
18712};
18713
18714// A convenient wrapper for adding an environment for the test
18715// program.
18716//
18717// You should call this before RUN_ALL_TESTS() is called, probably in
18718// main().  If you use gtest_main, you need to call this before main()
18719// starts for it to take effect.  For example, you can define a global
18720// variable like this:
18721//
18722//   testing::Environment* const foo_env =
18723//       testing::AddGlobalTestEnvironment(new FooEnvironment);
18724//
18725// However, we strongly recommend you to write your own main() and
18726// call AddGlobalTestEnvironment() there, as relying on initialization
18727// of global variables makes the code harder to read and may cause
18728// problems when you register multiple environments from different
18729// translation units and the environments have dependencies among them
18730// (remember that the compiler doesn't guarantee the order in which
18731// global variables from different translation units are initialized).
18732inline Environment* AddGlobalTestEnvironment(Environment* env) {
18733  return UnitTest::GetInstance()->AddEnvironment(env);
18734}
18735
18736// Initializes Google Test.  This must be called before calling
18737// RUN_ALL_TESTS().  In particular, it parses a command line for the
18738// flags that Google Test recognizes.  Whenever a Google Test flag is
18739// seen, it is removed from argv, and *argc is decremented.
18740//
18741// No value is returned.  Instead, the Google Test flag variables are
18742// updated.
18743//
18744// Calling the function for the second time has no user-visible effect.
18745GTEST_API_ void InitGoogleTest(int* argc, char** argv);
18746
18747// This overloaded version can be used in Windows programs compiled in
18748// UNICODE mode.
18749GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
18750
18751namespace internal {
18752
18753// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
18754// value of type ToPrint that is an operand of a comparison assertion
18755// (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in
18756// the comparison, and is used to help determine the best way to
18757// format the value.  In particular, when the value is a C string
18758// (char pointer) and the other operand is an STL string object, we
18759// want to format the C string as a string, since we know it is
18760// compared by value with the string object.  If the value is a char
18761// pointer but the other operand is not an STL string object, we don't
18762// know whether the pointer is supposed to point to a NUL-terminated
18763// string, and thus want to print it as a pointer to be safe.
18764//
18765// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18766
18767// The default case.
18768template <typename ToPrint, typename OtherOperand>
18769class FormatForComparison {
18770 public:
18771  static ::std::string Format(const ToPrint& value) {
18772    return ::testing::PrintToString(value);
18773  }
18774};
18775
18776// Array.
18777template <typename ToPrint, size_t N, typename OtherOperand>
18778class FormatForComparison<ToPrint[N], OtherOperand> {
18779 public:
18780  static ::std::string Format(const ToPrint* value) {
18781    return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
18782  }
18783};
18784
18785// By default, print C string as pointers to be safe, as we don't know
18786// whether they actually point to a NUL-terminated string.
18787
18788#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \
18789  template <typename OtherOperand>                                      \
18790  class FormatForComparison<CharType*, OtherOperand> {                  \
18791   public:                                                              \
18792    static ::std::string Format(CharType* value) {                      \
18793      return ::testing::PrintToString(static_cast<const void*>(value)); \
18794    }                                                                   \
18795  }
18796
18797GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
18798GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
18799GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
18800GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
18801
18802#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
18803
18804// If a C string is compared with an STL string object, we know it's meant
18805// to point to a NUL-terminated string, and thus can print it as a string.
18806
18807#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
18808  template <>                                                           \
18809  class FormatForComparison<CharType*, OtherStringType> {               \
18810   public:                                                              \
18811    static ::std::string Format(CharType* value) {                      \
18812      return ::testing::PrintToString(value);                           \
18813    }                                                                   \
18814  }
18815
18816GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
18817GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
18818
18819#if GTEST_HAS_GLOBAL_STRING
18820GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
18821GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
18822#endif
18823
18824#if GTEST_HAS_GLOBAL_WSTRING
18825GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
18826GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
18827#endif
18828
18829#if GTEST_HAS_STD_WSTRING
18830GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
18831GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
18832#endif
18833
18834#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
18835
18836// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
18837// operand to be used in a failure message.  The type (but not value)
18838// of the other operand may affect the format.  This allows us to
18839// print a char* as a raw pointer when it is compared against another
18840// char* or void*, and print it as a C string when it is compared
18841// against an std::string object, for example.
18842//
18843// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18844template <typename T1, typename T2>
18845std::string FormatForComparisonFailureMessage(
18846    const T1& value, const T2& /* other_operand */) {
18847  return FormatForComparison<T1, T2>::Format(value);
18848}
18849
18850// The helper function for {ASSERT|EXPECT}_EQ.
18851template <typename T1, typename T2>
18852AssertionResult CmpHelperEQ(const char* expected_expression,
18853                            const char* actual_expression,
18854                            const T1& expected,
18855                            const T2& actual) {
18856#ifdef _MSC_VER
18857# pragma warning(push)          // Saves the current warning state.
18858# pragma warning(disable:4389)  // Temporarily disables warning on
18859                                // signed/unsigned mismatch.
18860#endif
18861
18862  if (expected == actual) {
18863    return AssertionSuccess();
18864  }
18865
18866#ifdef _MSC_VER
18867# pragma warning(pop)          // Restores the warning state.
18868#endif
18869
18870  return EqFailure(expected_expression,
18871                   actual_expression,
18872                   FormatForComparisonFailureMessage(expected, actual),
18873                   FormatForComparisonFailureMessage(actual, expected),
18874                   false);
18875}
18876
18877// With this overloaded version, we allow anonymous enums to be used
18878// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
18879// can be implicitly cast to BiggestInt.
18880GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
18881                                       const char* actual_expression,
18882                                       BiggestInt expected,
18883                                       BiggestInt actual);
18884
18885// The helper class for {ASSERT|EXPECT}_EQ.  The template argument
18886// lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
18887// is a null pointer literal.  The following default implementation is
18888// for lhs_is_null_literal being false.
18889template <bool lhs_is_null_literal>
18890class EqHelper {
18891 public:
18892  // This templatized version is for the general case.
18893  template <typename T1, typename T2>
18894  static AssertionResult Compare(const char* expected_expression,
18895                                 const char* actual_expression,
18896                                 const T1& expected,
18897                                 const T2& actual) {
18898    return CmpHelperEQ(expected_expression, actual_expression, expected,
18899                       actual);
18900  }
18901
18902  // With this overloaded version, we allow anonymous enums to be used
18903  // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
18904  // enums can be implicitly cast to BiggestInt.
18905  //
18906  // Even though its body looks the same as the above version, we
18907  // cannot merge the two, as it will make anonymous enums unhappy.
18908  static AssertionResult Compare(const char* expected_expression,
18909                                 const char* actual_expression,
18910                                 BiggestInt expected,
18911                                 BiggestInt actual) {
18912    return CmpHelperEQ(expected_expression, actual_expression, expected,
18913                       actual);
18914  }
18915};
18916
18917// This specialization is used when the first argument to ASSERT_EQ()
18918// is a null pointer literal, like NULL, false, or 0.
18919template <>
18920class EqHelper<true> {
18921 public:
18922  // We define two overloaded versions of Compare().  The first
18923  // version will be picked when the second argument to ASSERT_EQ() is
18924  // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
18925  // EXPECT_EQ(false, a_bool).
18926  template <typename T1, typename T2>
18927  static AssertionResult Compare(
18928      const char* expected_expression,
18929      const char* actual_expression,
18930      const T1& expected,
18931      const T2& actual,
18932      // The following line prevents this overload from being considered if T2
18933      // is not a pointer type.  We need this because ASSERT_EQ(NULL, my_ptr)
18934      // expands to Compare("", "", NULL, my_ptr), which requires a conversion
18935      // to match the Secret* in the other overload, which would otherwise make
18936      // this template match better.
18937      typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
18938    return CmpHelperEQ(expected_expression, actual_expression, expected,
18939                       actual);
18940  }
18941
18942  // This version will be picked when the second argument to ASSERT_EQ() is a
18943  // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
18944  template <typename T>
18945  static AssertionResult Compare(
18946      const char* expected_expression,
18947      const char* actual_expression,
18948      // We used to have a second template parameter instead of Secret*.  That
18949      // template parameter would deduce to 'long', making this a better match
18950      // than the first overload even without the first overload's EnableIf.
18951      // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
18952      // non-pointer argument" (even a deduced integral argument), so the old
18953      // implementation caused warnings in user code.
18954      Secret* /* expected (NULL) */,
18955      T* actual) {
18956    // We already know that 'expected' is a null pointer.
18957    return CmpHelperEQ(expected_expression, actual_expression,
18958                       static_cast<T*>(NULL), actual);
18959  }
18960};
18961
18962// A macro for implementing the helper functions needed to implement
18963// ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste
18964// of similar code.
18965//
18966// For each templatized helper function, we also define an overloaded
18967// version for BiggestInt in order to reduce code bloat and allow
18968// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
18969// with gcc 4.
18970//
18971// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18972#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
18973template <typename T1, typename T2>\
18974AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
18975                                   const T1& val1, const T2& val2) {\
18976  if (val1 op val2) {\
18977    return AssertionSuccess();\
18978  } else {\
18979    return AssertionFailure() \
18980        << "Expected: (" << expr1 << ") " #op " (" << expr2\
18981        << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
18982        << " vs " << FormatForComparisonFailureMessage(val2, val1);\
18983  }\
18984}\
18985GTEST_API_ AssertionResult CmpHelper##op_name(\
18986    const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
18987
18988// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18989
18990// Implements the helper function for {ASSERT|EXPECT}_NE
18991GTEST_IMPL_CMP_HELPER_(NE, !=);
18992// Implements the helper function for {ASSERT|EXPECT}_LE
18993GTEST_IMPL_CMP_HELPER_(LE, <=);
18994// Implements the helper function for {ASSERT|EXPECT}_LT
18995GTEST_IMPL_CMP_HELPER_(LT, <);
18996// Implements the helper function for {ASSERT|EXPECT}_GE
18997GTEST_IMPL_CMP_HELPER_(GE, >=);
18998// Implements the helper function for {ASSERT|EXPECT}_GT
18999GTEST_IMPL_CMP_HELPER_(GT, >);
19000
19001#undef GTEST_IMPL_CMP_HELPER_
19002
19003// The helper function for {ASSERT|EXPECT}_STREQ.
19004//
19005// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19006GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19007                                          const char* actual_expression,
19008                                          const char* expected,
19009                                          const char* actual);
19010
19011// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
19012//
19013// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19014GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
19015                                              const char* actual_expression,
19016                                              const char* expected,
19017                                              const char* actual);
19018
19019// The helper function for {ASSERT|EXPECT}_STRNE.
19020//
19021// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19022GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19023                                          const char* s2_expression,
19024                                          const char* s1,
19025                                          const char* s2);
19026
19027// The helper function for {ASSERT|EXPECT}_STRCASENE.
19028//
19029// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19030GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
19031                                              const char* s2_expression,
19032                                              const char* s1,
19033                                              const char* s2);
19034
19035
19036// Helper function for *_STREQ on wide strings.
19037//
19038// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19039GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19040                                          const char* actual_expression,
19041                                          const wchar_t* expected,
19042                                          const wchar_t* actual);
19043
19044// Helper function for *_STRNE on wide strings.
19045//
19046// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19047GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19048                                          const char* s2_expression,
19049                                          const wchar_t* s1,
19050                                          const wchar_t* s2);
19051
19052}  // namespace internal
19053
19054// IsSubstring() and IsNotSubstring() are intended to be used as the
19055// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
19056// themselves.  They check whether needle is a substring of haystack
19057// (NULL is considered a substring of itself only), and return an
19058// appropriate error message when they fail.
19059//
19060// The {needle,haystack}_expr arguments are the stringified
19061// expressions that generated the two real arguments.
19062GTEST_API_ AssertionResult IsSubstring(
19063    const char* needle_expr, const char* haystack_expr,
19064    const char* needle, const char* haystack);
19065GTEST_API_ AssertionResult IsSubstring(
19066    const char* needle_expr, const char* haystack_expr,
19067    const wchar_t* needle, const wchar_t* haystack);
19068GTEST_API_ AssertionResult IsNotSubstring(
19069    const char* needle_expr, const char* haystack_expr,
19070    const char* needle, const char* haystack);
19071GTEST_API_ AssertionResult IsNotSubstring(
19072    const char* needle_expr, const char* haystack_expr,
19073    const wchar_t* needle, const wchar_t* haystack);
19074GTEST_API_ AssertionResult IsSubstring(
19075    const char* needle_expr, const char* haystack_expr,
19076    const ::std::string& needle, const ::std::string& haystack);
19077GTEST_API_ AssertionResult IsNotSubstring(
19078    const char* needle_expr, const char* haystack_expr,
19079    const ::std::string& needle, const ::std::string& haystack);
19080
19081#if GTEST_HAS_STD_WSTRING
19082GTEST_API_ AssertionResult IsSubstring(
19083    const char* needle_expr, const char* haystack_expr,
19084    const ::std::wstring& needle, const ::std::wstring& haystack);
19085GTEST_API_ AssertionResult IsNotSubstring(
19086    const char* needle_expr, const char* haystack_expr,
19087    const ::std::wstring& needle, const ::std::wstring& haystack);
19088#endif  // GTEST_HAS_STD_WSTRING
19089
19090namespace internal {
19091
19092// Helper template function for comparing floating-points.
19093//
19094// Template parameter:
19095//
19096//   RawType: the raw floating-point type (either float or double)
19097//
19098// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19099template <typename RawType>
19100AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
19101                                         const char* actual_expression,
19102                                         RawType expected,
19103                                         RawType actual) {
19104  const FloatingPoint<RawType> lhs(expected), rhs(actual);
19105
19106  if (lhs.AlmostEquals(rhs)) {
19107    return AssertionSuccess();
19108  }
19109
19110  ::std::stringstream expected_ss;
19111  expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19112              << expected;
19113
19114  ::std::stringstream actual_ss;
19115  actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19116            << actual;
19117
19118  return EqFailure(expected_expression,
19119                   actual_expression,
19120                   StringStreamToString(&expected_ss),
19121                   StringStreamToString(&actual_ss),
19122                   false);
19123}
19124
19125// Helper function for implementing ASSERT_NEAR.
19126//
19127// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19128GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
19129                                                const char* expr2,
19130                                                const char* abs_error_expr,
19131                                                double val1,
19132                                                double val2,
19133                                                double abs_error);
19134
19135// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19136// A class that enables one to stream messages to assertion macros
19137class GTEST_API_ AssertHelper {
19138 public:
19139  // Constructor.
19140  AssertHelper(TestPartResult::Type type,
19141               const char* file,
19142               int line,
19143               const char* message);
19144  ~AssertHelper();
19145
19146  // Message assignment is a semantic trick to enable assertion
19147  // streaming; see the GTEST_MESSAGE_ macro below.
19148  void operator=(const Message& message) const;
19149
19150 private:
19151  // We put our data in a struct so that the size of the AssertHelper class can
19152  // be as small as possible.  This is important because gcc is incapable of
19153  // re-using stack space even for temporary variables, so every EXPECT_EQ
19154  // reserves stack space for another AssertHelper.
19155  struct AssertHelperData {
19156    AssertHelperData(TestPartResult::Type t,
19157                     const char* srcfile,
19158                     int line_num,
19159                     const char* msg)
19160        : type(t), file(srcfile), line(line_num), message(msg) { }
19161
19162    TestPartResult::Type const type;
19163    const char* const file;
19164    int const line;
19165    std::string const message;
19166
19167   private:
19168    GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
19169  };
19170
19171  AssertHelperData* const data_;
19172
19173  GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
19174};
19175
19176}  // namespace internal
19177
19178#if GTEST_HAS_PARAM_TEST
19179// The pure interface class that all value-parameterized tests inherit from.
19180// A value-parameterized class must inherit from both ::testing::Test and
19181// ::testing::WithParamInterface. In most cases that just means inheriting
19182// from ::testing::TestWithParam, but more complicated test hierarchies
19183// may need to inherit from Test and WithParamInterface at different levels.
19184//
19185// This interface has support for accessing the test parameter value via
19186// the GetParam() method.
19187//
19188// Use it with one of the parameter generator defining functions, like Range(),
19189// Values(), ValuesIn(), Bool(), and Combine().
19190//
19191// class FooTest : public ::testing::TestWithParam<int> {
19192//  protected:
19193//   FooTest() {
19194//     // Can use GetParam() here.
19195//   }
19196//   virtual ~FooTest() {
19197//     // Can use GetParam() here.
19198//   }
19199//   virtual void SetUp() {
19200//     // Can use GetParam() here.
19201//   }
19202//   virtual void TearDown {
19203//     // Can use GetParam() here.
19204//   }
19205// };
19206// TEST_P(FooTest, DoesBar) {
19207//   // Can use GetParam() method here.
19208//   Foo foo;
19209//   ASSERT_TRUE(foo.DoesBar(GetParam()));
19210// }
19211// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
19212
19213template <typename T>
19214class WithParamInterface {
19215 public:
19216  typedef T ParamType;
19217  virtual ~WithParamInterface() {}
19218
19219  // The current parameter value. Is also available in the test fixture's
19220  // constructor. This member function is non-static, even though it only
19221  // references static data, to reduce the opportunity for incorrect uses
19222  // like writing 'WithParamInterface<bool>::GetParam()' for a test that
19223  // uses a fixture whose parameter type is int.
19224  const ParamType& GetParam() const {
19225    GTEST_CHECK_(parameter_ != NULL)
19226        << "GetParam() can only be called inside a value-parameterized test "
19227        << "-- did you intend to write TEST_P instead of TEST_F?";
19228    return *parameter_;
19229  }
19230
19231 private:
19232  // Sets parameter value. The caller is responsible for making sure the value
19233  // remains alive and unchanged throughout the current test.
19234  static void SetParam(const ParamType* parameter) {
19235    parameter_ = parameter;
19236  }
19237
19238  // Static value used for accessing parameter during a test lifetime.
19239  static const ParamType* parameter_;
19240
19241  // TestClass must be a subclass of WithParamInterface<T> and Test.
19242  template <class TestClass> friend class internal::ParameterizedTestFactory;
19243};
19244
19245template <typename T>
19246const T* WithParamInterface<T>::parameter_ = NULL;
19247
19248// Most value-parameterized classes can ignore the existence of
19249// WithParamInterface, and can just inherit from ::testing::TestWithParam.
19250
19251template <typename T>
19252class TestWithParam : public Test, public WithParamInterface<T> {
19253};
19254
19255#endif  // GTEST_HAS_PARAM_TEST
19256
19257// Macros for indicating success/failure in test code.
19258
19259// ADD_FAILURE unconditionally adds a failure to the current test.
19260// SUCCEED generates a success - it doesn't automatically make the
19261// current test successful, as a test is only successful when it has
19262// no failure.
19263//
19264// EXPECT_* verifies that a certain condition is satisfied.  If not,
19265// it behaves like ADD_FAILURE.  In particular:
19266//
19267//   EXPECT_TRUE  verifies that a Boolean condition is true.
19268//   EXPECT_FALSE verifies that a Boolean condition is false.
19269//
19270// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
19271// that they will also abort the current function on failure.  People
19272// usually want the fail-fast behavior of FAIL and ASSERT_*, but those
19273// writing data-driven tests often find themselves using ADD_FAILURE
19274// and EXPECT_* more.
19275
19276// Generates a nonfatal failure with a generic message.
19277#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
19278
19279// Generates a nonfatal failure at the given source file location with
19280// a generic message.
19281#define ADD_FAILURE_AT(file, line) \
19282  GTEST_MESSAGE_AT_(file, line, "Failed", \
19283                    ::testing::TestPartResult::kNonFatalFailure)
19284
19285// Generates a fatal failure with a generic message.
19286#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
19287
19288// Define this macro to 1 to omit the definition of FAIL(), which is a
19289// generic name and clashes with some other libraries.
19290#if !GTEST_DONT_DEFINE_FAIL
19291# define FAIL() GTEST_FAIL()
19292#endif
19293
19294// Generates a success with a generic message.
19295#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
19296
19297// Define this macro to 1 to omit the definition of SUCCEED(), which
19298// is a generic name and clashes with some other libraries.
19299#if !GTEST_DONT_DEFINE_SUCCEED
19300# define SUCCEED() GTEST_SUCCEED()
19301#endif
19302
19303// Macros for testing exceptions.
19304//
19305//    * {ASSERT|EXPECT}_THROW(statement, expected_exception):
19306//         Tests that the statement throws the expected exception.
19307//    * {ASSERT|EXPECT}_NO_THROW(statement):
19308//         Tests that the statement doesn't throw any exception.
19309//    * {ASSERT|EXPECT}_ANY_THROW(statement):
19310//         Tests that the statement throws an exception.
19311
19312#define EXPECT_THROW(statement, expected_exception) \
19313  GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
19314#define EXPECT_NO_THROW(statement) \
19315  GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19316#define EXPECT_ANY_THROW(statement) \
19317  GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19318#define ASSERT_THROW(statement, expected_exception) \
19319  GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
19320#define ASSERT_NO_THROW(statement) \
19321  GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
19322#define ASSERT_ANY_THROW(statement) \
19323  GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
19324
19325// Boolean assertions. Condition can be either a Boolean expression or an
19326// AssertionResult. For more information on how to use AssertionResult with
19327// these macros see comments on that class.
19328#define EXPECT_TRUE(condition) \
19329  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19330                      GTEST_NONFATAL_FAILURE_)
19331#define EXPECT_FALSE(condition) \
19332  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19333                      GTEST_NONFATAL_FAILURE_)
19334#define ASSERT_TRUE(condition) \
19335  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19336                      GTEST_FATAL_FAILURE_)
19337#define ASSERT_FALSE(condition) \
19338  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19339                      GTEST_FATAL_FAILURE_)
19340
19341// Includes the auto-generated header that implements a family of
19342// generic predicate assertion macros.
19343// Copyright 2006, Google Inc.
19344// All rights reserved.
19345//
19346// Redistribution and use in source and binary forms, with or without
19347// modification, are permitted provided that the following conditions are
19348// met:
19349//
19350//     * Redistributions of source code must retain the above copyright
19351// notice, this list of conditions and the following disclaimer.
19352//     * Redistributions in binary form must reproduce the above
19353// copyright notice, this list of conditions and the following disclaimer
19354// in the documentation and/or other materials provided with the
19355// distribution.
19356//     * Neither the name of Google Inc. nor the names of its
19357// contributors may be used to endorse or promote products derived from
19358// this software without specific prior written permission.
19359//
19360// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19361// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19362// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19363// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19364// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19365// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19366// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19367// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19368// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19369// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19370// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19371
19372// This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
19373// 'gen_gtest_pred_impl.py 5'.  DO NOT EDIT BY HAND!
19374//
19375// Implements a family of generic predicate assertion macros.
19376
19377#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19378#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19379
19380// Makes sure this header is not included before gtest.h.
19381#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
19382# error Do not include gtest_pred_impl.h directly.  Include gtest.h instead.
19383#endif  // GTEST_INCLUDE_GTEST_GTEST_H_
19384
19385// This header implements a family of generic predicate assertion
19386// macros:
19387//
19388//   ASSERT_PRED_FORMAT1(pred_format, v1)
19389//   ASSERT_PRED_FORMAT2(pred_format, v1, v2)
19390//   ...
19391//
19392// where pred_format is a function or functor that takes n (in the
19393// case of ASSERT_PRED_FORMATn) values and their source expression
19394// text, and returns a testing::AssertionResult.  See the definition
19395// of ASSERT_EQ in gtest.h for an example.
19396//
19397// If you don't care about formatting, you can use the more
19398// restrictive version:
19399//
19400//   ASSERT_PRED1(pred, v1)
19401//   ASSERT_PRED2(pred, v1, v2)
19402//   ...
19403//
19404// where pred is an n-ary function or functor that returns bool,
19405// and the values v1, v2, ..., must support the << operator for
19406// streaming to std::ostream.
19407//
19408// We also define the EXPECT_* variations.
19409//
19410// For now we only support predicates whose arity is at most 5.
19411// Please email googletestframework@googlegroups.com if you need
19412// support for higher arities.
19413
19414// GTEST_ASSERT_ is the basic statement to which all of the assertions
19415// in this file reduce.  Don't use this in your code.
19416
19417#define GTEST_ASSERT_(expression, on_failure) \
19418  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
19419  if (const ::testing::AssertionResult gtest_ar = (expression)) \
19420    ; \
19421  else \
19422    on_failure(gtest_ar.failure_message())
19423
19424
19425// Helper function for implementing {EXPECT|ASSERT}_PRED1.  Don't use
19426// this in your code.
19427template <typename Pred,
19428          typename T1>
19429AssertionResult AssertPred1Helper(const char* pred_text,
19430                                  const char* e1,
19431                                  Pred pred,
19432                                  const T1& v1) {
19433  if (pred(v1)) return AssertionSuccess();
19434
19435  return AssertionFailure() << pred_text << "("
19436                            << e1 << ") evaluates to false, where"
19437                            << "\n" << e1 << " evaluates to " << v1;
19438}
19439
19440// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
19441// Don't use this in your code.
19442#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
19443  GTEST_ASSERT_(pred_format(#v1, v1), \
19444                on_failure)
19445
19446// Internal macro for implementing {EXPECT|ASSERT}_PRED1.  Don't use
19447// this in your code.
19448#define GTEST_PRED1_(pred, v1, on_failure)\
19449  GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
19450                                             #v1, \
19451                                             pred, \
19452                                             v1), on_failure)
19453
19454// Unary predicate assertion macros.
19455#define EXPECT_PRED_FORMAT1(pred_format, v1) \
19456  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
19457#define EXPECT_PRED1(pred, v1) \
19458  GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
19459#define ASSERT_PRED_FORMAT1(pred_format, v1) \
19460  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
19461#define ASSERT_PRED1(pred, v1) \
19462  GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
19463
19464
19465
19466// Helper function for implementing {EXPECT|ASSERT}_PRED2.  Don't use
19467// this in your code.
19468template <typename Pred,
19469          typename T1,
19470          typename T2>
19471AssertionResult AssertPred2Helper(const char* pred_text,
19472                                  const char* e1,
19473                                  const char* e2,
19474                                  Pred pred,
19475                                  const T1& v1,
19476                                  const T2& v2) {
19477  if (pred(v1, v2)) return AssertionSuccess();
19478
19479  return AssertionFailure() << pred_text << "("
19480                            << e1 << ", "
19481                            << e2 << ") evaluates to false, where"
19482                            << "\n" << e1 << " evaluates to " << v1
19483                            << "\n" << e2 << " evaluates to " << v2;
19484}
19485
19486// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
19487// Don't use this in your code.
19488#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
19489  GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
19490                on_failure)
19491
19492// Internal macro for implementing {EXPECT|ASSERT}_PRED2.  Don't use
19493// this in your code.
19494#define GTEST_PRED2_(pred, v1, v2, on_failure)\
19495  GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
19496                                             #v1, \
19497                                             #v2, \
19498                                             pred, \
19499                                             v1, \
19500                                             v2), on_failure)
19501
19502// Binary predicate assertion macros.
19503#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
19504  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
19505#define EXPECT_PRED2(pred, v1, v2) \
19506  GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
19507#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
19508  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
19509#define ASSERT_PRED2(pred, v1, v2) \
19510  GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
19511
19512
19513
19514// Helper function for implementing {EXPECT|ASSERT}_PRED3.  Don't use
19515// this in your code.
19516template <typename Pred,
19517          typename T1,
19518          typename T2,
19519          typename T3>
19520AssertionResult AssertPred3Helper(const char* pred_text,
19521                                  const char* e1,
19522                                  const char* e2,
19523                                  const char* e3,
19524                                  Pred pred,
19525                                  const T1& v1,
19526                                  const T2& v2,
19527                                  const T3& v3) {
19528  if (pred(v1, v2, v3)) return AssertionSuccess();
19529
19530  return AssertionFailure() << pred_text << "("
19531                            << e1 << ", "
19532                            << e2 << ", "
19533                            << e3 << ") evaluates to false, where"
19534                            << "\n" << e1 << " evaluates to " << v1
19535                            << "\n" << e2 << " evaluates to " << v2
19536                            << "\n" << e3 << " evaluates to " << v3;
19537}
19538
19539// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
19540// Don't use this in your code.
19541#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
19542  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
19543                on_failure)
19544
19545// Internal macro for implementing {EXPECT|ASSERT}_PRED3.  Don't use
19546// this in your code.
19547#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
19548  GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
19549                                             #v1, \
19550                                             #v2, \
19551                                             #v3, \
19552                                             pred, \
19553                                             v1, \
19554                                             v2, \
19555                                             v3), on_failure)
19556
19557// Ternary predicate assertion macros.
19558#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19559  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19560#define EXPECT_PRED3(pred, v1, v2, v3) \
19561  GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19562#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19563  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
19564#define ASSERT_PRED3(pred, v1, v2, v3) \
19565  GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
19566
19567
19568
19569// Helper function for implementing {EXPECT|ASSERT}_PRED4.  Don't use
19570// this in your code.
19571template <typename Pred,
19572          typename T1,
19573          typename T2,
19574          typename T3,
19575          typename T4>
19576AssertionResult AssertPred4Helper(const char* pred_text,
19577                                  const char* e1,
19578                                  const char* e2,
19579                                  const char* e3,
19580                                  const char* e4,
19581                                  Pred pred,
19582                                  const T1& v1,
19583                                  const T2& v2,
19584                                  const T3& v3,
19585                                  const T4& v4) {
19586  if (pred(v1, v2, v3, v4)) return AssertionSuccess();
19587
19588  return AssertionFailure() << pred_text << "("
19589                            << e1 << ", "
19590                            << e2 << ", "
19591                            << e3 << ", "
19592                            << e4 << ") evaluates to false, where"
19593                            << "\n" << e1 << " evaluates to " << v1
19594                            << "\n" << e2 << " evaluates to " << v2
19595                            << "\n" << e3 << " evaluates to " << v3
19596                            << "\n" << e4 << " evaluates to " << v4;
19597}
19598
19599// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
19600// Don't use this in your code.
19601#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
19602  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
19603                on_failure)
19604
19605// Internal macro for implementing {EXPECT|ASSERT}_PRED4.  Don't use
19606// this in your code.
19607#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
19608  GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
19609                                             #v1, \
19610                                             #v2, \
19611                                             #v3, \
19612                                             #v4, \
19613                                             pred, \
19614                                             v1, \
19615                                             v2, \
19616                                             v3, \
19617                                             v4), on_failure)
19618
19619// 4-ary predicate assertion macros.
19620#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19621  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19622#define EXPECT_PRED4(pred, v1, v2, v3, v4) \
19623  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19624#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19625  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19626#define ASSERT_PRED4(pred, v1, v2, v3, v4) \
19627  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19628
19629
19630
19631// Helper function for implementing {EXPECT|ASSERT}_PRED5.  Don't use
19632// this in your code.
19633template <typename Pred,
19634          typename T1,
19635          typename T2,
19636          typename T3,
19637          typename T4,
19638          typename T5>
19639AssertionResult AssertPred5Helper(const char* pred_text,
19640                                  const char* e1,
19641                                  const char* e2,
19642                                  const char* e3,
19643                                  const char* e4,
19644                                  const char* e5,
19645                                  Pred pred,
19646                                  const T1& v1,
19647                                  const T2& v2,
19648                                  const T3& v3,
19649                                  const T4& v4,
19650                                  const T5& v5) {
19651  if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
19652
19653  return AssertionFailure() << pred_text << "("
19654                            << e1 << ", "
19655                            << e2 << ", "
19656                            << e3 << ", "
19657                            << e4 << ", "
19658                            << e5 << ") evaluates to false, where"
19659                            << "\n" << e1 << " evaluates to " << v1
19660                            << "\n" << e2 << " evaluates to " << v2
19661                            << "\n" << e3 << " evaluates to " << v3
19662                            << "\n" << e4 << " evaluates to " << v4
19663                            << "\n" << e5 << " evaluates to " << v5;
19664}
19665
19666// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
19667// Don't use this in your code.
19668#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
19669  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
19670                on_failure)
19671
19672// Internal macro for implementing {EXPECT|ASSERT}_PRED5.  Don't use
19673// this in your code.
19674#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
19675  GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
19676                                             #v1, \
19677                                             #v2, \
19678                                             #v3, \
19679                                             #v4, \
19680                                             #v5, \
19681                                             pred, \
19682                                             v1, \
19683                                             v2, \
19684                                             v3, \
19685                                             v4, \
19686                                             v5), on_failure)
19687
19688// 5-ary predicate assertion macros.
19689#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19690  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19691#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
19692  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19693#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19694  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19695#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
19696  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19697
19698
19699
19700#endif  // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19701
19702// Macros for testing equalities and inequalities.
19703//
19704//    * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
19705//    * {ASSERT|EXPECT}_NE(v1, v2):           Tests that v1 != v2
19706//    * {ASSERT|EXPECT}_LT(v1, v2):           Tests that v1 < v2
19707//    * {ASSERT|EXPECT}_LE(v1, v2):           Tests that v1 <= v2
19708//    * {ASSERT|EXPECT}_GT(v1, v2):           Tests that v1 > v2
19709//    * {ASSERT|EXPECT}_GE(v1, v2):           Tests that v1 >= v2
19710//
19711// When they are not, Google Test prints both the tested expressions and
19712// their actual values.  The values must be compatible built-in types,
19713// or you will get a compiler error.  By "compatible" we mean that the
19714// values can be compared by the respective operator.
19715//
19716// Note:
19717//
19718//   1. It is possible to make a user-defined type work with
19719//   {ASSERT|EXPECT}_??(), but that requires overloading the
19720//   comparison operators and is thus discouraged by the Google C++
19721//   Usage Guide.  Therefore, you are advised to use the
19722//   {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
19723//   equal.
19724//
19725//   2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
19726//   pointers (in particular, C strings).  Therefore, if you use it
19727//   with two C strings, you are testing how their locations in memory
19728//   are related, not how their content is related.  To compare two C
19729//   strings by content, use {ASSERT|EXPECT}_STR*().
19730//
19731//   3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
19732//   {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
19733//   what the actual value is when it fails, and similarly for the
19734//   other comparisons.
19735//
19736//   4. Do not depend on the order in which {ASSERT|EXPECT}_??()
19737//   evaluate their arguments, which is undefined.
19738//
19739//   5. These macros evaluate their arguments exactly once.
19740//
19741// Examples:
19742//
19743//   EXPECT_NE(5, Foo());
19744//   EXPECT_EQ(NULL, a_pointer);
19745//   ASSERT_LT(i, array_size);
19746//   ASSERT_GT(records.size(), 0) << "There is no record left.";
19747
19748#define EXPECT_EQ(expected, actual) \
19749  EXPECT_PRED_FORMAT2(::testing::internal:: \
19750                      EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19751                      expected, actual)
19752#define EXPECT_NE(expected, actual) \
19753  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
19754#define EXPECT_LE(val1, val2) \
19755  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19756#define EXPECT_LT(val1, val2) \
19757  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19758#define EXPECT_GE(val1, val2) \
19759  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19760#define EXPECT_GT(val1, val2) \
19761  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19762
19763#define GTEST_ASSERT_EQ(expected, actual) \
19764  ASSERT_PRED_FORMAT2(::testing::internal:: \
19765                      EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19766                      expected, actual)
19767#define GTEST_ASSERT_NE(val1, val2) \
19768  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
19769#define GTEST_ASSERT_LE(val1, val2) \
19770  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19771#define GTEST_ASSERT_LT(val1, val2) \
19772  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19773#define GTEST_ASSERT_GE(val1, val2) \
19774  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19775#define GTEST_ASSERT_GT(val1, val2) \
19776  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19777
19778// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
19779// ASSERT_XY(), which clashes with some users' own code.
19780
19781#if !GTEST_DONT_DEFINE_ASSERT_EQ
19782# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
19783#endif
19784
19785#if !GTEST_DONT_DEFINE_ASSERT_NE
19786# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
19787#endif
19788
19789#if !GTEST_DONT_DEFINE_ASSERT_LE
19790# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
19791#endif
19792
19793#if !GTEST_DONT_DEFINE_ASSERT_LT
19794# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
19795#endif
19796
19797#if !GTEST_DONT_DEFINE_ASSERT_GE
19798# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
19799#endif
19800
19801#if !GTEST_DONT_DEFINE_ASSERT_GT
19802# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
19803#endif
19804
19805// C-string Comparisons.  All tests treat NULL and any non-NULL string
19806// as different.  Two NULLs are equal.
19807//
19808//    * {ASSERT|EXPECT}_STREQ(s1, s2):     Tests that s1 == s2
19809//    * {ASSERT|EXPECT}_STRNE(s1, s2):     Tests that s1 != s2
19810//    * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
19811//    * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
19812//
19813// For wide or narrow string objects, you can use the
19814// {ASSERT|EXPECT}_??() macros.
19815//
19816// Don't depend on the order in which the arguments are evaluated,
19817// which is undefined.
19818//
19819// These macros evaluate their arguments exactly once.
19820
19821#define EXPECT_STREQ(expected, actual) \
19822  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19823#define EXPECT_STRNE(s1, s2) \
19824  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19825#define EXPECT_STRCASEEQ(expected, actual) \
19826  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19827#define EXPECT_STRCASENE(s1, s2)\
19828  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19829
19830#define ASSERT_STREQ(expected, actual) \
19831  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19832#define ASSERT_STRNE(s1, s2) \
19833  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19834#define ASSERT_STRCASEEQ(expected, actual) \
19835  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19836#define ASSERT_STRCASENE(s1, s2)\
19837  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19838
19839// Macros for comparing floating-point numbers.
19840//
19841//    * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
19842//         Tests that two float values are almost equal.
19843//    * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
19844//         Tests that two double values are almost equal.
19845//    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
19846//         Tests that v1 and v2 are within the given distance to each other.
19847//
19848// Google Test uses ULP-based comparison to automatically pick a default
19849// error bound that is appropriate for the operands.  See the
19850// FloatingPoint template class in gtest-internal.h if you are
19851// interested in the implementation details.
19852
19853#define EXPECT_FLOAT_EQ(expected, actual)\
19854  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19855                      expected, actual)
19856
19857#define EXPECT_DOUBLE_EQ(expected, actual)\
19858  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19859                      expected, actual)
19860
19861#define ASSERT_FLOAT_EQ(expected, actual)\
19862  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19863                      expected, actual)
19864
19865#define ASSERT_DOUBLE_EQ(expected, actual)\
19866  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19867                      expected, actual)
19868
19869#define EXPECT_NEAR(val1, val2, abs_error)\
19870  EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19871                      val1, val2, abs_error)
19872
19873#define ASSERT_NEAR(val1, val2, abs_error)\
19874  ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19875                      val1, val2, abs_error)
19876
19877// These predicate format functions work on floating-point values, and
19878// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
19879//
19880//   EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
19881
19882// Asserts that val1 is less than, or almost equal to, val2.  Fails
19883// otherwise.  In particular, it fails if either val1 or val2 is NaN.
19884GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
19885                                   float val1, float val2);
19886GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
19887                                    double val1, double val2);
19888
19889
19890#if GTEST_OS_WINDOWS
19891
19892// Macros that test for HRESULT failure and success, these are only useful
19893// on Windows, and rely on Windows SDK macros and APIs to compile.
19894//
19895//    * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
19896//
19897// When expr unexpectedly fails or succeeds, Google Test prints the
19898// expected result and the actual result with both a human-readable
19899// string representation of the error, if available, as well as the
19900// hex result code.
19901# define EXPECT_HRESULT_SUCCEEDED(expr) \
19902    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19903
19904# define ASSERT_HRESULT_SUCCEEDED(expr) \
19905    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19906
19907# define EXPECT_HRESULT_FAILED(expr) \
19908    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19909
19910# define ASSERT_HRESULT_FAILED(expr) \
19911    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19912
19913#endif  // GTEST_OS_WINDOWS
19914
19915// Macros that execute statement and check that it doesn't generate new fatal
19916// failures in the current thread.
19917//
19918//   * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
19919//
19920// Examples:
19921//
19922//   EXPECT_NO_FATAL_FAILURE(Process());
19923//   ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
19924//
19925#define ASSERT_NO_FATAL_FAILURE(statement) \
19926    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
19927#define EXPECT_NO_FATAL_FAILURE(statement) \
19928    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
19929
19930// Causes a trace (including the source file path, the current line
19931// number, and the given message) to be included in every test failure
19932// message generated by code in the current scope.  The effect is
19933// undone when the control leaves the current scope.
19934//
19935// The message argument can be anything streamable to std::ostream.
19936//
19937// In the implementation, we include the current line number as part
19938// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
19939// to appear in the same block - as long as they are on different
19940// lines.
19941#define SCOPED_TRACE(message) \
19942  ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
19943    __FILE__, __LINE__, ::testing::Message() << (message))
19944
19945// Compile-time assertion for type equality.
19946// StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
19947// the same type.  The value it returns is not interesting.
19948//
19949// Instead of making StaticAssertTypeEq a class template, we make it a
19950// function template that invokes a helper class template.  This
19951// prevents a user from misusing StaticAssertTypeEq<T1, T2> by
19952// defining objects of that type.
19953//
19954// CAVEAT:
19955//
19956// When used inside a method of a class template,
19957// StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
19958// instantiated.  For example, given:
19959//
19960//   template <typename T> class Foo {
19961//    public:
19962//     void Bar() { testing::StaticAssertTypeEq<int, T>(); }
19963//   };
19964//
19965// the code:
19966//
19967//   void Test1() { Foo<bool> foo; }
19968//
19969// will NOT generate a compiler error, as Foo<bool>::Bar() is never
19970// actually instantiated.  Instead, you need:
19971//
19972//   void Test2() { Foo<bool> foo; foo.Bar(); }
19973//
19974// to cause a compiler error.
19975template <typename T1, typename T2>
19976bool StaticAssertTypeEq() {
19977  (void)internal::StaticAssertTypeEqHelper<T1, T2>();
19978  return true;
19979}
19980
19981// Defines a test.
19982//
19983// The first parameter is the name of the test case, and the second
19984// parameter is the name of the test within the test case.
19985//
19986// The convention is to end the test case name with "Test".  For
19987// example, a test case for the Foo class can be named FooTest.
19988//
19989// The user should put his test code between braces after using this
19990// macro.  Example:
19991//
19992//   TEST(FooTest, InitializesCorrectly) {
19993//     Foo foo;
19994//     EXPECT_TRUE(foo.StatusIsOK());
19995//   }
19996
19997// Note that we call GetTestTypeId() instead of GetTypeId<
19998// ::testing::Test>() here to get the type ID of testing::Test.  This
19999// is to work around a suspected linker bug when using Google Test as
20000// a framework on Mac OS X.  The bug causes GetTypeId<
20001// ::testing::Test>() to return different values depending on whether
20002// the call is from the Google Test framework itself or from user test
20003// code.  GetTestTypeId() is guaranteed to always return the same
20004// value, as it always calls GetTypeId<>() from the Google Test
20005// framework.
20006#define GTEST_TEST(test_case_name, test_name)\
20007  GTEST_TEST_(test_case_name, test_name, \
20008              ::testing::Test, ::testing::internal::GetTestTypeId())
20009
20010// Define this macro to 1 to omit the definition of TEST(), which
20011// is a generic name and clashes with some other libraries.
20012#if !GTEST_DONT_DEFINE_TEST
20013# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
20014#endif
20015
20016// Defines a test that uses a test fixture.
20017//
20018// The first parameter is the name of the test fixture class, which
20019// also doubles as the test case name.  The second parameter is the
20020// name of the test within the test case.
20021//
20022// A test fixture class must be declared earlier.  The user should put
20023// his test code between braces after using this macro.  Example:
20024//
20025//   class FooTest : public testing::Test {
20026//    protected:
20027//     virtual void SetUp() { b_.AddElement(3); }
20028//
20029//     Foo a_;
20030//     Foo b_;
20031//   };
20032//
20033//   TEST_F(FooTest, InitializesCorrectly) {
20034//     EXPECT_TRUE(a_.StatusIsOK());
20035//   }
20036//
20037//   TEST_F(FooTest, ReturnsElementCountCorrectly) {
20038//     EXPECT_EQ(0, a_.size());
20039//     EXPECT_EQ(1, b_.size());
20040//   }
20041
20042#define TEST_F(test_fixture, test_name)\
20043  GTEST_TEST_(test_fixture, test_name, test_fixture, \
20044              ::testing::internal::GetTypeId<test_fixture>())
20045
20046}  // namespace testing
20047
20048// Use this function in main() to run all tests.  It returns 0 if all
20049// tests are successful, or 1 otherwise.
20050//
20051// RUN_ALL_TESTS() should be invoked after the command line has been
20052// parsed by InitGoogleTest().
20053//
20054// This function was formerly a macro; thus, it is in the global
20055// namespace and has an all-caps name.
20056int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
20057
20058inline int RUN_ALL_TESTS() {
20059  return ::testing::UnitTest::GetInstance()->Run();
20060}
20061
20062#endif  // GTEST_INCLUDE_GTEST_GTEST_H_
20063