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 #ifdef __GNUC__
52 #pragma GCC system_header
53 #endif
54 
55 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
56 #define GTEST_INCLUDE_GTEST_GTEST_H_
57 
58 #include <limits>
59 #include <ostream>
60 #include <vector>
61 
62 // Copyright 2005, Google Inc.
63 // All rights reserved.
64 //
65 // Redistribution and use in source and binary forms, with or without
66 // modification, are permitted provided that the following conditions are
67 // met:
68 //
69 //     * Redistributions of source code must retain the above copyright
70 // notice, this list of conditions and the following disclaimer.
71 //     * Redistributions in binary form must reproduce the above
72 // copyright notice, this list of conditions and the following disclaimer
73 // in the documentation and/or other materials provided with the
74 // distribution.
75 //     * Neither the name of Google Inc. nor the names of its
76 // contributors may be used to endorse or promote products derived from
77 // this software without specific prior written permission.
78 //
79 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
80 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
81 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
82 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
83 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
84 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
85 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
86 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
87 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
88 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
89 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
90 //
91 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
92 //
93 // The Google C++ Testing Framework (Google Test)
94 //
95 // This header file declares functions and macros used internally by
96 // Google Test.  They are subject to change without notice.
97 
98 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
99 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
100 
101 // Copyright 2005, Google Inc.
102 // All rights reserved.
103 //
104 // Redistribution and use in source and binary forms, with or without
105 // modification, are permitted provided that the following conditions are
106 // met:
107 //
108 //     * Redistributions of source code must retain the above copyright
109 // notice, this list of conditions and the following disclaimer.
110 //     * Redistributions in binary form must reproduce the above
111 // copyright notice, this list of conditions and the following disclaimer
112 // in the documentation and/or other materials provided with the
113 // distribution.
114 //     * Neither the name of Google Inc. nor the names of its
115 // contributors may be used to endorse or promote products derived from
116 // this software without specific prior written permission.
117 //
118 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
119 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
120 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
121 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
122 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
123 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
124 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
125 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
126 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
127 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
128 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
129 //
130 // Authors: wan@google.com (Zhanyong Wan)
131 //
132 // Low-level types and utilities for porting Google Test to various
133 // platforms.  They are subject to change without notice.  DO NOT USE
134 // THEM IN USER CODE.
135 //
136 // This file is fundamental to Google Test.  All other Google Test source
137 // files are expected to #include this.  Therefore, it cannot #include
138 // any other Google Test header.
139 
140 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
141 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
142 
143 // The user can define the following macros in the build script to
144 // control Google Test's behavior.  If the user doesn't define a macro
145 // in this list, Google Test will define it.
146 //
147 //   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)
148 //                              is/isn't available.
149 //   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions
150 //                              are enabled.
151 //   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string
152 //                              is/isn't available (some systems define
153 //                              ::string, which is different to std::string).
154 //   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
155 //                              is/isn't available (some systems define
156 //                              ::wstring, which is different to std::wstring).
157 //   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular
158 //                              expressions are/aren't available.
159 //   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>
160 //                              is/isn't available.
161 //   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't
162 //                              enabled.
163 //   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that
164 //                              std::wstring does/doesn't work (Google Test can
165 //                              be used where std::wstring is unavailable).
166 //   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple
167 //                              is/isn't available.
168 //   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the
169 //                              compiler supports Microsoft's "Structured
170 //                              Exception Handling".
171 //   GTEST_HAS_STREAM_REDIRECTION
172 //                            - Define it to 1/0 to indicate whether the
173 //                              platform supports I/O stream redirection using
174 //                              dup() and dup2().
175 //   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google
176 //                              Test's own tr1 tuple implementation should be
177 //                              used.  Unused when the user sets
178 //                              GTEST_HAS_TR1_TUPLE to 0.
179 //   GTEST_LANG_CXX11         - Define it to 1/0 to indicate that Google Test
180 //                              is building in C++11/C++98 mode.
181 //   GTEST_LINKED_AS_SHARED_LIBRARY
182 //                            - Define to 1 when compiling tests that use
183 //                              Google Test as a shared library (known as
184 //                              DLL on Windows).
185 //   GTEST_CREATE_SHARED_LIBRARY
186 //                            - Define to 1 when compiling Google Test itself
187 //                              as a shared library.
188 
189 // This header defines the following utilities:
190 //
191 // Macros indicating the current platform (defined to 1 if compiled on
192 // the given platform; otherwise undefined):
193 //   GTEST_OS_AIX      - IBM AIX
194 //   GTEST_OS_CYGWIN   - Cygwin
195 //   GTEST_OS_HPUX     - HP-UX
196 //   GTEST_OS_LINUX    - Linux
197 //     GTEST_OS_LINUX_ANDROID - Google Android
198 //   GTEST_OS_MAC      - Mac OS X
199 //     GTEST_OS_IOS    - iOS
200 //       GTEST_OS_IOS_SIMULATOR - iOS simulator
201 //   GTEST_OS_NACL     - Google Native Client (NaCl)
202 //   GTEST_OS_OPENBSD  - OpenBSD
203 //   GTEST_OS_QNX      - QNX
204 //   GTEST_OS_SOLARIS  - Sun Solaris
205 //   GTEST_OS_SYMBIAN  - Symbian
206 //   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)
207 //     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
208 //     GTEST_OS_WINDOWS_MINGW    - MinGW
209 //     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile
210 //   GTEST_OS_ZOS      - z/OS
211 //
212 // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
213 // most stable support.  Since core members of the Google Test project
214 // don't have access to other platforms, support for them may be less
215 // stable.  If you notice any problems on your platform, please notify
216 // googletestframework@googlegroups.com (patches for fixing them are
217 // even more welcome!).
218 //
219 // Note that it is possible that none of the GTEST_OS_* macros are defined.
220 //
221 // Macros indicating available Google Test features (defined to 1 if
222 // the corresponding feature is supported; otherwise undefined):
223 //   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized
224 //                            tests)
225 //   GTEST_HAS_DEATH_TEST   - death tests
226 //   GTEST_HAS_PARAM_TEST   - value-parameterized tests
227 //   GTEST_HAS_TYPED_TEST   - typed tests
228 //   GTEST_HAS_TYPED_TEST_P - type-parameterized tests
229 //   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with
230 //                            GTEST_HAS_POSIX_RE (see above) which users can
231 //                            define themselves.
232 //   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
233 //                            the above two are mutually exclusive.
234 //   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
235 //
236 // Macros for basic C++ coding:
237 //   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
238 //   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a
239 //                              variable don't have to be used.
240 //   GTEST_DISALLOW_ASSIGN_   - disables operator=.
241 //   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
242 //   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.
243 //
244 // Synchronization:
245 //   Mutex, MutexLock, ThreadLocal, GetThreadCount()
246 //                  - synchronization primitives.
247 //   GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
248 //                         synchronization primitives have real implementations
249 //                         and Google Test is thread-safe; or 0 otherwise.
250 //
251 // Template meta programming:
252 //   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.
253 //   IteratorTraits - partial implementation of std::iterator_traits, which
254 //                    is not available in libCstd when compiled with Sun C++.
255 //
256 // Smart pointers:
257 //   scoped_ptr     - as in TR2.
258 //
259 // Regular expressions:
260 //   RE             - a simple regular expression class using the POSIX
261 //                    Extended Regular Expression syntax on UNIX-like
262 //                    platforms, or a reduced regular exception syntax on
263 //                    other platforms, including Windows.
264 //
265 // Logging:
266 //   GTEST_LOG_()   - logs messages at the specified severity level.
267 //   LogToStderr()  - directs all log messages to stderr.
268 //   FlushInfoLog() - flushes informational log messages.
269 //
270 // Stdout and stderr capturing:
271 //   CaptureStdout()     - starts capturing stdout.
272 //   GetCapturedStdout() - stops capturing stdout and returns the captured
273 //                         string.
274 //   CaptureStderr()     - starts capturing stderr.
275 //   GetCapturedStderr() - stops capturing stderr and returns the captured
276 //                         string.
277 //
278 // Integer types:
279 //   TypeWithSize   - maps an integer to a int type.
280 //   Int32, UInt32, Int64, UInt64, TimeInMillis
281 //                  - integers of known sizes.
282 //   BiggestInt     - the biggest signed integer type.
283 //
284 // Command-line utilities:
285 //   GTEST_FLAG()       - references a flag.
286 //   GTEST_DECLARE_*()  - declares a flag.
287 //   GTEST_DEFINE_*()   - defines a flag.
288 //   GetInjectableArgvs() - returns the command line as a vector of strings.
289 //
290 // Environment variable utilities:
291 //   GetEnv()             - gets the value of an environment variable.
292 //   BoolFromGTestEnv()   - parses a bool environment variable.
293 //   Int32FromGTestEnv()  - parses an Int32 environment variable.
294 //   StringFromGTestEnv() - parses a string environment variable.
295 
296 #include <ctype.h>   // for isspace, etc
297 #include <stddef.h>  // for ptrdiff_t
298 #include <stdlib.h>
299 #include <stdio.h>
300 #include <string.h>
301 #ifndef _WIN32_WCE
302 # include <sys/types.h>
303 # include <sys/stat.h>
304 #endif  // !_WIN32_WCE
305 
306 #if defined __APPLE__
307 # include <AvailabilityMacros.h>
308 # include <TargetConditionals.h>
309 #endif
310 
311 #include <iostream>  // NOLINT
312 #include <sstream>  // NOLINT
313 #include <string>  // NOLINT
314 
315 #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
316 #define GTEST_FLAG_PREFIX_ "gtest_"
317 #define GTEST_FLAG_PREFIX_DASH_ "gtest-"
318 #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
319 #define GTEST_NAME_ "Google Test"
320 #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
321 
322 // Determines the version of gcc that is used to compile this.
323 #ifdef __GNUC__
324 // 40302 means version 4.3.2.
325 # define GTEST_GCC_VER_ \
326     (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
327 #endif  // __GNUC__
328 
329 // Determines the platform on which Google Test is compiled.
330 #ifdef __CYGWIN__
331 # define GTEST_OS_CYGWIN 1
332 #elif defined __SYMBIAN32__
333 # define GTEST_OS_SYMBIAN 1
334 #elif defined _WIN32
335 # define GTEST_OS_WINDOWS 1
336 # ifdef _WIN32_WCE
337 #  define GTEST_OS_WINDOWS_MOBILE 1
338 # elif defined(__MINGW__) || defined(__MINGW32__)
339 #  define GTEST_OS_WINDOWS_MINGW 1
340 # else
341 #  define GTEST_OS_WINDOWS_DESKTOP 1
342 # endif  // _WIN32_WCE
343 #elif defined __APPLE__
344 # define GTEST_OS_MAC 1
345 # if TARGET_OS_IPHONE
346 #  define GTEST_OS_IOS 1
347 #  if TARGET_IPHONE_SIMULATOR
348 #   define GTEST_OS_IOS_SIMULATOR 1
349 #  endif
350 # endif
351 #elif defined __linux__
352 # define GTEST_OS_LINUX 1
353 # if defined __ANDROID__
354 #  define GTEST_OS_LINUX_ANDROID 1
355 # endif
356 #elif defined __MVS__
357 # define GTEST_OS_ZOS 1
358 #elif defined(__sun) && defined(__SVR4)
359 # define GTEST_OS_SOLARIS 1
360 #elif defined(_AIX)
361 # define GTEST_OS_AIX 1
362 #elif defined(__hpux)
363 # define GTEST_OS_HPUX 1
364 #elif defined __native_client__
365 # define GTEST_OS_NACL 1
366 #elif defined __OpenBSD__
367 # define GTEST_OS_OPENBSD 1
368 #elif defined __QNX__
369 # define GTEST_OS_QNX 1
370 #endif  // __CYGWIN__
371 
372 #ifndef GTEST_LANG_CXX11
373 // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
374 // -std={c,gnu}++{0x,11} is passed.  The C++11 standard specifies a
375 // value for __cplusplus, and recent versions of clang, gcc, and
376 // probably other compilers set that too in C++11 mode.
377 # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
378 // Compiling in at least C++11 mode.
379 #  define GTEST_LANG_CXX11 1
380 # else
381 #  define GTEST_LANG_CXX11 0
382 # endif
383 #endif
384 
385 // Brings in definitions for functions used in the testing::internal::posix
386 // namespace (read, write, close, chdir, isatty, stat). We do not currently
387 // use them on Windows Mobile.
388 #if !GTEST_OS_WINDOWS
389 // This assumes that non-Windows OSes provide unistd.h. For OSes where this
390 // is not the case, we need to include headers that provide the functions
391 // mentioned above.
392 # include <unistd.h>
393 # include <strings.h>
394 #elif !GTEST_OS_WINDOWS_MOBILE
395 # include <direct.h>
396 # include <io.h>
397 #endif
398 
399 #if GTEST_OS_LINUX_ANDROID
400 // Used to define __ANDROID_API__ matching the target NDK API level.
401 #  include <android/api-level.h>  // NOLINT
402 #endif
403 
404 // Defines this to true iff Google Test can use POSIX regular expressions.
405 #ifndef GTEST_HAS_POSIX_RE
406 # if GTEST_OS_LINUX_ANDROID
407 // On Android, <regex.h> is only available starting with Gingerbread.
408 #  define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
409 # else
410 #  define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
411 # endif
412 #endif
413 
414 #if GTEST_HAS_POSIX_RE
415 
416 // On some platforms, <regex.h> needs someone to define size_t, and
417 // won't compile otherwise.  We can #include it here as we already
418 // included <stdlib.h>, which is guaranteed to define size_t through
419 // <stddef.h>.
420 # include <regex.h>  // NOLINT
421 
422 # define GTEST_USES_POSIX_RE 1
423 
424 #elif GTEST_OS_WINDOWS
425 
426 // <regex.h> is not available on Windows.  Use our own simple regex
427 // implementation instead.
428 # define GTEST_USES_SIMPLE_RE 1
429 
430 #else
431 
432 // <regex.h> may not be available on this platform.  Use our own
433 // simple regex implementation instead.
434 # define GTEST_USES_SIMPLE_RE 1
435 
436 #endif  // GTEST_HAS_POSIX_RE
437 
438 #ifndef GTEST_HAS_EXCEPTIONS
439 // The user didn't tell us whether exceptions are enabled, so we need
440 // to figure it out.
441 # if defined(_MSC_VER) || defined(__BORLANDC__)
442 // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
443 // macro to enable exceptions, so we'll do the same.
444 // Assumes that exceptions are enabled by default.
445 #  ifndef _HAS_EXCEPTIONS
446 #   define _HAS_EXCEPTIONS 1
447 #  endif  // _HAS_EXCEPTIONS
448 #  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
449 # elif defined(__GNUC__) && __EXCEPTIONS
450 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
451 #  define GTEST_HAS_EXCEPTIONS 1
452 # elif defined(__SUNPRO_CC)
453 // Sun Pro CC supports exceptions.  However, there is no compile-time way of
454 // detecting whether they are enabled or not.  Therefore, we assume that
455 // they are enabled unless the user tells us otherwise.
456 #  define GTEST_HAS_EXCEPTIONS 1
457 # elif defined(__IBMCPP__) && __EXCEPTIONS
458 // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
459 #  define GTEST_HAS_EXCEPTIONS 1
460 # elif defined(__HP_aCC)
461 // Exception handling is in effect by default in HP aCC compiler. It has to
462 // be turned of by +noeh compiler option if desired.
463 #  define GTEST_HAS_EXCEPTIONS 1
464 # else
465 // For other compilers, we assume exceptions are disabled to be
466 // conservative.
467 #  define GTEST_HAS_EXCEPTIONS 0
468 # endif  // defined(_MSC_VER) || defined(__BORLANDC__)
469 #endif  // GTEST_HAS_EXCEPTIONS
470 
471 #if !defined(GTEST_HAS_STD_STRING)
472 // Even though we don't use this macro any longer, we keep it in case
473 // some clients still depend on it.
474 # define GTEST_HAS_STD_STRING 1
475 #elif !GTEST_HAS_STD_STRING
476 // The user told us that ::std::string isn't available.
477 # error "Google Test cannot be used where ::std::string isn't available."
478 #endif  // !defined(GTEST_HAS_STD_STRING)
479 
480 #ifndef GTEST_HAS_GLOBAL_STRING
481 // The user didn't tell us whether ::string is available, so we need
482 // to figure it out.
483 
484 # define GTEST_HAS_GLOBAL_STRING 0
485 
486 #endif  // GTEST_HAS_GLOBAL_STRING
487 
488 #ifndef GTEST_HAS_STD_WSTRING
489 // The user didn't tell us whether ::std::wstring is available, so we need
490 // to figure it out.
491 // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
492 //   is available.
493 
494 // Cygwin 1.7 and below doesn't support ::std::wstring.
495 // Solaris' libc++ doesn't support it either.  Android has
496 // no support for it at least as recent as Froyo (2.2).
497 # define GTEST_HAS_STD_WSTRING \
498     (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
499 
500 #endif  // GTEST_HAS_STD_WSTRING
501 
502 #ifndef GTEST_HAS_GLOBAL_WSTRING
503 // The user didn't tell us whether ::wstring is available, so we need
504 // to figure it out.
505 # define GTEST_HAS_GLOBAL_WSTRING \
506     (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
507 #endif  // GTEST_HAS_GLOBAL_WSTRING
508 
509 // Determines whether RTTI is available.
510 #ifndef GTEST_HAS_RTTI
511 // The user didn't tell us whether RTTI is enabled, so we need to
512 // figure it out.
513 
514 # ifdef _MSC_VER
515 
516 #  ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.
517 #   define GTEST_HAS_RTTI 1
518 #  else
519 #   define GTEST_HAS_RTTI 0
520 #  endif
521 
522 // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
523 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
524 
525 #  ifdef __GXX_RTTI
526 // When building against STLport with the Android NDK and with
527 // -frtti -fno-exceptions, the build fails at link time with undefined
528 // references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
529 // so disable RTTI when detected.
530 #   if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
531        !defined(__EXCEPTIONS)
532 #    define GTEST_HAS_RTTI 0
533 #   else
534 #    define GTEST_HAS_RTTI 1
535 #   endif  // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
536 #  else
537 #   define GTEST_HAS_RTTI 0
538 #  endif  // __GXX_RTTI
539 
540 // Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
541 // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
542 // first version with C++ support.
543 # elif defined(__clang__)
544 
545 #  define GTEST_HAS_RTTI __has_feature(cxx_rtti)
546 
547 // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
548 // both the typeid and dynamic_cast features are present.
549 # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
550 
551 #  ifdef __RTTI_ALL__
552 #   define GTEST_HAS_RTTI 1
553 #  else
554 #   define GTEST_HAS_RTTI 0
555 #  endif
556 
557 # else
558 
559 // For all other compilers, we assume RTTI is enabled.
560 #  define GTEST_HAS_RTTI 1
561 
562 # endif  // _MSC_VER
563 
564 #endif  // GTEST_HAS_RTTI
565 
566 // It's this header's responsibility to #include <typeinfo> when RTTI
567 // is enabled.
568 #if GTEST_HAS_RTTI
569 # include <typeinfo>
570 #endif
571 
572 // Determines whether Google Test can use the pthreads library.
573 #ifndef GTEST_HAS_PTHREAD
574 // The user didn't tell us explicitly, so we assume pthreads support is
575 // available on Linux and Mac.
576 //
577 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
578 // to your compiler flags.
579 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
580     || GTEST_OS_QNX)
581 #endif  // GTEST_HAS_PTHREAD
582 
583 #if GTEST_HAS_PTHREAD
584 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
585 // true.
586 # include <pthread.h>  // NOLINT
587 
588 // For timespec and nanosleep, used below.
589 # include <time.h>  // NOLINT
590 #endif
591 
592 // Determines whether Google Test can use tr1/tuple.  You can define
593 // this macro to 0 to prevent Google Test from using tuple (any
594 // feature depending on tuple with be disabled in this mode).
595 #ifndef GTEST_HAS_TR1_TUPLE
596 # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
597 // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
598 #  define GTEST_HAS_TR1_TUPLE 0
599 # else
600 // The user didn't tell us not to do it, so we assume it's OK.
601 #  define GTEST_HAS_TR1_TUPLE 1
602 # endif
603 #endif  // GTEST_HAS_TR1_TUPLE
604 
605 // Determines whether Google Test's own tr1 tuple implementation
606 // should be used.
607 #ifndef GTEST_USE_OWN_TR1_TUPLE
608 // The user didn't tell us, so we need to figure it out.
609 
610 // We use our own TR1 tuple if we aren't sure the user has an
611 // implementation of it already.  At this time, libstdc++ 4.0.0+ and
612 // MSVC 2010 are the only mainstream standard libraries that come
613 // with a TR1 tuple implementation.  NVIDIA's CUDA NVCC compiler
614 // pretends to be GCC by defining __GNUC__ and friends, but cannot
615 // compile GCC's tuple implementation.  MSVC 2008 (9.0) provides TR1
616 // tuple in a 323 MB Feature Pack download, which we cannot assume the
617 // user has.  QNX's QCC compiler is a modified GCC but it doesn't
618 // support TR1 tuple.  libc++ only provides std::tuple, in C++11 mode,
619 // and it can be used with some compilers that define __GNUC__.
620 # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
621       && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600
622 #  define GTEST_ENV_HAS_TR1_TUPLE_ 1
623 # endif
624 
625 // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
626 // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
627 // can build with clang but need to use gcc4.2's libstdc++).
628 # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
629 #  define GTEST_ENV_HAS_STD_TUPLE_ 1
630 # endif
631 
632 # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
633 #  define GTEST_USE_OWN_TR1_TUPLE 0
634 # else
635 #  define GTEST_USE_OWN_TR1_TUPLE 1
636 # endif
637 
638 #endif  // GTEST_USE_OWN_TR1_TUPLE
639 
640 // To avoid conditional compilation everywhere, we make it
641 // gtest-port.h's responsibility to #include the header implementing
642 // tr1/tuple.
643 #if GTEST_HAS_TR1_TUPLE
644 
645 # if GTEST_USE_OWN_TR1_TUPLE
646 // This file was GENERATED by command:
647 //     pump.py gtest-tuple.h.pump
648 // DO NOT EDIT BY HAND!!!
649 
650 // Copyright 2009 Google Inc.
651 // All Rights Reserved.
652 //
653 // Redistribution and use in source and binary forms, with or without
654 // modification, are permitted provided that the following conditions are
655 // met:
656 //
657 //     * Redistributions of source code must retain the above copyright
658 // notice, this list of conditions and the following disclaimer.
659 //     * Redistributions in binary form must reproduce the above
660 // copyright notice, this list of conditions and the following disclaimer
661 // in the documentation and/or other materials provided with the
662 // distribution.
663 //     * Neither the name of Google Inc. nor the names of its
664 // contributors may be used to endorse or promote products derived from
665 // this software without specific prior written permission.
666 //
667 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
668 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
669 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
670 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
671 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
672 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
673 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
674 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
675 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
676 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
677 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
678 //
679 // Author: wan@google.com (Zhanyong Wan)
680 
681 // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
682 
683 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
684 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
685 
686 #include <utility>  // For ::std::pair.
687 
688 // The compiler used in Symbian has a bug that prevents us from declaring the
689 // tuple template as a friend (it complains that tuple is redefined).  This
690 // hack bypasses the bug by declaring the members that should otherwise be
691 // private as public.
692 // Sun Studio versions < 12 also have the above bug.
693 #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
694 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
695 #else
696 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
697     template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
698    private:
699 #endif
700 
701 // GTEST_n_TUPLE_(T) is the type of an n-tuple.
702 #define GTEST_0_TUPLE_(T) tuple<>
703 #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
704     void, void, void>
705 #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
706     void, void, void>
707 #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
708     void, void, void>
709 #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
710     void, void, void>
711 #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
712     void, void, void>
713 #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
714     void, void, void>
715 #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
716     void, void, void>
717 #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
718     T##7, void, void>
719 #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
720     T##7, T##8, void>
721 #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
722     T##7, T##8, T##9>
723 
724 // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
725 #define GTEST_0_TYPENAMES_(T)
726 #define GTEST_1_TYPENAMES_(T) typename T##0
727 #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
728 #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
729 #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
730     typename T##3
731 #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
732     typename T##3, typename T##4
733 #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
734     typename T##3, typename T##4, typename T##5
735 #define GTEST_7_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 #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
738     typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
739 #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
740     typename T##3, typename T##4, typename T##5, typename T##6, \
741     typename T##7, typename T##8
742 #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
743     typename T##3, typename T##4, typename T##5, typename T##6, \
744     typename T##7, typename T##8, typename T##9
745 
746 // In theory, defining stuff in the ::std namespace is undefined
747 // behavior.  We can do this as we are playing the role of a standard
748 // library vendor.
749 namespace std {
750 namespace tr1 {
751 
752 template <typename T0 = void, typename T1 = void, typename T2 = void,
753     typename T3 = void, typename T4 = void, typename T5 = void,
754     typename T6 = void, typename T7 = void, typename T8 = void,
755     typename T9 = void>
756 class tuple;
757 
758 // Anything in namespace gtest_internal is Google Test's INTERNAL
759 // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
760 namespace gtest_internal {
761 
762 // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
763 template <typename T>
764 struct ByRef { typedef const T& type; };  // NOLINT
765 template <typename T>
766 struct ByRef<T&> { typedef T& type; };  // NOLINT
767 
768 // A handy wrapper for ByRef.
769 #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
770 
771 // AddRef<T>::type is T if T is a reference; otherwise it's T&.  This
772 // is the same as tr1::add_reference<T>::type.
773 template <typename T>
774 struct AddRef { typedef T& type; };  // NOLINT
775 template <typename T>
776 struct AddRef<T&> { typedef T& type; };  // NOLINT
777 
778 // A handy wrapper for AddRef.
779 #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
780 
781 // A helper for implementing get<k>().
782 template <int k> class Get;
783 
784 // A helper for implementing tuple_element<k, T>.  kIndexValid is true
785 // iff k < the number of fields in tuple type T.
786 template <bool kIndexValid, int kIndex, class Tuple>
787 struct TupleElement;
788 
789 template <GTEST_10_TYPENAMES_(T)>
790 struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
791   typedef T0 type;
792 };
793 
794 template <GTEST_10_TYPENAMES_(T)>
795 struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
796   typedef T1 type;
797 };
798 
799 template <GTEST_10_TYPENAMES_(T)>
800 struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
801   typedef T2 type;
802 };
803 
804 template <GTEST_10_TYPENAMES_(T)>
805 struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
806   typedef T3 type;
807 };
808 
809 template <GTEST_10_TYPENAMES_(T)>
810 struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
811   typedef T4 type;
812 };
813 
814 template <GTEST_10_TYPENAMES_(T)>
815 struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
816   typedef T5 type;
817 };
818 
819 template <GTEST_10_TYPENAMES_(T)>
820 struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
821   typedef T6 type;
822 };
823 
824 template <GTEST_10_TYPENAMES_(T)>
825 struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
826   typedef T7 type;
827 };
828 
829 template <GTEST_10_TYPENAMES_(T)>
830 struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
831   typedef T8 type;
832 };
833 
834 template <GTEST_10_TYPENAMES_(T)>
835 struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
836   typedef T9 type;
837 };
838 
839 }  // namespace gtest_internal
840 
841 template <>
842 class tuple<> {
843  public:
844   tuple() {}
845   tuple(const tuple& /* t */)  {}
846   tuple& operator=(const tuple& /* t */) { return *this; }
847 };
848 
849 template <GTEST_1_TYPENAMES_(T)>
850 class GTEST_1_TUPLE_(T) {
851  public:
852   template <int k> friend class gtest_internal::Get;
853 
854   tuple() : f0_() {}
855 
856   explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
857 
858   tuple(const tuple& t) : f0_(t.f0_) {}
859 
860   template <GTEST_1_TYPENAMES_(U)>
861   tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
862 
863   tuple& operator=(const tuple& t) { return CopyFrom(t); }
864 
865   template <GTEST_1_TYPENAMES_(U)>
866   tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
867     return CopyFrom(t);
868   }
869 
870   GTEST_DECLARE_TUPLE_AS_FRIEND_
871 
872   template <GTEST_1_TYPENAMES_(U)>
873   tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
874     f0_ = t.f0_;
875     return *this;
876   }
877 
878   T0 f0_;
879 };
880 
881 template <GTEST_2_TYPENAMES_(T)>
882 class GTEST_2_TUPLE_(T) {
883  public:
884   template <int k> friend class gtest_internal::Get;
885 
886   tuple() : f0_(), f1_() {}
887 
888   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
889       f1_(f1) {}
890 
891   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
892 
893   template <GTEST_2_TYPENAMES_(U)>
894   tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
895   template <typename U0, typename U1>
896   tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
897 
898   tuple& operator=(const tuple& t) { return CopyFrom(t); }
899 
900   template <GTEST_2_TYPENAMES_(U)>
901   tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
902     return CopyFrom(t);
903   }
904   template <typename U0, typename U1>
905   tuple& operator=(const ::std::pair<U0, U1>& p) {
906     f0_ = p.first;
907     f1_ = p.second;
908     return *this;
909   }
910 
911   GTEST_DECLARE_TUPLE_AS_FRIEND_
912 
913   template <GTEST_2_TYPENAMES_(U)>
914   tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
915     f0_ = t.f0_;
916     f1_ = t.f1_;
917     return *this;
918   }
919 
920   T0 f0_;
921   T1 f1_;
922 };
923 
924 template <GTEST_3_TYPENAMES_(T)>
925 class GTEST_3_TUPLE_(T) {
926  public:
927   template <int k> friend class gtest_internal::Get;
928 
929   tuple() : f0_(), f1_(), f2_() {}
930 
931   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
932       GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
933 
934   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
935 
936   template <GTEST_3_TYPENAMES_(U)>
937   tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
938 
939   tuple& operator=(const tuple& t) { return CopyFrom(t); }
940 
941   template <GTEST_3_TYPENAMES_(U)>
942   tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
943     return CopyFrom(t);
944   }
945 
946   GTEST_DECLARE_TUPLE_AS_FRIEND_
947 
948   template <GTEST_3_TYPENAMES_(U)>
949   tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
950     f0_ = t.f0_;
951     f1_ = t.f1_;
952     f2_ = t.f2_;
953     return *this;
954   }
955 
956   T0 f0_;
957   T1 f1_;
958   T2 f2_;
959 };
960 
961 template <GTEST_4_TYPENAMES_(T)>
962 class GTEST_4_TUPLE_(T) {
963  public:
964   template <int k> friend class gtest_internal::Get;
965 
966   tuple() : f0_(), f1_(), f2_(), f3_() {}
967 
968   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
969       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
970       f3_(f3) {}
971 
972   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
973 
974   template <GTEST_4_TYPENAMES_(U)>
975   tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
976       f3_(t.f3_) {}
977 
978   tuple& operator=(const tuple& t) { return CopyFrom(t); }
979 
980   template <GTEST_4_TYPENAMES_(U)>
981   tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
982     return CopyFrom(t);
983   }
984 
985   GTEST_DECLARE_TUPLE_AS_FRIEND_
986 
987   template <GTEST_4_TYPENAMES_(U)>
988   tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
989     f0_ = t.f0_;
990     f1_ = t.f1_;
991     f2_ = t.f2_;
992     f3_ = t.f3_;
993     return *this;
994   }
995 
996   T0 f0_;
997   T1 f1_;
998   T2 f2_;
999   T3 f3_;
1000 };
1001 
1002 template <GTEST_5_TYPENAMES_(T)>
1003 class GTEST_5_TUPLE_(T) {
1004  public:
1005   template <int k> friend class gtest_internal::Get;
1006 
1007   tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
1008 
1009   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1010       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
1011       GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
1012 
1013   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1014       f4_(t.f4_) {}
1015 
1016   template <GTEST_5_TYPENAMES_(U)>
1017   tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1018       f3_(t.f3_), f4_(t.f4_) {}
1019 
1020   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1021 
1022   template <GTEST_5_TYPENAMES_(U)>
1023   tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
1024     return CopyFrom(t);
1025   }
1026 
1027   GTEST_DECLARE_TUPLE_AS_FRIEND_
1028 
1029   template <GTEST_5_TYPENAMES_(U)>
1030   tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
1031     f0_ = t.f0_;
1032     f1_ = t.f1_;
1033     f2_ = t.f2_;
1034     f3_ = t.f3_;
1035     f4_ = t.f4_;
1036     return *this;
1037   }
1038 
1039   T0 f0_;
1040   T1 f1_;
1041   T2 f2_;
1042   T3 f3_;
1043   T4 f4_;
1044 };
1045 
1046 template <GTEST_6_TYPENAMES_(T)>
1047 class GTEST_6_TUPLE_(T) {
1048  public:
1049   template <int k> friend class gtest_internal::Get;
1050 
1051   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
1052 
1053   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1054       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1055       GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1056       f5_(f5) {}
1057 
1058   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1059       f4_(t.f4_), f5_(t.f5_) {}
1060 
1061   template <GTEST_6_TYPENAMES_(U)>
1062   tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1063       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
1064 
1065   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1066 
1067   template <GTEST_6_TYPENAMES_(U)>
1068   tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
1069     return CopyFrom(t);
1070   }
1071 
1072   GTEST_DECLARE_TUPLE_AS_FRIEND_
1073 
1074   template <GTEST_6_TYPENAMES_(U)>
1075   tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
1076     f0_ = t.f0_;
1077     f1_ = t.f1_;
1078     f2_ = t.f2_;
1079     f3_ = t.f3_;
1080     f4_ = t.f4_;
1081     f5_ = t.f5_;
1082     return *this;
1083   }
1084 
1085   T0 f0_;
1086   T1 f1_;
1087   T2 f2_;
1088   T3 f3_;
1089   T4 f4_;
1090   T5 f5_;
1091 };
1092 
1093 template <GTEST_7_TYPENAMES_(T)>
1094 class GTEST_7_TUPLE_(T) {
1095  public:
1096   template <int k> friend class gtest_internal::Get;
1097 
1098   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
1099 
1100   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1101       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1102       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
1103       f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
1104 
1105   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1106       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1107 
1108   template <GTEST_7_TYPENAMES_(U)>
1109   tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1110       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1111 
1112   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1113 
1114   template <GTEST_7_TYPENAMES_(U)>
1115   tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
1116     return CopyFrom(t);
1117   }
1118 
1119   GTEST_DECLARE_TUPLE_AS_FRIEND_
1120 
1121   template <GTEST_7_TYPENAMES_(U)>
1122   tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
1123     f0_ = t.f0_;
1124     f1_ = t.f1_;
1125     f2_ = t.f2_;
1126     f3_ = t.f3_;
1127     f4_ = t.f4_;
1128     f5_ = t.f5_;
1129     f6_ = t.f6_;
1130     return *this;
1131   }
1132 
1133   T0 f0_;
1134   T1 f1_;
1135   T2 f2_;
1136   T3 f3_;
1137   T4 f4_;
1138   T5 f5_;
1139   T6 f6_;
1140 };
1141 
1142 template <GTEST_8_TYPENAMES_(T)>
1143 class GTEST_8_TUPLE_(T) {
1144  public:
1145   template <int k> friend class gtest_internal::Get;
1146 
1147   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
1148 
1149   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1150       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1151       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
1152       GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1153       f5_(f5), f6_(f6), f7_(f7) {}
1154 
1155   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1156       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1157 
1158   template <GTEST_8_TYPENAMES_(U)>
1159   tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1160       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1161 
1162   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1163 
1164   template <GTEST_8_TYPENAMES_(U)>
1165   tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
1166     return CopyFrom(t);
1167   }
1168 
1169   GTEST_DECLARE_TUPLE_AS_FRIEND_
1170 
1171   template <GTEST_8_TYPENAMES_(U)>
1172   tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
1173     f0_ = t.f0_;
1174     f1_ = t.f1_;
1175     f2_ = t.f2_;
1176     f3_ = t.f3_;
1177     f4_ = t.f4_;
1178     f5_ = t.f5_;
1179     f6_ = t.f6_;
1180     f7_ = t.f7_;
1181     return *this;
1182   }
1183 
1184   T0 f0_;
1185   T1 f1_;
1186   T2 f2_;
1187   T3 f3_;
1188   T4 f4_;
1189   T5 f5_;
1190   T6 f6_;
1191   T7 f7_;
1192 };
1193 
1194 template <GTEST_9_TYPENAMES_(T)>
1195 class GTEST_9_TUPLE_(T) {
1196  public:
1197   template <int k> friend class gtest_internal::Get;
1198 
1199   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
1200 
1201   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1202       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1203       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1204       GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1205       f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
1206 
1207   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1208       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1209 
1210   template <GTEST_9_TYPENAMES_(U)>
1211   tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1212       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1213 
1214   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1215 
1216   template <GTEST_9_TYPENAMES_(U)>
1217   tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
1218     return CopyFrom(t);
1219   }
1220 
1221   GTEST_DECLARE_TUPLE_AS_FRIEND_
1222 
1223   template <GTEST_9_TYPENAMES_(U)>
1224   tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
1225     f0_ = t.f0_;
1226     f1_ = t.f1_;
1227     f2_ = t.f2_;
1228     f3_ = t.f3_;
1229     f4_ = t.f4_;
1230     f5_ = t.f5_;
1231     f6_ = t.f6_;
1232     f7_ = t.f7_;
1233     f8_ = t.f8_;
1234     return *this;
1235   }
1236 
1237   T0 f0_;
1238   T1 f1_;
1239   T2 f2_;
1240   T3 f3_;
1241   T4 f4_;
1242   T5 f5_;
1243   T6 f6_;
1244   T7 f7_;
1245   T8 f8_;
1246 };
1247 
1248 template <GTEST_10_TYPENAMES_(T)>
1249 class tuple {
1250  public:
1251   template <int k> friend class gtest_internal::Get;
1252 
1253   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
1254       f9_() {}
1255 
1256   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1257       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1258       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1259       GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
1260       f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
1261 
1262   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1263       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
1264 
1265   template <GTEST_10_TYPENAMES_(U)>
1266   tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1267       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
1268       f9_(t.f9_) {}
1269 
1270   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1271 
1272   template <GTEST_10_TYPENAMES_(U)>
1273   tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
1274     return CopyFrom(t);
1275   }
1276 
1277   GTEST_DECLARE_TUPLE_AS_FRIEND_
1278 
1279   template <GTEST_10_TYPENAMES_(U)>
1280   tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
1281     f0_ = t.f0_;
1282     f1_ = t.f1_;
1283     f2_ = t.f2_;
1284     f3_ = t.f3_;
1285     f4_ = t.f4_;
1286     f5_ = t.f5_;
1287     f6_ = t.f6_;
1288     f7_ = t.f7_;
1289     f8_ = t.f8_;
1290     f9_ = t.f9_;
1291     return *this;
1292   }
1293 
1294   T0 f0_;
1295   T1 f1_;
1296   T2 f2_;
1297   T3 f3_;
1298   T4 f4_;
1299   T5 f5_;
1300   T6 f6_;
1301   T7 f7_;
1302   T8 f8_;
1303   T9 f9_;
1304 };
1305 
1306 // 6.1.3.2 Tuple creation functions.
1307 
1308 // Known limitations: we don't support passing an
1309 // std::tr1::reference_wrapper<T> to make_tuple().  And we don't
1310 // implement tie().
1311 
1312 inline tuple<> make_tuple() { return tuple<>(); }
1313 
1314 template <GTEST_1_TYPENAMES_(T)>
1315 inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
1316   return GTEST_1_TUPLE_(T)(f0);
1317 }
1318 
1319 template <GTEST_2_TYPENAMES_(T)>
1320 inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
1321   return GTEST_2_TUPLE_(T)(f0, f1);
1322 }
1323 
1324 template <GTEST_3_TYPENAMES_(T)>
1325 inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
1326   return GTEST_3_TUPLE_(T)(f0, f1, f2);
1327 }
1328 
1329 template <GTEST_4_TYPENAMES_(T)>
1330 inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1331     const T3& f3) {
1332   return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
1333 }
1334 
1335 template <GTEST_5_TYPENAMES_(T)>
1336 inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1337     const T3& f3, const T4& f4) {
1338   return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
1339 }
1340 
1341 template <GTEST_6_TYPENAMES_(T)>
1342 inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1343     const T3& f3, const T4& f4, const T5& f5) {
1344   return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
1345 }
1346 
1347 template <GTEST_7_TYPENAMES_(T)>
1348 inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1349     const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
1350   return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
1351 }
1352 
1353 template <GTEST_8_TYPENAMES_(T)>
1354 inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1355     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
1356   return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
1357 }
1358 
1359 template <GTEST_9_TYPENAMES_(T)>
1360 inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1361     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1362     const T8& f8) {
1363   return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
1364 }
1365 
1366 template <GTEST_10_TYPENAMES_(T)>
1367 inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1368     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1369     const T8& f8, const T9& f9) {
1370   return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
1371 }
1372 
1373 // 6.1.3.3 Tuple helper classes.
1374 
1375 template <typename Tuple> struct tuple_size;
1376 
1377 template <GTEST_0_TYPENAMES_(T)>
1378 struct tuple_size<GTEST_0_TUPLE_(T) > {
1379   static const int value = 0;
1380 };
1381 
1382 template <GTEST_1_TYPENAMES_(T)>
1383 struct tuple_size<GTEST_1_TUPLE_(T) > {
1384   static const int value = 1;
1385 };
1386 
1387 template <GTEST_2_TYPENAMES_(T)>
1388 struct tuple_size<GTEST_2_TUPLE_(T) > {
1389   static const int value = 2;
1390 };
1391 
1392 template <GTEST_3_TYPENAMES_(T)>
1393 struct tuple_size<GTEST_3_TUPLE_(T) > {
1394   static const int value = 3;
1395 };
1396 
1397 template <GTEST_4_TYPENAMES_(T)>
1398 struct tuple_size<GTEST_4_TUPLE_(T) > {
1399   static const int value = 4;
1400 };
1401 
1402 template <GTEST_5_TYPENAMES_(T)>
1403 struct tuple_size<GTEST_5_TUPLE_(T) > {
1404   static const int value = 5;
1405 };
1406 
1407 template <GTEST_6_TYPENAMES_(T)>
1408 struct tuple_size<GTEST_6_TUPLE_(T) > {
1409   static const int value = 6;
1410 };
1411 
1412 template <GTEST_7_TYPENAMES_(T)>
1413 struct tuple_size<GTEST_7_TUPLE_(T) > {
1414   static const int value = 7;
1415 };
1416 
1417 template <GTEST_8_TYPENAMES_(T)>
1418 struct tuple_size<GTEST_8_TUPLE_(T) > {
1419   static const int value = 8;
1420 };
1421 
1422 template <GTEST_9_TYPENAMES_(T)>
1423 struct tuple_size<GTEST_9_TUPLE_(T) > {
1424   static const int value = 9;
1425 };
1426 
1427 template <GTEST_10_TYPENAMES_(T)>
1428 struct tuple_size<GTEST_10_TUPLE_(T) > {
1429   static const int value = 10;
1430 };
1431 
1432 template <int k, class Tuple>
1433 struct tuple_element {
1434   typedef typename gtest_internal::TupleElement<
1435       k < (tuple_size<Tuple>::value), k, Tuple>::type type;
1436 };
1437 
1438 #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
1439 
1440 // 6.1.3.4 Element access.
1441 
1442 namespace gtest_internal {
1443 
1444 template <>
1445 class Get<0> {
1446  public:
1447   template <class Tuple>
1448   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1449   Field(Tuple& t) { return t.f0_; }  // NOLINT
1450 
1451   template <class Tuple>
1452   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1453   ConstField(const Tuple& t) { return t.f0_; }
1454 };
1455 
1456 template <>
1457 class Get<1> {
1458  public:
1459   template <class Tuple>
1460   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1461   Field(Tuple& t) { return t.f1_; }  // NOLINT
1462 
1463   template <class Tuple>
1464   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1465   ConstField(const Tuple& t) { return t.f1_; }
1466 };
1467 
1468 template <>
1469 class Get<2> {
1470  public:
1471   template <class Tuple>
1472   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1473   Field(Tuple& t) { return t.f2_; }  // NOLINT
1474 
1475   template <class Tuple>
1476   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1477   ConstField(const Tuple& t) { return t.f2_; }
1478 };
1479 
1480 template <>
1481 class Get<3> {
1482  public:
1483   template <class Tuple>
1484   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1485   Field(Tuple& t) { return t.f3_; }  // NOLINT
1486 
1487   template <class Tuple>
1488   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1489   ConstField(const Tuple& t) { return t.f3_; }
1490 };
1491 
1492 template <>
1493 class Get<4> {
1494  public:
1495   template <class Tuple>
1496   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1497   Field(Tuple& t) { return t.f4_; }  // NOLINT
1498 
1499   template <class Tuple>
1500   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1501   ConstField(const Tuple& t) { return t.f4_; }
1502 };
1503 
1504 template <>
1505 class Get<5> {
1506  public:
1507   template <class Tuple>
1508   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1509   Field(Tuple& t) { return t.f5_; }  // NOLINT
1510 
1511   template <class Tuple>
1512   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1513   ConstField(const Tuple& t) { return t.f5_; }
1514 };
1515 
1516 template <>
1517 class Get<6> {
1518  public:
1519   template <class Tuple>
1520   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1521   Field(Tuple& t) { return t.f6_; }  // NOLINT
1522 
1523   template <class Tuple>
1524   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1525   ConstField(const Tuple& t) { return t.f6_; }
1526 };
1527 
1528 template <>
1529 class Get<7> {
1530  public:
1531   template <class Tuple>
1532   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1533   Field(Tuple& t) { return t.f7_; }  // NOLINT
1534 
1535   template <class Tuple>
1536   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1537   ConstField(const Tuple& t) { return t.f7_; }
1538 };
1539 
1540 template <>
1541 class Get<8> {
1542  public:
1543   template <class Tuple>
1544   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1545   Field(Tuple& t) { return t.f8_; }  // NOLINT
1546 
1547   template <class Tuple>
1548   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1549   ConstField(const Tuple& t) { return t.f8_; }
1550 };
1551 
1552 template <>
1553 class Get<9> {
1554  public:
1555   template <class Tuple>
1556   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1557   Field(Tuple& t) { return t.f9_; }  // NOLINT
1558 
1559   template <class Tuple>
1560   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1561   ConstField(const Tuple& t) { return t.f9_; }
1562 };
1563 
1564 }  // namespace gtest_internal
1565 
1566 template <int k, GTEST_10_TYPENAMES_(T)>
1567 GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1568 get(GTEST_10_TUPLE_(T)& t) {
1569   return gtest_internal::Get<k>::Field(t);
1570 }
1571 
1572 template <int k, GTEST_10_TYPENAMES_(T)>
1573 GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))
1574 get(const GTEST_10_TUPLE_(T)& t) {
1575   return gtest_internal::Get<k>::ConstField(t);
1576 }
1577 
1578 // 6.1.3.5 Relational operators
1579 
1580 // We only implement == and !=, as we don't have a need for the rest yet.
1581 
1582 namespace gtest_internal {
1583 
1584 // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
1585 // first k fields of t1 equals the first k fields of t2.
1586 // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
1587 // k1 != k2.
1588 template <int kSize1, int kSize2>
1589 struct SameSizeTuplePrefixComparator;
1590 
1591 template <>
1592 struct SameSizeTuplePrefixComparator<0, 0> {
1593   template <class Tuple1, class Tuple2>
1594   static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
1595     return true;
1596   }
1597 };
1598 
1599 template <int k>
1600 struct SameSizeTuplePrefixComparator<k, k> {
1601   template <class Tuple1, class Tuple2>
1602   static bool Eq(const Tuple1& t1, const Tuple2& t2) {
1603     return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
1604         ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
1605   }
1606 };
1607 
1608 }  // namespace gtest_internal
1609 
1610 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1611 inline bool operator==(const GTEST_10_TUPLE_(T)& t,
1612                        const GTEST_10_TUPLE_(U)& u) {
1613   return gtest_internal::SameSizeTuplePrefixComparator<
1614       tuple_size<GTEST_10_TUPLE_(T) >::value,
1615       tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
1616 }
1617 
1618 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1619 inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
1620                        const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
1621 
1622 // 6.1.4 Pairs.
1623 // Unimplemented.
1624 
1625 }  // namespace tr1
1626 }  // namespace std
1627 
1628 #undef GTEST_0_TUPLE_
1629 #undef GTEST_1_TUPLE_
1630 #undef GTEST_2_TUPLE_
1631 #undef GTEST_3_TUPLE_
1632 #undef GTEST_4_TUPLE_
1633 #undef GTEST_5_TUPLE_
1634 #undef GTEST_6_TUPLE_
1635 #undef GTEST_7_TUPLE_
1636 #undef GTEST_8_TUPLE_
1637 #undef GTEST_9_TUPLE_
1638 #undef GTEST_10_TUPLE_
1639 
1640 #undef GTEST_0_TYPENAMES_
1641 #undef GTEST_1_TYPENAMES_
1642 #undef GTEST_2_TYPENAMES_
1643 #undef GTEST_3_TYPENAMES_
1644 #undef GTEST_4_TYPENAMES_
1645 #undef GTEST_5_TYPENAMES_
1646 #undef GTEST_6_TYPENAMES_
1647 #undef GTEST_7_TYPENAMES_
1648 #undef GTEST_8_TYPENAMES_
1649 #undef GTEST_9_TYPENAMES_
1650 #undef GTEST_10_TYPENAMES_
1651 
1652 #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
1653 #undef GTEST_BY_REF_
1654 #undef GTEST_ADD_REF_
1655 #undef GTEST_TUPLE_ELEMENT_
1656 
1657 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1658 # elif GTEST_ENV_HAS_STD_TUPLE_
1659 #  include <tuple>
1660 // C++11 puts its tuple into the ::std namespace rather than
1661 // ::std::tr1.  gtest expects tuple to live in ::std::tr1, so put it there.
1662 // This causes undefined behavior, but supported compilers react in
1663 // the way we intend.
1664 namespace std {
1665 namespace tr1 {
1666 using ::std::get;
1667 using ::std::make_tuple;
1668 using ::std::tuple;
1669 using ::std::tuple_element;
1670 using ::std::tuple_size;
1671 }
1672 }
1673 
1674 # elif GTEST_OS_SYMBIAN
1675 
1676 // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
1677 // use STLport's tuple implementation, which unfortunately doesn't
1678 // work as the copy of STLport distributed with Symbian is incomplete.
1679 // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
1680 // use its own tuple implementation.
1681 #  ifdef BOOST_HAS_TR1_TUPLE
1682 #   undef BOOST_HAS_TR1_TUPLE
1683 #  endif  // BOOST_HAS_TR1_TUPLE
1684 
1685 // This prevents <boost/tr1/detail/config.hpp>, which defines
1686 // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
1687 #  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
1688 #  include <tuple>
1689 
1690 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
1691 // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does
1692 // not conform to the TR1 spec, which requires the header to be <tuple>.
1693 
1694 #  if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1695 // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
1696 // which is #included by <tr1/tuple>, to not compile when RTTI is
1697 // disabled.  _TR1_FUNCTIONAL is the header guard for
1698 // <tr1/functional>.  Hence the following #define is a hack to prevent
1699 // <tr1/functional> from being included.
1700 #   define _TR1_FUNCTIONAL 1
1701 #   include <tr1/tuple>
1702 #   undef _TR1_FUNCTIONAL  // Allows the user to #include
1703                         // <tr1/functional> if he chooses to.
1704 #  else
1705 #   include <tr1/tuple>  // NOLINT
1706 #  endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1707 
1708 # else
1709 // If the compiler is not GCC 4.0+, we assume the user is using a
1710 // spec-conforming TR1 implementation.
1711 #  include <tuple>  // NOLINT
1712 # endif  // GTEST_USE_OWN_TR1_TUPLE
1713 
1714 #endif  // GTEST_HAS_TR1_TUPLE
1715 
1716 // Determines whether clone(2) is supported.
1717 // Usually it will only be available on Linux, excluding
1718 // Linux on the Itanium architecture.
1719 // Also see http://linux.die.net/man/2/clone.
1720 #ifndef GTEST_HAS_CLONE
1721 // The user didn't tell us, so we need to figure it out.
1722 
1723 # if GTEST_OS_LINUX && !defined(__ia64__)
1724 #  if GTEST_OS_LINUX_ANDROID
1725 // On Android, clone() is only available on ARM starting with Gingerbread.
1726 #    if defined(__arm__) && __ANDROID_API__ >= 9
1727 #     define GTEST_HAS_CLONE 1
1728 #    else
1729 #     define GTEST_HAS_CLONE 0
1730 #    endif
1731 #  else
1732 #   define GTEST_HAS_CLONE 1
1733 #  endif
1734 # else
1735 #  define GTEST_HAS_CLONE 0
1736 # endif  // GTEST_OS_LINUX && !defined(__ia64__)
1737 
1738 #endif  // GTEST_HAS_CLONE
1739 
1740 // Determines whether to support stream redirection. This is used to test
1741 // output correctness and to implement death tests.
1742 #ifndef GTEST_HAS_STREAM_REDIRECTION
1743 // By default, we assume that stream redirection is supported on all
1744 // platforms except known mobile ones.
1745 # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
1746 #  define GTEST_HAS_STREAM_REDIRECTION 0
1747 # else
1748 #  define GTEST_HAS_STREAM_REDIRECTION 1
1749 # endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
1750 #endif  // GTEST_HAS_STREAM_REDIRECTION
1751 
1752 // Determines whether to support death tests.
1753 // Google Test does not support death tests for VC 7.1 and earlier as
1754 // abort() in a VC 7.1 application compiled as GUI in debug config
1755 // pops up a dialog window that cannot be suppressed programmatically.
1756 #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
1757      (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \
1758      (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
1759      GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
1760      GTEST_OS_OPENBSD || GTEST_OS_QNX)
1761 # define GTEST_HAS_DEATH_TEST 1
1762 # include <vector>  // NOLINT
1763 #endif
1764 
1765 // We don't support MSVC 7.1 with exceptions disabled now.  Therefore
1766 // all the compilers we care about are adequate for supporting
1767 // value-parameterized tests.
1768 #define GTEST_HAS_PARAM_TEST 1
1769 
1770 // Determines whether to support type-driven tests.
1771 
1772 // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
1773 // Sun Pro CC, IBM Visual Age, and HP aCC support.
1774 #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
1775     defined(__IBMCPP__) || defined(__HP_aCC)
1776 # define GTEST_HAS_TYPED_TEST 1
1777 # define GTEST_HAS_TYPED_TEST_P 1
1778 #endif
1779 
1780 // Determines whether to support Combine(). This only makes sense when
1781 // value-parameterized tests are enabled.  The implementation doesn't
1782 // work on Sun Studio since it doesn't understand templated conversion
1783 // operators.
1784 #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
1785 # define GTEST_HAS_COMBINE 1
1786 #endif
1787 
1788 // Determines whether the system compiler uses UTF-16 for encoding wide strings.
1789 #define GTEST_WIDE_STRING_USES_UTF16_ \
1790     (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
1791 
1792 // Determines whether test results can be streamed to a socket.
1793 #if GTEST_OS_LINUX
1794 # define GTEST_CAN_STREAM_RESULTS_ 1
1795 #endif
1796 
1797 // Defines some utility macros.
1798 
1799 // The GNU compiler emits a warning if nested "if" statements are followed by
1800 // an "else" statement and braces are not used to explicitly disambiguate the
1801 // "else" binding.  This leads to problems with code like:
1802 //
1803 //   if (gate)
1804 //     ASSERT_*(condition) << "Some message";
1805 //
1806 // The "switch (0) case 0:" idiom is used to suppress this.
1807 #ifdef __INTEL_COMPILER
1808 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
1809 #else
1810 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default:  // NOLINT
1811 #endif
1812 
1813 // Use this annotation at the end of a struct/class definition to
1814 // prevent the compiler from optimizing away instances that are never
1815 // used.  This is useful when all interesting logic happens inside the
1816 // c'tor and / or d'tor.  Example:
1817 //
1818 //   struct Foo {
1819 //     Foo() { ... }
1820 //   } GTEST_ATTRIBUTE_UNUSED_;
1821 //
1822 // Also use it after a variable or parameter declaration to tell the
1823 // compiler the variable/parameter does not have to be used.
1824 #if defined(__GNUC__) && !defined(COMPILER_ICC)
1825 # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
1826 #else
1827 # define GTEST_ATTRIBUTE_UNUSED_
1828 #endif
1829 
1830 // A macro to disallow operator=
1831 // This should be used in the private: declarations for a class.
1832 #define GTEST_DISALLOW_ASSIGN_(type)\
1833   void operator=(type const &)
1834 
1835 // A macro to disallow copy constructor and operator=
1836 // This should be used in the private: declarations for a class.
1837 #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
1838   type(type const &);\
1839   GTEST_DISALLOW_ASSIGN_(type)
1840 
1841 // Tell the compiler to warn about unused return values for functions declared
1842 // with this macro.  The macro should be used on function declarations
1843 // following the argument list:
1844 //
1845 //   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
1846 #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
1847 # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
1848 #else
1849 # define GTEST_MUST_USE_RESULT_
1850 #endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
1851 
1852 // Determine whether the compiler supports Microsoft's Structured Exception
1853 // Handling.  This is supported by several Windows compilers but generally
1854 // does not exist on any other system.
1855 #ifndef GTEST_HAS_SEH
1856 // The user didn't tell us, so we need to figure it out.
1857 
1858 # if defined(_MSC_VER) || defined(__BORLANDC__)
1859 // These two compilers are known to support SEH.
1860 #  define GTEST_HAS_SEH 1
1861 # else
1862 // Assume no SEH.
1863 #  define GTEST_HAS_SEH 0
1864 # endif
1865 
1866 #endif  // GTEST_HAS_SEH
1867 
1868 #ifdef _MSC_VER
1869 
1870 # if GTEST_LINKED_AS_SHARED_LIBRARY
1871 #  define GTEST_API_ __declspec(dllimport)
1872 # elif GTEST_CREATE_SHARED_LIBRARY
1873 #  define GTEST_API_ __declspec(dllexport)
1874 # endif
1875 
1876 #endif  // _MSC_VER
1877 
1878 #ifndef GTEST_API_
1879 # define GTEST_API_
1880 #endif
1881 
1882 #ifdef __GNUC__
1883 // Ask the compiler to never inline a given function.
1884 # define GTEST_NO_INLINE_ __attribute__((noinline))
1885 #else
1886 # define GTEST_NO_INLINE_
1887 #endif
1888 
1889 // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
1890 #if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
1891 # define GTEST_HAS_CXXABI_H_ 1
1892 #else
1893 # define GTEST_HAS_CXXABI_H_ 0
1894 #endif
1895 
1896 namespace testing {
1897 
1898 class Message;
1899 
1900 namespace internal {
1901 
1902 // A secret type that Google Test users don't know about.  It has no
1903 // definition on purpose.  Therefore it's impossible to create a
1904 // Secret object, which is what we want.
1905 class Secret;
1906 
1907 // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
1908 // expression is true. For example, you could use it to verify the
1909 // size of a static array:
1910 //
1911 //   GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
1912 //                         content_type_names_incorrect_size);
1913 //
1914 // or to make sure a struct is smaller than a certain size:
1915 //
1916 //   GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
1917 //
1918 // The second argument to the macro is the name of the variable. If
1919 // the expression is false, most compilers will issue a warning/error
1920 // containing the name of the variable.
1921 
1922 template <bool>
1923 struct CompileAssert {
1924 };
1925 
1926 #define GTEST_COMPILE_ASSERT_(expr, msg) \
1927   typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
1928       msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
1929 
1930 // Implementation details of GTEST_COMPILE_ASSERT_:
1931 //
1932 // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
1933 //   elements (and thus is invalid) when the expression is false.
1934 //
1935 // - The simpler definition
1936 //
1937 //    #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
1938 //
1939 //   does not work, as gcc supports variable-length arrays whose sizes
1940 //   are determined at run-time (this is gcc's extension and not part
1941 //   of the C++ standard).  As a result, gcc fails to reject the
1942 //   following code with the simple definition:
1943 //
1944 //     int foo;
1945 //     GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
1946 //                                      // not a compile-time constant.
1947 //
1948 // - By using the type CompileAssert<(bool(expr))>, we ensures that
1949 //   expr is a compile-time constant.  (Template arguments must be
1950 //   determined at compile-time.)
1951 //
1952 // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
1953 //   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written
1954 //
1955 //     CompileAssert<bool(expr)>
1956 //
1957 //   instead, these compilers will refuse to compile
1958 //
1959 //     GTEST_COMPILE_ASSERT_(5 > 0, some_message);
1960 //
1961 //   (They seem to think the ">" in "5 > 0" marks the end of the
1962 //   template argument list.)
1963 //
1964 // - The array size is (bool(expr) ? 1 : -1), instead of simply
1965 //
1966 //     ((expr) ? 1 : -1).
1967 //
1968 //   This is to avoid running into a bug in MS VC 7.1, which
1969 //   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
1970 
1971 // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
1972 //
1973 // This template is declared, but intentionally undefined.
1974 template <typename T1, typename T2>
1975 struct StaticAssertTypeEqHelper;
1976 
1977 template <typename T>
1978 struct StaticAssertTypeEqHelper<T, T> {};
1979 
1980 #if GTEST_HAS_GLOBAL_STRING
1981 typedef ::string string;
1982 #else
1983 typedef ::std::string string;
1984 #endif  // GTEST_HAS_GLOBAL_STRING
1985 
1986 #if GTEST_HAS_GLOBAL_WSTRING
1987 typedef ::wstring wstring;
1988 #elif GTEST_HAS_STD_WSTRING
1989 typedef ::std::wstring wstring;
1990 #endif  // GTEST_HAS_GLOBAL_WSTRING
1991 
1992 // A helper for suppressing warnings on constant condition.  It just
1993 // returns 'condition'.
1994 GTEST_API_ bool IsTrue(bool condition);
1995 
1996 // Defines scoped_ptr.
1997 
1998 // This implementation of scoped_ptr is PARTIAL - it only contains
1999 // enough stuff to satisfy Google Test's need.
2000 template <typename T>
2001 class scoped_ptr {
2002  public:
2003   typedef T element_type;
2004 
2005   explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
2006   ~scoped_ptr() { reset(); }
2007 
2008   T& operator*() const { return *ptr_; }
2009   T* operator->() const { return ptr_; }
2010   T* get() const { return ptr_; }
2011 
2012   T* release() {
2013     T* const ptr = ptr_;
2014     ptr_ = NULL;
2015     return ptr;
2016   }
2017 
2018   void reset(T* p = NULL) {
2019     if (p != ptr_) {
2020       if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.
2021         delete ptr_;
2022       }
2023       ptr_ = p;
2024     }
2025   }
2026 
2027  private:
2028   T* ptr_;
2029 
2030   GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
2031 };
2032 
2033 // Defines RE.
2034 
2035 // A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended
2036 // Regular Expression syntax.
2037 class GTEST_API_ RE {
2038  public:
2039   // A copy constructor is required by the Standard to initialize object
2040   // references from r-values.
2041   RE(const RE& other) { Init(other.pattern()); }
2042 
2043   // Constructs an RE from a string.
2044   RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT
2045 
2046 #if GTEST_HAS_GLOBAL_STRING
2047 
2048   RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT
2049 
2050 #endif  // GTEST_HAS_GLOBAL_STRING
2051 
2052   RE(const char* regex) { Init(regex); }  // NOLINT
2053   ~RE();
2054 
2055   // Returns the string representation of the regex.
2056   const char* pattern() const { return pattern_; }
2057 
2058   // FullMatch(str, re) returns true iff regular expression re matches
2059   // the entire str.
2060   // PartialMatch(str, re) returns true iff regular expression re
2061   // matches a substring of str (including str itself).
2062   //
2063   // TODO(wan@google.com): make FullMatch() and PartialMatch() work
2064   // when str contains NUL characters.
2065   static bool FullMatch(const ::std::string& str, const RE& re) {
2066     return FullMatch(str.c_str(), re);
2067   }
2068   static bool PartialMatch(const ::std::string& str, const RE& re) {
2069     return PartialMatch(str.c_str(), re);
2070   }
2071 
2072 #if GTEST_HAS_GLOBAL_STRING
2073 
2074   static bool FullMatch(const ::string& str, const RE& re) {
2075     return FullMatch(str.c_str(), re);
2076   }
2077   static bool PartialMatch(const ::string& str, const RE& re) {
2078     return PartialMatch(str.c_str(), re);
2079   }
2080 
2081 #endif  // GTEST_HAS_GLOBAL_STRING
2082 
2083   static bool FullMatch(const char* str, const RE& re);
2084   static bool PartialMatch(const char* str, const RE& re);
2085 
2086  private:
2087   void Init(const char* regex);
2088 
2089   // We use a const char* instead of an std::string, as Google Test used to be
2090   // used where std::string is not available.  TODO(wan@google.com): change to
2091   // std::string.
2092   const char* pattern_;
2093   bool is_valid_;
2094 
2095 #if GTEST_USES_POSIX_RE
2096 
2097   regex_t full_regex_;     // For FullMatch().
2098   regex_t partial_regex_;  // For PartialMatch().
2099 
2100 #else  // GTEST_USES_SIMPLE_RE
2101 
2102   const char* full_pattern_;  // For FullMatch();
2103 
2104 #endif
2105 
2106   GTEST_DISALLOW_ASSIGN_(RE);
2107 };
2108 
2109 // Formats a source file path and a line number as they would appear
2110 // in an error message from the compiler used to compile this code.
2111 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
2112 
2113 // Formats a file location for compiler-independent XML output.
2114 // Although this function is not platform dependent, we put it next to
2115 // FormatFileLocation in order to contrast the two functions.
2116 GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
2117                                                                int line);
2118 
2119 // Defines logging utilities:
2120 //   GTEST_LOG_(severity) - logs messages at the specified severity level. The
2121 //                          message itself is streamed into the macro.
2122 //   LogToStderr()  - directs all log messages to stderr.
2123 //   FlushInfoLog() - flushes informational log messages.
2124 
2125 enum GTestLogSeverity {
2126   GTEST_INFO,
2127   GTEST_WARNING,
2128   GTEST_ERROR,
2129   GTEST_FATAL
2130 };
2131 
2132 // Formats log entry severity, provides a stream object for streaming the
2133 // log message, and terminates the message with a newline when going out of
2134 // scope.
2135 class GTEST_API_ GTestLog {
2136  public:
2137   GTestLog(GTestLogSeverity severity, const char* file, int line);
2138 
2139   // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
2140   ~GTestLog();
2141 
2142   ::std::ostream& GetStream() { return ::std::cerr; }
2143 
2144  private:
2145   const GTestLogSeverity severity_;
2146 
2147   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
2148 };
2149 
2150 #define GTEST_LOG_(severity) \
2151     ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
2152                                   __FILE__, __LINE__).GetStream()
2153 
2154 inline void LogToStderr() {}
2155 inline void FlushInfoLog() { fflush(NULL); }
2156 
2157 // INTERNAL IMPLEMENTATION - DO NOT USE.
2158 //
2159 // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
2160 // is not satisfied.
2161 //  Synopsys:
2162 //    GTEST_CHECK_(boolean_condition);
2163 //     or
2164 //    GTEST_CHECK_(boolean_condition) << "Additional message";
2165 //
2166 //    This checks the condition and if the condition is not satisfied
2167 //    it prints message about the condition violation, including the
2168 //    condition itself, plus additional message streamed into it, if any,
2169 //    and then it aborts the program. It aborts the program irrespective of
2170 //    whether it is built in the debug mode or not.
2171 #define GTEST_CHECK_(condition) \
2172     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
2173     if (::testing::internal::IsTrue(condition)) \
2174       ; \
2175     else \
2176       GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
2177 
2178 // An all-mode assert to verify that the given POSIX-style function
2179 // call returns 0 (indicating success).  Known limitation: this
2180 // doesn't expand to a balanced 'if' statement, so enclose the macro
2181 // in {} if you need to use it as the only statement in an 'if'
2182 // branch.
2183 #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
2184   if (const int gtest_error = (posix_call)) \
2185     GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
2186                       << gtest_error
2187 
2188 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
2189 //
2190 // Use ImplicitCast_ as a safe version of static_cast for upcasting in
2191 // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
2192 // const Foo*).  When you use ImplicitCast_, the compiler checks that
2193 // the cast is safe.  Such explicit ImplicitCast_s are necessary in
2194 // surprisingly many situations where C++ demands an exact type match
2195 // instead of an argument type convertible to a target type.
2196 //
2197 // The syntax for using ImplicitCast_ is the same as for static_cast:
2198 //
2199 //   ImplicitCast_<ToType>(expr)
2200 //
2201 // ImplicitCast_ would have been part of the C++ standard library,
2202 // but the proposal was submitted too late.  It will probably make
2203 // its way into the language in the future.
2204 //
2205 // This relatively ugly name is intentional. It prevents clashes with
2206 // similar functions users may have (e.g., implicit_cast). The internal
2207 // namespace alone is not enough because the function can be found by ADL.
2208 template<typename To>
2209 inline To ImplicitCast_(To x) { return x; }
2210 
2211 // When you upcast (that is, cast a pointer from type Foo to type
2212 // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
2213 // always succeed.  When you downcast (that is, cast a pointer from
2214 // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
2215 // how do you know the pointer is really of type SubclassOfFoo?  It
2216 // could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,
2217 // when you downcast, you should use this macro.  In debug mode, we
2218 // use dynamic_cast<> to double-check the downcast is legal (we die
2219 // if it's not).  In normal mode, we do the efficient static_cast<>
2220 // instead.  Thus, it's important to test in debug mode to make sure
2221 // the cast is legal!
2222 //    This is the only place in the code we should use dynamic_cast<>.
2223 // In particular, you SHOULDN'T be using dynamic_cast<> in order to
2224 // do RTTI (eg code like this:
2225 //    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
2226 //    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
2227 // You should design the code some other way not to need this.
2228 //
2229 // This relatively ugly name is intentional. It prevents clashes with
2230 // similar functions users may have (e.g., down_cast). The internal
2231 // namespace alone is not enough because the function can be found by ADL.
2232 template<typename To, typename From>  // use like this: DownCast_<T*>(foo);
2233 inline To DownCast_(From* f) {  // so we only accept pointers
2234   // Ensures that To is a sub-type of From *.  This test is here only
2235   // for compile-time type checking, and has no overhead in an
2236   // optimized build at run-time, as it will be optimized away
2237   // completely.
2238   if (false) {
2239     const To to = NULL;
2240     ::testing::internal::ImplicitCast_<From*>(to);
2241   }
2242 
2243 #if GTEST_HAS_RTTI
2244   // RTTI: debug mode only!
2245   GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
2246 #endif
2247   return static_cast<To>(f);
2248 }
2249 
2250 // Downcasts the pointer of type Base to Derived.
2251 // Derived must be a subclass of Base. The parameter MUST
2252 // point to a class of type Derived, not any subclass of it.
2253 // When RTTI is available, the function performs a runtime
2254 // check to enforce this.
2255 template <class Derived, class Base>
2256 Derived* CheckedDowncastToActualType(Base* base) {
2257 #if GTEST_HAS_RTTI
2258   GTEST_CHECK_(typeid(*base) == typeid(Derived));
2259   return dynamic_cast<Derived*>(base);  // NOLINT
2260 #else
2261   return static_cast<Derived*>(base);  // Poor man's downcast.
2262 #endif
2263 }
2264 
2265 #if GTEST_HAS_STREAM_REDIRECTION
2266 
2267 // Defines the stderr capturer:
2268 //   CaptureStdout     - starts capturing stdout.
2269 //   GetCapturedStdout - stops capturing stdout and returns the captured string.
2270 //   CaptureStderr     - starts capturing stderr.
2271 //   GetCapturedStderr - stops capturing stderr and returns the captured string.
2272 //
2273 GTEST_API_ void CaptureStdout();
2274 GTEST_API_ std::string GetCapturedStdout();
2275 GTEST_API_ void CaptureStderr();
2276 GTEST_API_ std::string GetCapturedStderr();
2277 
2278 #endif  // GTEST_HAS_STREAM_REDIRECTION
2279 
2280 
2281 #if GTEST_HAS_DEATH_TEST
2282 
2283 const ::std::vector<testing::internal::string>& GetInjectableArgvs();
2284 void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
2285                              new_argvs);
2286 
2287 // A copy of all command line arguments.  Set by InitGoogleTest().
2288 extern ::std::vector<testing::internal::string> g_argvs;
2289 
2290 #endif  // GTEST_HAS_DEATH_TEST
2291 
2292 // Defines synchronization primitives.
2293 
2294 #if GTEST_HAS_PTHREAD
2295 
2296 // Sleeps for (roughly) n milli-seconds.  This function is only for
2297 // testing Google Test's own constructs.  Don't use it in user tests,
2298 // either directly or indirectly.
2299 inline void SleepMilliseconds(int n) {
2300   const timespec time = {
2301     0,                  // 0 seconds.
2302     n * 1000L * 1000L,  // And n ms.
2303   };
2304   nanosleep(&time, NULL);
2305 }
2306 
2307 // Allows a controller thread to pause execution of newly created
2308 // threads until notified.  Instances of this class must be created
2309 // and destroyed in the controller thread.
2310 //
2311 // This class is only for testing Google Test's own constructs. Do not
2312 // use it in user tests, either directly or indirectly.
2313 class Notification {
2314  public:
2315   Notification() : notified_(false) {
2316     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2317   }
2318   ~Notification() {
2319     pthread_mutex_destroy(&mutex_);
2320   }
2321 
2322   // Notifies all threads created with this notification to start. Must
2323   // be called from the controller thread.
2324   void Notify() {
2325     pthread_mutex_lock(&mutex_);
2326     notified_ = true;
2327     pthread_mutex_unlock(&mutex_);
2328   }
2329 
2330   // Blocks until the controller thread notifies. Must be called from a test
2331   // thread.
2332   void WaitForNotification() {
2333     for (;;) {
2334       pthread_mutex_lock(&mutex_);
2335       const bool notified = notified_;
2336       pthread_mutex_unlock(&mutex_);
2337       if (notified)
2338         break;
2339       SleepMilliseconds(10);
2340     }
2341   }
2342 
2343  private:
2344   pthread_mutex_t mutex_;
2345   bool notified_;
2346 
2347   GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
2348 };
2349 
2350 // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
2351 // Consequently, it cannot select a correct instantiation of ThreadWithParam
2352 // in order to call its Run(). Introducing ThreadWithParamBase as a
2353 // non-templated base class for ThreadWithParam allows us to bypass this
2354 // problem.
2355 class ThreadWithParamBase {
2356  public:
2357   virtual ~ThreadWithParamBase() {}
2358   virtual void Run() = 0;
2359 };
2360 
2361 // pthread_create() accepts a pointer to a function type with the C linkage.
2362 // According to the Standard (7.5/1), function types with different linkages
2363 // are different even if they are otherwise identical.  Some compilers (for
2364 // example, SunStudio) treat them as different types.  Since class methods
2365 // cannot be defined with C-linkage we need to define a free C-function to
2366 // pass into pthread_create().
2367 extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
2368   static_cast<ThreadWithParamBase*>(thread)->Run();
2369   return NULL;
2370 }
2371 
2372 // Helper class for testing Google Test's multi-threading constructs.
2373 // To use it, write:
2374 //
2375 //   void ThreadFunc(int param) { /* Do things with param */ }
2376 //   Notification thread_can_start;
2377 //   ...
2378 //   // The thread_can_start parameter is optional; you can supply NULL.
2379 //   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
2380 //   thread_can_start.Notify();
2381 //
2382 // These classes are only for testing Google Test's own constructs. Do
2383 // not use them in user tests, either directly or indirectly.
2384 template <typename T>
2385 class ThreadWithParam : public ThreadWithParamBase {
2386  public:
2387   typedef void (*UserThreadFunc)(T);
2388 
2389   ThreadWithParam(
2390       UserThreadFunc func, T param, Notification* thread_can_start)
2391       : func_(func),
2392         param_(param),
2393         thread_can_start_(thread_can_start),
2394         finished_(false) {
2395     ThreadWithParamBase* const base = this;
2396     // The thread can be created only after all fields except thread_
2397     // have been initialized.
2398     GTEST_CHECK_POSIX_SUCCESS_(
2399         pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
2400   }
2401   ~ThreadWithParam() { Join(); }
2402 
2403   void Join() {
2404     if (!finished_) {
2405       GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
2406       finished_ = true;
2407     }
2408   }
2409 
2410   virtual void Run() {
2411     if (thread_can_start_ != NULL)
2412       thread_can_start_->WaitForNotification();
2413     func_(param_);
2414   }
2415 
2416  private:
2417   const UserThreadFunc func_;  // User-supplied thread function.
2418   const T param_;  // User-supplied parameter to the thread function.
2419   // When non-NULL, used to block execution until the controller thread
2420   // notifies.
2421   Notification* const thread_can_start_;
2422   bool finished_;  // true iff we know that the thread function has finished.
2423   pthread_t thread_;  // The native thread object.
2424 
2425   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
2426 };
2427 
2428 // MutexBase and Mutex implement mutex on pthreads-based platforms. They
2429 // are used in conjunction with class MutexLock:
2430 //
2431 //   Mutex mutex;
2432 //   ...
2433 //   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the end
2434 //                            // of the current scope.
2435 //
2436 // MutexBase implements behavior for both statically and dynamically
2437 // allocated mutexes.  Do not use MutexBase directly.  Instead, write
2438 // the following to define a static mutex:
2439 //
2440 //   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
2441 //
2442 // You can forward declare a static mutex like this:
2443 //
2444 //   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
2445 //
2446 // To create a dynamic mutex, just define an object of type Mutex.
2447 class MutexBase {
2448  public:
2449   // Acquires this mutex.
2450   void Lock() {
2451     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
2452     owner_ = pthread_self();
2453     has_owner_ = true;
2454   }
2455 
2456   // Releases this mutex.
2457   void Unlock() {
2458     // Since the lock is being released the owner_ field should no longer be
2459     // considered valid. We don't protect writing to has_owner_ here, as it's
2460     // the caller's responsibility to ensure that the current thread holds the
2461     // mutex when this is called.
2462     has_owner_ = false;
2463     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
2464   }
2465 
2466   // Does nothing if the current thread holds the mutex. Otherwise, crashes
2467   // with high probability.
2468   void AssertHeld() const {
2469     GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
2470         << "The current thread is not holding the mutex @" << this;
2471   }
2472 
2473   // A static mutex may be used before main() is entered.  It may even
2474   // be used before the dynamic initialization stage.  Therefore we
2475   // must be able to initialize a static mutex object at link time.
2476   // This means MutexBase has to be a POD and its member variables
2477   // have to be public.
2478  public:
2479   pthread_mutex_t mutex_;  // The underlying pthread mutex.
2480   // has_owner_ indicates whether the owner_ field below contains a valid thread
2481   // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
2482   // accesses to the owner_ field should be protected by a check of this field.
2483   // An alternative might be to memset() owner_ to all zeros, but there's no
2484   // guarantee that a zero'd pthread_t is necessarily invalid or even different
2485   // from pthread_self().
2486   bool has_owner_;
2487   pthread_t owner_;  // The thread holding the mutex.
2488 };
2489 
2490 // Forward-declares a static mutex.
2491 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2492     extern ::testing::internal::MutexBase mutex
2493 
2494 // Defines and statically (i.e. at link time) initializes a static mutex.
2495 // The initialization list here does not explicitly initialize each field,
2496 // instead relying on default initialization for the unspecified fields. In
2497 // particular, the owner_ field (a pthread_t) is not explicitly initialized.
2498 // This allows initialization to work whether pthread_t is a scalar or struct.
2499 // The flag -Wmissing-field-initializers must not be specified for this to work.
2500 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
2501     ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
2502 
2503 // The Mutex class can only be used for mutexes created at runtime. It
2504 // shares its API with MutexBase otherwise.
2505 class Mutex : public MutexBase {
2506  public:
2507   Mutex() {
2508     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2509     has_owner_ = false;
2510   }
2511   ~Mutex() {
2512     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
2513   }
2514 
2515  private:
2516   GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
2517 };
2518 
2519 // We cannot name this class MutexLock as the ctor declaration would
2520 // conflict with a macro named MutexLock, which is defined on some
2521 // platforms.  Hence the typedef trick below.
2522 class GTestMutexLock {
2523  public:
2524   explicit GTestMutexLock(MutexBase* mutex)
2525       : mutex_(mutex) { mutex_->Lock(); }
2526 
2527   ~GTestMutexLock() { mutex_->Unlock(); }
2528 
2529  private:
2530   MutexBase* const mutex_;
2531 
2532   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
2533 };
2534 
2535 typedef GTestMutexLock MutexLock;
2536 
2537 // Helpers for ThreadLocal.
2538 
2539 // pthread_key_create() requires DeleteThreadLocalValue() to have
2540 // C-linkage.  Therefore it cannot be templatized to access
2541 // ThreadLocal<T>.  Hence the need for class
2542 // ThreadLocalValueHolderBase.
2543 class ThreadLocalValueHolderBase {
2544  public:
2545   virtual ~ThreadLocalValueHolderBase() {}
2546 };
2547 
2548 // Called by pthread to delete thread-local data stored by
2549 // pthread_setspecific().
2550 extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
2551   delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
2552 }
2553 
2554 // Implements thread-local storage on pthreads-based systems.
2555 //
2556 //   // Thread 1
2557 //   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.
2558 //
2559 //   // Thread 2
2560 //   tl.set(150);  // Changes the value for thread 2 only.
2561 //   EXPECT_EQ(150, tl.get());
2562 //
2563 //   // Thread 1
2564 //   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.
2565 //   tl.set(200);
2566 //   EXPECT_EQ(200, tl.get());
2567 //
2568 // The template type argument T must have a public copy constructor.
2569 // In addition, the default ThreadLocal constructor requires T to have
2570 // a public default constructor.
2571 //
2572 // An object managed for a thread by a ThreadLocal instance is deleted
2573 // when the thread exits.  Or, if the ThreadLocal instance dies in
2574 // that thread, when the ThreadLocal dies.  It's the user's
2575 // responsibility to ensure that all other threads using a ThreadLocal
2576 // have exited when it dies, or the per-thread objects for those
2577 // threads will not be deleted.
2578 //
2579 // Google Test only uses global ThreadLocal objects.  That means they
2580 // will die after main() has returned.  Therefore, no per-thread
2581 // object managed by Google Test will be leaked as long as all threads
2582 // using Google Test have exited when main() returns.
2583 template <typename T>
2584 class ThreadLocal {
2585  public:
2586   ThreadLocal() : key_(CreateKey()),
2587                   default_() {}
2588   explicit ThreadLocal(const T& value) : key_(CreateKey()),
2589                                          default_(value) {}
2590 
2591   ~ThreadLocal() {
2592     // Destroys the managed object for the current thread, if any.
2593     DeleteThreadLocalValue(pthread_getspecific(key_));
2594 
2595     // Releases resources associated with the key.  This will *not*
2596     // delete managed objects for other threads.
2597     GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
2598   }
2599 
2600   T* pointer() { return GetOrCreateValue(); }
2601   const T* pointer() const { return GetOrCreateValue(); }
2602   const T& get() const { return *pointer(); }
2603   void set(const T& value) { *pointer() = value; }
2604 
2605  private:
2606   // Holds a value of type T.
2607   class ValueHolder : public ThreadLocalValueHolderBase {
2608    public:
2609     explicit ValueHolder(const T& value) : value_(value) {}
2610 
2611     T* pointer() { return &value_; }
2612 
2613    private:
2614     T value_;
2615     GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
2616   };
2617 
2618   static pthread_key_t CreateKey() {
2619     pthread_key_t key;
2620     // When a thread exits, DeleteThreadLocalValue() will be called on
2621     // the object managed for that thread.
2622     GTEST_CHECK_POSIX_SUCCESS_(
2623         pthread_key_create(&key, &DeleteThreadLocalValue));
2624     return key;
2625   }
2626 
2627   T* GetOrCreateValue() const {
2628     ThreadLocalValueHolderBase* const holder =
2629         static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
2630     if (holder != NULL) {
2631       return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
2632     }
2633 
2634     ValueHolder* const new_holder = new ValueHolder(default_);
2635     ThreadLocalValueHolderBase* const holder_base = new_holder;
2636     GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
2637     return new_holder->pointer();
2638   }
2639 
2640   // A key pthreads uses for looking up per-thread values.
2641   const pthread_key_t key_;
2642   const T default_;  // The default value for each thread.
2643 
2644   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
2645 };
2646 
2647 # define GTEST_IS_THREADSAFE 1
2648 
2649 #else  // GTEST_HAS_PTHREAD
2650 
2651 // A dummy implementation of synchronization primitives (mutex, lock,
2652 // and thread-local variable).  Necessary for compiling Google Test where
2653 // mutex is not supported - using Google Test in multiple threads is not
2654 // supported on such platforms.
2655 
2656 class Mutex {
2657  public:
2658   Mutex() {}
2659   void Lock() {}
2660   void Unlock() {}
2661   void AssertHeld() const {}
2662 };
2663 
2664 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2665   extern ::testing::internal::Mutex mutex
2666 
2667 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
2668 
2669 class GTestMutexLock {
2670  public:
2671   explicit GTestMutexLock(Mutex*) {}  // NOLINT
2672 };
2673 
2674 typedef GTestMutexLock MutexLock;
2675 
2676 template <typename T>
2677 class ThreadLocal {
2678  public:
2679   ThreadLocal() : value_() {}
2680   explicit ThreadLocal(const T& value) : value_(value) {}
2681   T* pointer() { return &value_; }
2682   const T* pointer() const { return &value_; }
2683   const T& get() const { return value_; }
2684   void set(const T& value) { value_ = value; }
2685  private:
2686   T value_;
2687 };
2688 
2689 // The above synchronization primitives have dummy implementations.
2690 // Therefore Google Test is not thread-safe.
2691 # define GTEST_IS_THREADSAFE 0
2692 
2693 #endif  // GTEST_HAS_PTHREAD
2694 
2695 // Returns the number of threads running in the process, or 0 to indicate that
2696 // we cannot detect it.
2697 GTEST_API_ size_t GetThreadCount();
2698 
2699 // Passing non-POD classes through ellipsis (...) crashes the ARM
2700 // compiler and generates a warning in Sun Studio.  The Nokia Symbian
2701 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
2702 // for objects passed through ellipsis (...), failing for uncopyable
2703 // objects.  We define this to ensure that only POD is passed through
2704 // ellipsis on these systems.
2705 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
2706 // We lose support for NULL detection where the compiler doesn't like
2707 // passing non-POD classes through ellipsis (...).
2708 # define GTEST_ELLIPSIS_NEEDS_POD_ 1
2709 #else
2710 # define GTEST_CAN_COMPARE_NULL 1
2711 #endif
2712 
2713 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
2714 // const T& and const T* in a function template.  These compilers
2715 // _can_ decide between class template specializations for T and T*,
2716 // so a tr1::type_traits-like is_pointer works.
2717 #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
2718 # define GTEST_NEEDS_IS_POINTER_ 1
2719 #endif
2720 
2721 template <bool bool_value>
2722 struct bool_constant {
2723   typedef bool_constant<bool_value> type;
2724   static const bool value = bool_value;
2725 };
2726 template <bool bool_value> const bool bool_constant<bool_value>::value;
2727 
2728 typedef bool_constant<false> false_type;
2729 typedef bool_constant<true> true_type;
2730 
2731 template <typename T>
2732 struct is_pointer : public false_type {};
2733 
2734 template <typename T>
2735 struct is_pointer<T*> : public true_type {};
2736 
2737 template <typename Iterator>
2738 struct IteratorTraits {
2739   typedef typename Iterator::value_type value_type;
2740 };
2741 
2742 template <typename T>
2743 struct IteratorTraits<T*> {
2744   typedef T value_type;
2745 };
2746 
2747 template <typename T>
2748 struct IteratorTraits<const T*> {
2749   typedef T value_type;
2750 };
2751 
2752 #if GTEST_OS_WINDOWS
2753 # define GTEST_PATH_SEP_ "\\"
2754 # define GTEST_HAS_ALT_PATH_SEP_ 1
2755 // The biggest signed integer type the compiler supports.
2756 typedef __int64 BiggestInt;
2757 #else
2758 # define GTEST_PATH_SEP_ "/"
2759 # define GTEST_HAS_ALT_PATH_SEP_ 0
2760 typedef long long BiggestInt;  // NOLINT
2761 #endif  // GTEST_OS_WINDOWS
2762 
2763 // Utilities for char.
2764 
2765 // isspace(int ch) and friends accept an unsigned char or EOF.  char
2766 // may be signed, depending on the compiler (or compiler flags).
2767 // Therefore we need to cast a char to unsigned char before calling
2768 // isspace(), etc.
2769 
2770 inline bool IsAlpha(char ch) {
2771   return isalpha(static_cast<unsigned char>(ch)) != 0;
2772 }
2773 inline bool IsAlNum(char ch) {
2774   return isalnum(static_cast<unsigned char>(ch)) != 0;
2775 }
2776 inline bool IsDigit(char ch) {
2777   return isdigit(static_cast<unsigned char>(ch)) != 0;
2778 }
2779 inline bool IsLower(char ch) {
2780   return islower(static_cast<unsigned char>(ch)) != 0;
2781 }
2782 inline bool IsSpace(char ch) {
2783   return isspace(static_cast<unsigned char>(ch)) != 0;
2784 }
2785 inline bool IsUpper(char ch) {
2786   return isupper(static_cast<unsigned char>(ch)) != 0;
2787 }
2788 inline bool IsXDigit(char ch) {
2789   return isxdigit(static_cast<unsigned char>(ch)) != 0;
2790 }
2791 inline bool IsXDigit(wchar_t ch) {
2792   const unsigned char low_byte = static_cast<unsigned char>(ch);
2793   return ch == low_byte && isxdigit(low_byte) != 0;
2794 }
2795 
2796 inline char ToLower(char ch) {
2797   return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
2798 }
2799 inline char ToUpper(char ch) {
2800   return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
2801 }
2802 
2803 // The testing::internal::posix namespace holds wrappers for common
2804 // POSIX functions.  These wrappers hide the differences between
2805 // Windows/MSVC and POSIX systems.  Since some compilers define these
2806 // standard functions as macros, the wrapper cannot have the same name
2807 // as the wrapped function.
2808 
2809 namespace posix {
2810 
2811 // Functions with a different name on Windows.
2812 
2813 #if GTEST_OS_WINDOWS
2814 
2815 typedef struct _stat StatStruct;
2816 
2817 # ifdef __BORLANDC__
2818 inline int IsATTY(int fd) { return isatty(fd); }
2819 inline int StrCaseCmp(const char* s1, const char* s2) {
2820   return stricmp(s1, s2);
2821 }
2822 inline char* StrDup(const char* src) { return strdup(src); }
2823 # else  // !__BORLANDC__
2824 #  if GTEST_OS_WINDOWS_MOBILE
2825 inline int IsATTY(int /* fd */) { return 0; }
2826 #  else
2827 inline int IsATTY(int fd) { return _isatty(fd); }
2828 #  endif  // GTEST_OS_WINDOWS_MOBILE
2829 inline int StrCaseCmp(const char* s1, const char* s2) {
2830   return _stricmp(s1, s2);
2831 }
2832 inline char* StrDup(const char* src) { return _strdup(src); }
2833 # endif  // __BORLANDC__
2834 
2835 # if GTEST_OS_WINDOWS_MOBILE
2836 inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
2837 // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
2838 // time and thus not defined there.
2839 # else
2840 inline int FileNo(FILE* file) { return _fileno(file); }
2841 inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
2842 inline int RmDir(const char* dir) { return _rmdir(dir); }
2843 inline bool IsDir(const StatStruct& st) {
2844   return (_S_IFDIR & st.st_mode) != 0;
2845 }
2846 # endif  // GTEST_OS_WINDOWS_MOBILE
2847 
2848 #else
2849 
2850 typedef struct stat StatStruct;
2851 
2852 inline int FileNo(FILE* file) { return fileno(file); }
2853 inline int IsATTY(int fd) { return isatty(fd); }
2854 inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
2855 inline int StrCaseCmp(const char* s1, const char* s2) {
2856   return strcasecmp(s1, s2);
2857 }
2858 inline char* StrDup(const char* src) { return strdup(src); }
2859 inline int RmDir(const char* dir) { return rmdir(dir); }
2860 inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
2861 
2862 #endif  // GTEST_OS_WINDOWS
2863 
2864 // Functions deprecated by MSVC 8.0.
2865 
2866 #ifdef _MSC_VER
2867 // Temporarily disable warning 4996 (deprecated function).
2868 # pragma warning(push)
2869 # pragma warning(disable:4996)
2870 #endif
2871 
2872 inline const char* StrNCpy(char* dest, const char* src, size_t n) {
2873   return strncpy(dest, src, n);
2874 }
2875 
2876 // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
2877 // StrError() aren't needed on Windows CE at this time and thus not
2878 // defined there.
2879 
2880 #if !GTEST_OS_WINDOWS_MOBILE
2881 inline int ChDir(const char* dir) { return chdir(dir); }
2882 #endif
2883 inline FILE* FOpen(const char* path, const char* mode) {
2884   return fopen(path, mode);
2885 }
2886 #if !GTEST_OS_WINDOWS_MOBILE
2887 inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
2888   return freopen(path, mode, stream);
2889 }
2890 inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
2891 #endif
2892 inline int FClose(FILE* fp) { return fclose(fp); }
2893 #if !GTEST_OS_WINDOWS_MOBILE
2894 inline int Read(int fd, void* buf, unsigned int count) {
2895   return static_cast<int>(read(fd, buf, count));
2896 }
2897 inline int Write(int fd, const void* buf, unsigned int count) {
2898   return static_cast<int>(write(fd, buf, count));
2899 }
2900 inline int Close(int fd) { return close(fd); }
2901 inline const char* StrError(int errnum) { return strerror(errnum); }
2902 #endif
2903 inline const char* GetEnv(const char* name) {
2904 #if GTEST_OS_WINDOWS_MOBILE
2905   // We are on Windows CE, which has no environment variables.
2906   return NULL;
2907 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
2908   // Environment variables which we programmatically clear will be set to the
2909   // empty string rather than unset (NULL).  Handle that case.
2910   const char* const env = getenv(name);
2911   return (env != NULL && env[0] != '\0') ? env : NULL;
2912 #else
2913   return getenv(name);
2914 #endif
2915 }
2916 
2917 #ifdef _MSC_VER
2918 # pragma warning(pop)  // Restores the warning state.
2919 #endif
2920 
2921 #if GTEST_OS_WINDOWS_MOBILE
2922 // Windows CE has no C library. The abort() function is used in
2923 // several places in Google Test. This implementation provides a reasonable
2924 // imitation of standard behaviour.
2925 void Abort();
2926 #else
2927 inline void Abort() { abort(); }
2928 #endif  // GTEST_OS_WINDOWS_MOBILE
2929 
2930 }  // namespace posix
2931 
2932 // MSVC "deprecates" snprintf and issues warnings wherever it is used.  In
2933 // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
2934 // MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate
2935 // function in order to achieve that.  We use macro definition here because
2936 // snprintf is a variadic function.
2937 #if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
2938 // MSVC 2005 and above support variadic macros.
2939 # define GTEST_SNPRINTF_(buffer, size, format, ...) \
2940      _snprintf_s(buffer, size, size, format, __VA_ARGS__)
2941 #elif defined(_MSC_VER)
2942 // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
2943 // complain about _snprintf.
2944 # define GTEST_SNPRINTF_ _snprintf
2945 #else
2946 # define GTEST_SNPRINTF_ snprintf
2947 #endif
2948 
2949 // The maximum number a BiggestInt can represent.  This definition
2950 // works no matter BiggestInt is represented in one's complement or
2951 // two's complement.
2952 //
2953 // We cannot rely on numeric_limits in STL, as __int64 and long long
2954 // are not part of standard C++ and numeric_limits doesn't need to be
2955 // defined for them.
2956 const BiggestInt kMaxBiggestInt =
2957     ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
2958 
2959 // This template class serves as a compile-time function from size to
2960 // type.  It maps a size in bytes to a primitive type with that
2961 // size. e.g.
2962 //
2963 //   TypeWithSize<4>::UInt
2964 //
2965 // is typedef-ed to be unsigned int (unsigned integer made up of 4
2966 // bytes).
2967 //
2968 // Such functionality should belong to STL, but I cannot find it
2969 // there.
2970 //
2971 // Google Test uses this class in the implementation of floating-point
2972 // comparison.
2973 //
2974 // For now it only handles UInt (unsigned int) as that's all Google Test
2975 // needs.  Other types can be easily added in the future if need
2976 // arises.
2977 template <size_t size>
2978 class TypeWithSize {
2979  public:
2980   // This prevents the user from using TypeWithSize<N> with incorrect
2981   // values of N.
2982   typedef void UInt;
2983 };
2984 
2985 // The specialization for size 4.
2986 template <>
2987 class TypeWithSize<4> {
2988  public:
2989   // unsigned int has size 4 in both gcc and MSVC.
2990   //
2991   // As base/basictypes.h doesn't compile on Windows, we cannot use
2992   // uint32, uint64, and etc here.
2993   typedef int Int;
2994   typedef unsigned int UInt;
2995 };
2996 
2997 // The specialization for size 8.
2998 template <>
2999 class TypeWithSize<8> {
3000  public:
3001 #if GTEST_OS_WINDOWS
3002   typedef __int64 Int;
3003   typedef unsigned __int64 UInt;
3004 #else
3005   typedef long long Int;  // NOLINT
3006   typedef unsigned long long UInt;  // NOLINT
3007 #endif  // GTEST_OS_WINDOWS
3008 };
3009 
3010 // Integer types of known sizes.
3011 typedef TypeWithSize<4>::Int Int32;
3012 typedef TypeWithSize<4>::UInt UInt32;
3013 typedef TypeWithSize<8>::Int Int64;
3014 typedef TypeWithSize<8>::UInt UInt64;
3015 typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
3016 
3017 // Utilities for command line flags and environment variables.
3018 
3019 // Macro for referencing flags.
3020 #define GTEST_FLAG(name) FLAGS_gtest_##name
3021 
3022 // Macros for declaring flags.
3023 #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
3024 #define GTEST_DECLARE_int32_(name) \
3025     GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
3026 #define GTEST_DECLARE_string_(name) \
3027     GTEST_API_ extern ::std::string GTEST_FLAG(name)
3028 
3029 // Macros for defining flags.
3030 #define GTEST_DEFINE_bool_(name, default_val, doc) \
3031     GTEST_API_ bool GTEST_FLAG(name) = (default_val)
3032 #define GTEST_DEFINE_int32_(name, default_val, doc) \
3033     GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
3034 #define GTEST_DEFINE_string_(name, default_val, doc) \
3035     GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
3036 
3037 // Thread annotations
3038 #define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
3039 #define GTEST_LOCK_EXCLUDED_(locks)
3040 
3041 // Parses 'str' for a 32-bit signed integer.  If successful, writes the result
3042 // to *value and returns true; otherwise leaves *value unchanged and returns
3043 // false.
3044 // TODO(chandlerc): Find a better way to refactor flag and environment parsing
3045 // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
3046 // function.
3047 bool ParseInt32(const Message& src_text, const char* str, Int32* value);
3048 
3049 // Parses a bool/Int32/string from the environment variable
3050 // corresponding to the given Google Test flag.
3051 bool BoolFromGTestEnv(const char* flag, bool default_val);
3052 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
3053 const char* StringFromGTestEnv(const char* flag, const char* default_val);
3054 
3055 }  // namespace internal
3056 }  // namespace testing
3057 
3058 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
3059 
3060 #if GTEST_OS_LINUX
3061 # include <stdlib.h>
3062 # include <sys/types.h>
3063 # include <sys/wait.h>
3064 # include <unistd.h>
3065 #endif  // GTEST_OS_LINUX
3066 
3067 #if GTEST_HAS_EXCEPTIONS
3068 # include <stdexcept>
3069 #endif
3070 
3071 #include <ctype.h>
3072 #include <float.h>
3073 #include <string.h>
3074 #include <iomanip>
3075 #include <limits>
3076 #include <set>
3077 
3078 // Copyright 2005, Google Inc.
3079 // All rights reserved.
3080 //
3081 // Redistribution and use in source and binary forms, with or without
3082 // modification, are permitted provided that the following conditions are
3083 // met:
3084 //
3085 //     * Redistributions of source code must retain the above copyright
3086 // notice, this list of conditions and the following disclaimer.
3087 //     * Redistributions in binary form must reproduce the above
3088 // copyright notice, this list of conditions and the following disclaimer
3089 // in the documentation and/or other materials provided with the
3090 // distribution.
3091 //     * Neither the name of Google Inc. nor the names of its
3092 // contributors may be used to endorse or promote products derived from
3093 // this software without specific prior written permission.
3094 //
3095 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3096 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3097 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3098 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3099 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3100 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3101 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3102 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3103 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3104 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3105 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3106 //
3107 // Author: wan@google.com (Zhanyong Wan)
3108 //
3109 // The Google C++ Testing Framework (Google Test)
3110 //
3111 // This header file defines the Message class.
3112 //
3113 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
3114 // leave some internal implementation details in this header file.
3115 // They are clearly marked by comments like this:
3116 //
3117 //   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
3118 //
3119 // Such code is NOT meant to be used by a user directly, and is subject
3120 // to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
3121 // program!
3122 
3123 #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3124 #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3125 
3126 #include <limits>
3127 
3128 
3129 // Ensures that there is at least one operator<< in the global namespace.
3130 // See Message& operator<<(...) below for why.
3131 void operator<<(const testing::internal::Secret&, int);
3132 
3133 namespace testing {
3134 
3135 // The Message class works like an ostream repeater.
3136 //
3137 // Typical usage:
3138 //
3139 //   1. You stream a bunch of values to a Message object.
3140 //      It will remember the text in a stringstream.
3141 //   2. Then you stream the Message object to an ostream.
3142 //      This causes the text in the Message to be streamed
3143 //      to the ostream.
3144 //
3145 // For example;
3146 //
3147 //   testing::Message foo;
3148 //   foo << 1 << " != " << 2;
3149 //   std::cout << foo;
3150 //
3151 // will print "1 != 2".
3152 //
3153 // Message is not intended to be inherited from.  In particular, its
3154 // destructor is not virtual.
3155 //
3156 // Note that stringstream behaves differently in gcc and in MSVC.  You
3157 // can stream a NULL char pointer to it in the former, but not in the
3158 // latter (it causes an access violation if you do).  The Message
3159 // class hides this difference by treating a NULL char pointer as
3160 // "(null)".
3161 class GTEST_API_ Message {
3162  private:
3163   // The type of basic IO manipulators (endl, ends, and flush) for
3164   // narrow streams.
3165   typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
3166 
3167  public:
3168   // Constructs an empty Message.
3169   Message();
3170 
3171   // Copy constructor.
3172   Message(const Message& msg) : ss_(new ::std::stringstream) {  // NOLINT
3173     *ss_ << msg.GetString();
3174   }
3175 
3176   // Constructs a Message from a C-string.
3177   explicit Message(const char* str) : ss_(new ::std::stringstream) {
3178     *ss_ << str;
3179   }
3180 
3181 #if GTEST_OS_SYMBIAN
3182   // Streams a value (either a pointer or not) to this object.
3183   template <typename T>
3184   inline Message& operator <<(const T& value) {
3185     StreamHelper(typename internal::is_pointer<T>::type(), value);
3186     return *this;
3187   }
3188 #else
3189   // Streams a non-pointer value to this object.
3190   template <typename T>
3191   inline Message& operator <<(const T& val) {
3192     // Some libraries overload << for STL containers.  These
3193     // overloads are defined in the global namespace instead of ::std.
3194     //
3195     // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
3196     // overloads are visible in either the std namespace or the global
3197     // namespace, but not other namespaces, including the testing
3198     // namespace which Google Test's Message class is in.
3199     //
3200     // To allow STL containers (and other types that has a << operator
3201     // defined in the global namespace) to be used in Google Test
3202     // assertions, testing::Message must access the custom << operator
3203     // from the global namespace.  With this using declaration,
3204     // overloads of << defined in the global namespace and those
3205     // visible via Koenig lookup are both exposed in this function.
3206     using ::operator <<;
3207     *ss_ << val;
3208     return *this;
3209   }
3210 
3211   // Streams a pointer value to this object.
3212   //
3213   // This function is an overload of the previous one.  When you
3214   // stream a pointer to a Message, this definition will be used as it
3215   // is more specialized.  (The C++ Standard, section
3216   // [temp.func.order].)  If you stream a non-pointer, then the
3217   // previous definition will be used.
3218   //
3219   // The reason for this overload is that streaming a NULL pointer to
3220   // ostream is undefined behavior.  Depending on the compiler, you
3221   // may get "0", "(nil)", "(null)", or an access violation.  To
3222   // ensure consistent result across compilers, we always treat NULL
3223   // as "(null)".
3224   template <typename T>
3225   inline Message& operator <<(T* const& pointer) {  // NOLINT
3226     if (pointer == NULL) {
3227       *ss_ << "(null)";
3228     } else {
3229       *ss_ << pointer;
3230     }
3231     return *this;
3232   }
3233 #endif  // GTEST_OS_SYMBIAN
3234 
3235   // Since the basic IO manipulators are overloaded for both narrow
3236   // and wide streams, we have to provide this specialized definition
3237   // of operator <<, even though its body is the same as the
3238   // templatized version above.  Without this definition, streaming
3239   // endl or other basic IO manipulators to Message will confuse the
3240   // compiler.
3241   Message& operator <<(BasicNarrowIoManip val) {
3242     *ss_ << val;
3243     return *this;
3244   }
3245 
3246   // Instead of 1/0, we want to see true/false for bool values.
3247   Message& operator <<(bool b) {
3248     return *this << (b ? "true" : "false");
3249   }
3250 
3251   // These two overloads allow streaming a wide C string to a Message
3252   // using the UTF-8 encoding.
3253   Message& operator <<(const wchar_t* wide_c_str);
3254   Message& operator <<(wchar_t* wide_c_str);
3255 
3256 #if GTEST_HAS_STD_WSTRING
3257   // Converts the given wide string to a narrow string using the UTF-8
3258   // encoding, and streams the result to this Message object.
3259   Message& operator <<(const ::std::wstring& wstr);
3260 #endif  // GTEST_HAS_STD_WSTRING
3261 
3262 #if GTEST_HAS_GLOBAL_WSTRING
3263   // Converts the given wide string to a narrow string using the UTF-8
3264   // encoding, and streams the result to this Message object.
3265   Message& operator <<(const ::wstring& wstr);
3266 #endif  // GTEST_HAS_GLOBAL_WSTRING
3267 
3268   // Gets the text streamed to this object so far as an std::string.
3269   // Each '\0' character in the buffer is replaced with "\\0".
3270   //
3271   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
3272   std::string GetString() const;
3273 
3274  private:
3275 
3276 #if GTEST_OS_SYMBIAN
3277   // These are needed as the Nokia Symbian Compiler cannot decide between
3278   // const T& and const T* in a function template. The Nokia compiler _can_
3279   // decide between class template specializations for T and T*, so a
3280   // tr1::type_traits-like is_pointer works, and we can overload on that.
3281   template <typename T>
3282   inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
3283     if (pointer == NULL) {
3284       *ss_ << "(null)";
3285     } else {
3286       *ss_ << pointer;
3287     }
3288   }
3289   template <typename T>
3290   inline void StreamHelper(internal::false_type /*is_pointer*/,
3291                            const T& value) {
3292     // See the comments in Message& operator <<(const T&) above for why
3293     // we need this using statement.
3294     using ::operator <<;
3295     *ss_ << value;
3296   }
3297 #endif  // GTEST_OS_SYMBIAN
3298 
3299   // We'll hold the text streamed to this object here.
3300   const internal::scoped_ptr< ::std::stringstream> ss_;
3301 
3302   // We declare (but don't implement) this to prevent the compiler
3303   // from implementing the assignment operator.
3304   void operator=(const Message&);
3305 };
3306 
3307 // Streams a Message to an ostream.
3308 inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
3309   return os << sb.GetString();
3310 }
3311 
3312 namespace internal {
3313 
3314 // Converts a streamable value to an std::string.  A NULL pointer is
3315 // converted to "(null)".  When the input value is a ::string,
3316 // ::std::string, ::wstring, or ::std::wstring object, each NUL
3317 // character in it is replaced with "\\0".
3318 template <typename T>
3319 std::string StreamableToString(const T& streamable) {
3320   return (Message() << streamable).GetString();
3321 }
3322 
3323 }  // namespace internal
3324 }  // namespace testing
3325 
3326 #endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
3327 // Copyright 2005, Google Inc.
3328 // All rights reserved.
3329 //
3330 // Redistribution and use in source and binary forms, with or without
3331 // modification, are permitted provided that the following conditions are
3332 // met:
3333 //
3334 //     * Redistributions of source code must retain the above copyright
3335 // notice, this list of conditions and the following disclaimer.
3336 //     * Redistributions in binary form must reproduce the above
3337 // copyright notice, this list of conditions and the following disclaimer
3338 // in the documentation and/or other materials provided with the
3339 // distribution.
3340 //     * Neither the name of Google Inc. nor the names of its
3341 // contributors may be used to endorse or promote products derived from
3342 // this software without specific prior written permission.
3343 //
3344 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3345 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3346 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3347 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3348 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3349 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3350 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3351 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3352 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3353 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3354 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3355 //
3356 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
3357 //
3358 // The Google C++ Testing Framework (Google Test)
3359 //
3360 // This header file declares the String class and functions used internally by
3361 // Google Test.  They are subject to change without notice. They should not used
3362 // by code external to Google Test.
3363 //
3364 // This header file is #included by <gtest/internal/gtest-internal.h>.
3365 // It should not be #included by other files.
3366 
3367 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3368 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3369 
3370 #ifdef __BORLANDC__
3371 // string.h is not guaranteed to provide strcpy on C++ Builder.
3372 # include <mem.h>
3373 #endif
3374 
3375 #include <string.h>
3376 #include <string>
3377 
3378 
3379 namespace testing {
3380 namespace internal {
3381 
3382 // String - an abstract class holding static string utilities.
3383 class GTEST_API_ String {
3384  public:
3385   // Static utility methods
3386 
3387   // Clones a 0-terminated C string, allocating memory using new.  The
3388   // caller is responsible for deleting the return value using
3389   // delete[].  Returns the cloned string, or NULL if the input is
3390   // NULL.
3391   //
3392   // This is different from strdup() in string.h, which allocates
3393   // memory using malloc().
3394   static const char* CloneCString(const char* c_str);
3395 
3396 #if GTEST_OS_WINDOWS_MOBILE
3397   // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
3398   // able to pass strings to Win32 APIs on CE we need to convert them
3399   // to 'Unicode', UTF-16.
3400 
3401   // Creates a UTF-16 wide string from the given ANSI string, allocating
3402   // memory using new. The caller is responsible for deleting the return
3403   // value using delete[]. Returns the wide string, or NULL if the
3404   // input is NULL.
3405   //
3406   // The wide string is created using the ANSI codepage (CP_ACP) to
3407   // match the behaviour of the ANSI versions of Win32 calls and the
3408   // C runtime.
3409   static LPCWSTR AnsiToUtf16(const char* c_str);
3410 
3411   // Creates an ANSI string from the given wide string, allocating
3412   // memory using new. The caller is responsible for deleting the return
3413   // value using delete[]. Returns the ANSI string, or NULL if the
3414   // input is NULL.
3415   //
3416   // The returned string is created using the ANSI codepage (CP_ACP) to
3417   // match the behaviour of the ANSI versions of Win32 calls and the
3418   // C runtime.
3419   static const char* Utf16ToAnsi(LPCWSTR utf16_str);
3420 #endif
3421 
3422   // Compares two C strings.  Returns true iff they have the same content.
3423   //
3424   // Unlike strcmp(), this function can handle NULL argument(s).  A
3425   // NULL C string is considered different to any non-NULL C string,
3426   // including the empty string.
3427   static bool CStringEquals(const char* lhs, const char* rhs);
3428 
3429   // Converts a wide C string to a String using the UTF-8 encoding.
3430   // NULL will be converted to "(null)".  If an error occurred during
3431   // the conversion, "(failed to convert from wide string)" is
3432   // returned.
3433   static std::string ShowWideCString(const wchar_t* wide_c_str);
3434 
3435   // Compares two wide C strings.  Returns true iff they have the same
3436   // content.
3437   //
3438   // Unlike wcscmp(), this function can handle NULL argument(s).  A
3439   // NULL C string is considered different to any non-NULL C string,
3440   // including the empty string.
3441   static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
3442 
3443   // Compares two C strings, ignoring case.  Returns true iff they
3444   // have the same content.
3445   //
3446   // Unlike strcasecmp(), this function can handle NULL argument(s).
3447   // A NULL C string is considered different to any non-NULL C string,
3448   // including the empty string.
3449   static bool CaseInsensitiveCStringEquals(const char* lhs,
3450                                            const char* rhs);
3451 
3452   // Compares two wide C strings, ignoring case.  Returns true iff they
3453   // have the same content.
3454   //
3455   // Unlike wcscasecmp(), this function can handle NULL argument(s).
3456   // A NULL C string is considered different to any non-NULL wide C string,
3457   // including the empty string.
3458   // NB: The implementations on different platforms slightly differ.
3459   // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
3460   // environment variable. On GNU platform this method uses wcscasecmp
3461   // which compares according to LC_CTYPE category of the current locale.
3462   // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
3463   // current locale.
3464   static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
3465                                                const wchar_t* rhs);
3466 
3467   // Returns true iff the given string ends with the given suffix, ignoring
3468   // case. Any string is considered to end with an empty suffix.
3469   static bool EndsWithCaseInsensitive(
3470       const std::string& str, const std::string& suffix);
3471 
3472   // Formats an int value as "%02d".
3473   static std::string FormatIntWidth2(int value);  // "%02d" for width == 2
3474 
3475   // Formats an int value as "%X".
3476   static std::string FormatHexInt(int value);
3477 
3478   // Formats a byte as "%02X".
3479   static std::string FormatByte(unsigned char value);
3480 
3481  private:
3482   String();  // Not meant to be instantiated.
3483 };  // class String
3484 
3485 // Gets the content of the stringstream's buffer as an std::string.  Each '\0'
3486 // character in the buffer is replaced with "\\0".
3487 GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
3488 
3489 }  // namespace internal
3490 }  // namespace testing
3491 
3492 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3493 // Copyright 2008, Google Inc.
3494 // All rights reserved.
3495 //
3496 // Redistribution and use in source and binary forms, with or without
3497 // modification, are permitted provided that the following conditions are
3498 // met:
3499 //
3500 //     * Redistributions of source code must retain the above copyright
3501 // notice, this list of conditions and the following disclaimer.
3502 //     * Redistributions in binary form must reproduce the above
3503 // copyright notice, this list of conditions and the following disclaimer
3504 // in the documentation and/or other materials provided with the
3505 // distribution.
3506 //     * Neither the name of Google Inc. nor the names of its
3507 // contributors may be used to endorse or promote products derived from
3508 // this software without specific prior written permission.
3509 //
3510 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3511 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3512 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3513 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3514 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3515 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3516 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3517 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3518 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3519 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3520 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3521 //
3522 // Author: keith.ray@gmail.com (Keith Ray)
3523 //
3524 // Google Test filepath utilities
3525 //
3526 // This header file declares classes and functions used internally by
3527 // Google Test.  They are subject to change without notice.
3528 //
3529 // This file is #included in <gtest/internal/gtest-internal.h>.
3530 // Do not include this header file separately!
3531 
3532 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3533 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3534 
3535 
3536 namespace testing {
3537 namespace internal {
3538 
3539 // FilePath - a class for file and directory pathname manipulation which
3540 // handles platform-specific conventions (like the pathname separator).
3541 // Used for helper functions for naming files in a directory for xml output.
3542 // Except for Set methods, all methods are const or static, which provides an
3543 // "immutable value object" -- useful for peace of mind.
3544 // A FilePath with a value ending in a path separator ("like/this/") represents
3545 // a directory, otherwise it is assumed to represent a file. In either case,
3546 // it may or may not represent an actual file or directory in the file system.
3547 // Names are NOT checked for syntax correctness -- no checking for illegal
3548 // characters, malformed paths, etc.
3549 
3550 class GTEST_API_ FilePath {
3551  public:
3552   FilePath() : pathname_("") { }
3553   FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
3554 
3555   explicit FilePath(const std::string& pathname) : pathname_(pathname) {
3556     Normalize();
3557   }
3558 
3559   FilePath& operator=(const FilePath& rhs) {
3560     Set(rhs);
3561     return *this;
3562   }
3563 
3564   void Set(const FilePath& rhs) {
3565     pathname_ = rhs.pathname_;
3566   }
3567 
3568   const std::string& string() const { return pathname_; }
3569   const char* c_str() const { return pathname_.c_str(); }
3570 
3571   // Returns the current working directory, or "" if unsuccessful.
3572   static FilePath GetCurrentDir();
3573 
3574   // Given directory = "dir", base_name = "test", number = 0,
3575   // extension = "xml", returns "dir/test.xml". If number is greater
3576   // than zero (e.g., 12), returns "dir/test_12.xml".
3577   // On Windows platform, uses \ as the separator rather than /.
3578   static FilePath MakeFileName(const FilePath& directory,
3579                                const FilePath& base_name,
3580                                int number,
3581                                const char* extension);
3582 
3583   // Given directory = "dir", relative_path = "test.xml",
3584   // returns "dir/test.xml".
3585   // On Windows, uses \ as the separator rather than /.
3586   static FilePath ConcatPaths(const FilePath& directory,
3587                               const FilePath& relative_path);
3588 
3589   // Returns a pathname for a file that does not currently exist. The pathname
3590   // will be directory/base_name.extension or
3591   // directory/base_name_<number>.extension if directory/base_name.extension
3592   // already exists. The number will be incremented until a pathname is found
3593   // that does not already exist.
3594   // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
3595   // There could be a race condition if two or more processes are calling this
3596   // function at the same time -- they could both pick the same filename.
3597   static FilePath GenerateUniqueFileName(const FilePath& directory,
3598                                          const FilePath& base_name,
3599                                          const char* extension);
3600 
3601   // Returns true iff the path is "".
3602   bool IsEmpty() const { return pathname_.empty(); }
3603 
3604   // If input name has a trailing separator character, removes it and returns
3605   // the name, otherwise return the name string unmodified.
3606   // On Windows platform, uses \ as the separator, other platforms use /.
3607   FilePath RemoveTrailingPathSeparator() const;
3608 
3609   // Returns a copy of the FilePath with the directory part removed.
3610   // Example: FilePath("path/to/file").RemoveDirectoryName() returns
3611   // FilePath("file"). If there is no directory part ("just_a_file"), it returns
3612   // the FilePath unmodified. If there is no file part ("just_a_dir/") it
3613   // returns an empty FilePath ("").
3614   // On Windows platform, '\' is the path separator, otherwise it is '/'.
3615   FilePath RemoveDirectoryName() const;
3616 
3617   // RemoveFileName returns the directory path with the filename removed.
3618   // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
3619   // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
3620   // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
3621   // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
3622   // On Windows platform, '\' is the path separator, otherwise it is '/'.
3623   FilePath RemoveFileName() const;
3624 
3625   // Returns a copy of the FilePath with the case-insensitive extension removed.
3626   // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
3627   // FilePath("dir/file"). If a case-insensitive extension is not
3628   // found, returns a copy of the original FilePath.
3629   FilePath RemoveExtension(const char* extension) const;
3630 
3631   // Creates directories so that path exists. Returns true if successful or if
3632   // the directories already exist; returns false if unable to create
3633   // directories for any reason. Will also return false if the FilePath does
3634   // not represent a directory (that is, it doesn't end with a path separator).
3635   bool CreateDirectoriesRecursively() const;
3636 
3637   // Create the directory so that path exists. Returns true if successful or
3638   // if the directory already exists; returns false if unable to create the
3639   // directory for any reason, including if the parent directory does not
3640   // exist. Not named "CreateDirectory" because that's a macro on Windows.
3641   bool CreateFolder() const;
3642 
3643   // Returns true if FilePath describes something in the file-system,
3644   // either a file, directory, or whatever, and that something exists.
3645   bool FileOrDirectoryExists() const;
3646 
3647   // Returns true if pathname describes a directory in the file-system
3648   // that exists.
3649   bool DirectoryExists() const;
3650 
3651   // Returns true if FilePath ends with a path separator, which indicates that
3652   // it is intended to represent a directory. Returns false otherwise.
3653   // This does NOT check that a directory (or file) actually exists.
3654   bool IsDirectory() const;
3655 
3656   // Returns true if pathname describes a root directory. (Windows has one
3657   // root directory per disk drive.)
3658   bool IsRootDirectory() const;
3659 
3660   // Returns true if pathname describes an absolute path.
3661   bool IsAbsolutePath() const;
3662 
3663  private:
3664   // Replaces multiple consecutive separators with a single separator.
3665   // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
3666   // redundancies that might be in a pathname involving "." or "..".
3667   //
3668   // A pathname with multiple consecutive separators may occur either through
3669   // user error or as a result of some scripts or APIs that generate a pathname
3670   // with a trailing separator. On other platforms the same API or script
3671   // may NOT generate a pathname with a trailing "/". Then elsewhere that
3672   // pathname may have another "/" and pathname components added to it,
3673   // without checking for the separator already being there.
3674   // The script language and operating system may allow paths like "foo//bar"
3675   // but some of the functions in FilePath will not handle that correctly. In
3676   // particular, RemoveTrailingPathSeparator() only removes one separator, and
3677   // it is called in CreateDirectoriesRecursively() assuming that it will change
3678   // a pathname from directory syntax (trailing separator) to filename syntax.
3679   //
3680   // On Windows this method also replaces the alternate path separator '/' with
3681   // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
3682   // "bar\\foo".
3683 
3684   void Normalize();
3685 
3686   // Returns a pointer to the last occurrence of a valid path separator in
3687   // the FilePath. On Windows, for example, both '/' and '\' are valid path
3688   // separators. Returns NULL if no path separator was found.
3689   const char* FindLastPathSeparator() const;
3690 
3691   std::string pathname_;
3692 };  // class FilePath
3693 
3694 }  // namespace internal
3695 }  // namespace testing
3696 
3697 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3698 // This file was GENERATED by command:
3699 //     pump.py gtest-type-util.h.pump
3700 // DO NOT EDIT BY HAND!!!
3701 
3702 // Copyright 2008 Google Inc.
3703 // All Rights Reserved.
3704 //
3705 // Redistribution and use in source and binary forms, with or without
3706 // modification, are permitted provided that the following conditions are
3707 // met:
3708 //
3709 //     * Redistributions of source code must retain the above copyright
3710 // notice, this list of conditions and the following disclaimer.
3711 //     * Redistributions in binary form must reproduce the above
3712 // copyright notice, this list of conditions and the following disclaimer
3713 // in the documentation and/or other materials provided with the
3714 // distribution.
3715 //     * Neither the name of Google Inc. nor the names of its
3716 // contributors may be used to endorse or promote products derived from
3717 // this software without specific prior written permission.
3718 //
3719 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3720 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3721 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3722 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3723 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3724 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3725 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3726 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3727 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3728 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3729 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3730 //
3731 // Author: wan@google.com (Zhanyong Wan)
3732 
3733 // Type utilities needed for implementing typed and type-parameterized
3734 // tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
3735 //
3736 // Currently we support at most 50 types in a list, and at most 50
3737 // type-parameterized tests in one type-parameterized test case.
3738 // Please contact googletestframework@googlegroups.com if you need
3739 // more.
3740 
3741 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3742 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3743 
3744 
3745 // #ifdef __GNUC__ is too general here.  It is possible to use gcc without using
3746 // libstdc++ (which is where cxxabi.h comes from).
3747 # if GTEST_HAS_CXXABI_H_
3748 #  include <cxxabi.h>
3749 # elif defined(__HP_aCC)
3750 #  include <acxx_demangle.h>
3751 # endif  // GTEST_HASH_CXXABI_H_
3752 
3753 namespace testing {
3754 namespace internal {
3755 
3756 // GetTypeName<T>() returns a human-readable name of type T.
3757 // NB: This function is also used in Google Mock, so don't move it inside of
3758 // the typed-test-only section below.
3759 template <typename T>
3760 std::string GetTypeName() {
3761 # if GTEST_HAS_RTTI
3762 
3763   const char* const name = typeid(T).name();
3764 #  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
3765   int status = 0;
3766   // gcc's implementation of typeid(T).name() mangles the type name,
3767   // so we have to demangle it.
3768 #   if GTEST_HAS_CXXABI_H_
3769   using abi::__cxa_demangle;
3770 #   endif  // GTEST_HAS_CXXABI_H_
3771   char* const readable_name = __cxa_demangle(name, 0, 0, &status);
3772   const std::string name_str(status == 0 ? readable_name : name);
3773   free(readable_name);
3774   return name_str;
3775 #  else
3776   return name;
3777 #  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC
3778 
3779 # else
3780 
3781   return "<type>";
3782 
3783 # endif  // GTEST_HAS_RTTI
3784 }
3785 
3786 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
3787 
3788 // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
3789 // type.  This can be used as a compile-time assertion to ensure that
3790 // two types are equal.
3791 
3792 template <typename T1, typename T2>
3793 struct AssertTypeEq;
3794 
3795 template <typename T>
3796 struct AssertTypeEq<T, T> {
3797   typedef bool type;
3798 };
3799 
3800 // A unique type used as the default value for the arguments of class
3801 // template Types.  This allows us to simulate variadic templates
3802 // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
3803 // support directly.
3804 struct None {};
3805 
3806 // The following family of struct and struct templates are used to
3807 // represent type lists.  In particular, TypesN<T1, T2, ..., TN>
3808 // represents a type list with N types (T1, T2, ..., and TN) in it.
3809 // Except for Types0, every struct in the family has two member types:
3810 // Head for the first type in the list, and Tail for the rest of the
3811 // list.
3812 
3813 // The empty type list.
3814 struct Types0 {};
3815 
3816 // Type lists of length 1, 2, 3, and so on.
3817 
3818 template <typename T1>
3819 struct Types1 {
3820   typedef T1 Head;
3821   typedef Types0 Tail;
3822 };
3823 template <typename T1, typename T2>
3824 struct Types2 {
3825   typedef T1 Head;
3826   typedef Types1<T2> Tail;
3827 };
3828 
3829 template <typename T1, typename T2, typename T3>
3830 struct Types3 {
3831   typedef T1 Head;
3832   typedef Types2<T2, T3> Tail;
3833 };
3834 
3835 template <typename T1, typename T2, typename T3, typename T4>
3836 struct Types4 {
3837   typedef T1 Head;
3838   typedef Types3<T2, T3, T4> Tail;
3839 };
3840 
3841 template <typename T1, typename T2, typename T3, typename T4, typename T5>
3842 struct Types5 {
3843   typedef T1 Head;
3844   typedef Types4<T2, T3, T4, T5> Tail;
3845 };
3846 
3847 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3848     typename T6>
3849 struct Types6 {
3850   typedef T1 Head;
3851   typedef Types5<T2, T3, T4, T5, T6> Tail;
3852 };
3853 
3854 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3855     typename T6, typename T7>
3856 struct Types7 {
3857   typedef T1 Head;
3858   typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
3859 };
3860 
3861 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3862     typename T6, typename T7, typename T8>
3863 struct Types8 {
3864   typedef T1 Head;
3865   typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
3866 };
3867 
3868 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3869     typename T6, typename T7, typename T8, typename T9>
3870 struct Types9 {
3871   typedef T1 Head;
3872   typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
3873 };
3874 
3875 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3876     typename T6, typename T7, typename T8, typename T9, typename T10>
3877 struct Types10 {
3878   typedef T1 Head;
3879   typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
3880 };
3881 
3882 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3883     typename T6, typename T7, typename T8, typename T9, typename T10,
3884     typename T11>
3885 struct Types11 {
3886   typedef T1 Head;
3887   typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
3888 };
3889 
3890 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3891     typename T6, typename T7, typename T8, typename T9, typename T10,
3892     typename T11, typename T12>
3893 struct Types12 {
3894   typedef T1 Head;
3895   typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
3896 };
3897 
3898 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3899     typename T6, typename T7, typename T8, typename T9, typename T10,
3900     typename T11, typename T12, typename T13>
3901 struct Types13 {
3902   typedef T1 Head;
3903   typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
3904 };
3905 
3906 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3907     typename T6, typename T7, typename T8, typename T9, typename T10,
3908     typename T11, typename T12, typename T13, typename T14>
3909 struct Types14 {
3910   typedef T1 Head;
3911   typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
3912 };
3913 
3914 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3915     typename T6, typename T7, typename T8, typename T9, typename T10,
3916     typename T11, typename T12, typename T13, typename T14, typename T15>
3917 struct Types15 {
3918   typedef T1 Head;
3919   typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
3920       T15> Tail;
3921 };
3922 
3923 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3924     typename T6, typename T7, typename T8, typename T9, typename T10,
3925     typename T11, typename T12, typename T13, typename T14, typename T15,
3926     typename T16>
3927 struct Types16 {
3928   typedef T1 Head;
3929   typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3930       T16> Tail;
3931 };
3932 
3933 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3934     typename T6, typename T7, typename T8, typename T9, typename T10,
3935     typename T11, typename T12, typename T13, typename T14, typename T15,
3936     typename T16, typename T17>
3937 struct Types17 {
3938   typedef T1 Head;
3939   typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3940       T16, T17> Tail;
3941 };
3942 
3943 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3944     typename T6, typename T7, typename T8, typename T9, typename T10,
3945     typename T11, typename T12, typename T13, typename T14, typename T15,
3946     typename T16, typename T17, typename T18>
3947 struct Types18 {
3948   typedef T1 Head;
3949   typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3950       T16, T17, T18> Tail;
3951 };
3952 
3953 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3954     typename T6, typename T7, typename T8, typename T9, typename T10,
3955     typename T11, typename T12, typename T13, typename T14, typename T15,
3956     typename T16, typename T17, typename T18, typename T19>
3957 struct Types19 {
3958   typedef T1 Head;
3959   typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3960       T16, T17, T18, T19> Tail;
3961 };
3962 
3963 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3964     typename T6, typename T7, typename T8, typename T9, typename T10,
3965     typename T11, typename T12, typename T13, typename T14, typename T15,
3966     typename T16, typename T17, typename T18, typename T19, typename T20>
3967 struct Types20 {
3968   typedef T1 Head;
3969   typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3970       T16, T17, T18, T19, T20> Tail;
3971 };
3972 
3973 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3974     typename T6, typename T7, typename T8, typename T9, typename T10,
3975     typename T11, typename T12, typename T13, typename T14, typename T15,
3976     typename T16, typename T17, typename T18, typename T19, typename T20,
3977     typename T21>
3978 struct Types21 {
3979   typedef T1 Head;
3980   typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3981       T16, T17, T18, T19, T20, T21> Tail;
3982 };
3983 
3984 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3985     typename T6, typename T7, typename T8, typename T9, typename T10,
3986     typename T11, typename T12, typename T13, typename T14, typename T15,
3987     typename T16, typename T17, typename T18, typename T19, typename T20,
3988     typename T21, typename T22>
3989 struct Types22 {
3990   typedef T1 Head;
3991   typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3992       T16, T17, T18, T19, T20, T21, T22> Tail;
3993 };
3994 
3995 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3996     typename T6, typename T7, typename T8, typename T9, typename T10,
3997     typename T11, typename T12, typename T13, typename T14, typename T15,
3998     typename T16, typename T17, typename T18, typename T19, typename T20,
3999     typename T21, typename T22, typename T23>
4000 struct Types23 {
4001   typedef T1 Head;
4002   typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4003       T16, T17, T18, T19, T20, T21, T22, T23> Tail;
4004 };
4005 
4006 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4007     typename T6, typename T7, typename T8, typename T9, typename T10,
4008     typename T11, typename T12, typename T13, typename T14, typename T15,
4009     typename T16, typename T17, typename T18, typename T19, typename T20,
4010     typename T21, typename T22, typename T23, typename T24>
4011 struct Types24 {
4012   typedef T1 Head;
4013   typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4014       T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
4015 };
4016 
4017 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4018     typename T6, typename T7, typename T8, typename T9, typename T10,
4019     typename T11, typename T12, typename T13, typename T14, typename T15,
4020     typename T16, typename T17, typename T18, typename T19, typename T20,
4021     typename T21, typename T22, typename T23, typename T24, typename T25>
4022 struct Types25 {
4023   typedef T1 Head;
4024   typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4025       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
4026 };
4027 
4028 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4029     typename T6, typename T7, typename T8, typename T9, typename T10,
4030     typename T11, typename T12, typename T13, typename T14, typename T15,
4031     typename T16, typename T17, typename T18, typename T19, typename T20,
4032     typename T21, typename T22, typename T23, typename T24, typename T25,
4033     typename T26>
4034 struct Types26 {
4035   typedef T1 Head;
4036   typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4037       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
4038 };
4039 
4040 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4041     typename T6, typename T7, typename T8, typename T9, typename T10,
4042     typename T11, typename T12, typename T13, typename T14, typename T15,
4043     typename T16, typename T17, typename T18, typename T19, typename T20,
4044     typename T21, typename T22, typename T23, typename T24, typename T25,
4045     typename T26, typename T27>
4046 struct Types27 {
4047   typedef T1 Head;
4048   typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4049       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
4050 };
4051 
4052 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4053     typename T6, typename T7, typename T8, typename T9, typename T10,
4054     typename T11, typename T12, typename T13, typename T14, typename T15,
4055     typename T16, typename T17, typename T18, typename T19, typename T20,
4056     typename T21, typename T22, typename T23, typename T24, typename T25,
4057     typename T26, typename T27, typename T28>
4058 struct Types28 {
4059   typedef T1 Head;
4060   typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4061       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
4062 };
4063 
4064 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4065     typename T6, typename T7, typename T8, typename T9, typename T10,
4066     typename T11, typename T12, typename T13, typename T14, typename T15,
4067     typename T16, typename T17, typename T18, typename T19, typename T20,
4068     typename T21, typename T22, typename T23, typename T24, typename T25,
4069     typename T26, typename T27, typename T28, typename T29>
4070 struct Types29 {
4071   typedef T1 Head;
4072   typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4073       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
4074       T29> Tail;
4075 };
4076 
4077 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4078     typename T6, typename T7, typename T8, typename T9, typename T10,
4079     typename T11, typename T12, typename T13, typename T14, typename T15,
4080     typename T16, typename T17, typename T18, typename T19, typename T20,
4081     typename T21, typename T22, typename T23, typename T24, typename T25,
4082     typename T26, typename T27, typename T28, typename T29, typename T30>
4083 struct Types30 {
4084   typedef T1 Head;
4085   typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4086       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4087       T30> Tail;
4088 };
4089 
4090 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4091     typename T6, typename T7, typename T8, typename T9, typename T10,
4092     typename T11, typename T12, typename T13, typename T14, typename T15,
4093     typename T16, typename T17, typename T18, typename T19, typename T20,
4094     typename T21, typename T22, typename T23, typename T24, typename T25,
4095     typename T26, typename T27, typename T28, typename T29, typename T30,
4096     typename T31>
4097 struct Types31 {
4098   typedef T1 Head;
4099   typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4100       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4101       T30, T31> Tail;
4102 };
4103 
4104 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4105     typename T6, typename T7, typename T8, typename T9, typename T10,
4106     typename T11, typename T12, typename T13, typename T14, typename T15,
4107     typename T16, typename T17, typename T18, typename T19, typename T20,
4108     typename T21, typename T22, typename T23, typename T24, typename T25,
4109     typename T26, typename T27, typename T28, typename T29, typename T30,
4110     typename T31, typename T32>
4111 struct Types32 {
4112   typedef T1 Head;
4113   typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4114       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4115       T30, T31, T32> Tail;
4116 };
4117 
4118 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4119     typename T6, typename T7, typename T8, typename T9, typename T10,
4120     typename T11, typename T12, typename T13, typename T14, typename T15,
4121     typename T16, typename T17, typename T18, typename T19, typename T20,
4122     typename T21, typename T22, typename T23, typename T24, typename T25,
4123     typename T26, typename T27, typename T28, typename T29, typename T30,
4124     typename T31, typename T32, typename T33>
4125 struct Types33 {
4126   typedef T1 Head;
4127   typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4128       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4129       T30, T31, T32, T33> Tail;
4130 };
4131 
4132 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4133     typename T6, typename T7, typename T8, typename T9, typename T10,
4134     typename T11, typename T12, typename T13, typename T14, typename T15,
4135     typename T16, typename T17, typename T18, typename T19, typename T20,
4136     typename T21, typename T22, typename T23, typename T24, typename T25,
4137     typename T26, typename T27, typename T28, typename T29, typename T30,
4138     typename T31, typename T32, typename T33, typename T34>
4139 struct Types34 {
4140   typedef T1 Head;
4141   typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4142       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4143       T30, T31, T32, T33, T34> Tail;
4144 };
4145 
4146 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4147     typename T6, typename T7, typename T8, typename T9, typename T10,
4148     typename T11, typename T12, typename T13, typename T14, typename T15,
4149     typename T16, typename T17, typename T18, typename T19, typename T20,
4150     typename T21, typename T22, typename T23, typename T24, typename T25,
4151     typename T26, typename T27, typename T28, typename T29, typename T30,
4152     typename T31, typename T32, typename T33, typename T34, typename T35>
4153 struct Types35 {
4154   typedef T1 Head;
4155   typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4156       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4157       T30, T31, T32, T33, T34, T35> Tail;
4158 };
4159 
4160 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4161     typename T6, typename T7, typename T8, typename T9, typename T10,
4162     typename T11, typename T12, typename T13, typename T14, typename T15,
4163     typename T16, typename T17, typename T18, typename T19, typename T20,
4164     typename T21, typename T22, typename T23, typename T24, typename T25,
4165     typename T26, typename T27, typename T28, typename T29, typename T30,
4166     typename T31, typename T32, typename T33, typename T34, typename T35,
4167     typename T36>
4168 struct Types36 {
4169   typedef T1 Head;
4170   typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4171       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4172       T30, T31, T32, T33, T34, T35, T36> Tail;
4173 };
4174 
4175 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4176     typename T6, typename T7, typename T8, typename T9, typename T10,
4177     typename T11, typename T12, typename T13, typename T14, typename T15,
4178     typename T16, typename T17, typename T18, typename T19, typename T20,
4179     typename T21, typename T22, typename T23, typename T24, typename T25,
4180     typename T26, typename T27, typename T28, typename T29, typename T30,
4181     typename T31, typename T32, typename T33, typename T34, typename T35,
4182     typename T36, typename T37>
4183 struct Types37 {
4184   typedef T1 Head;
4185   typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4186       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4187       T30, T31, T32, T33, T34, T35, T36, T37> Tail;
4188 };
4189 
4190 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4191     typename T6, typename T7, typename T8, typename T9, typename T10,
4192     typename T11, typename T12, typename T13, typename T14, typename T15,
4193     typename T16, typename T17, typename T18, typename T19, typename T20,
4194     typename T21, typename T22, typename T23, typename T24, typename T25,
4195     typename T26, typename T27, typename T28, typename T29, typename T30,
4196     typename T31, typename T32, typename T33, typename T34, typename T35,
4197     typename T36, typename T37, typename T38>
4198 struct Types38 {
4199   typedef T1 Head;
4200   typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4201       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4202       T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
4203 };
4204 
4205 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4206     typename T6, typename T7, typename T8, typename T9, typename T10,
4207     typename T11, typename T12, typename T13, typename T14, typename T15,
4208     typename T16, typename T17, typename T18, typename T19, typename T20,
4209     typename T21, typename T22, typename T23, typename T24, typename T25,
4210     typename T26, typename T27, typename T28, typename T29, typename T30,
4211     typename T31, typename T32, typename T33, typename T34, typename T35,
4212     typename T36, typename T37, typename T38, typename T39>
4213 struct Types39 {
4214   typedef T1 Head;
4215   typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4216       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4217       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
4218 };
4219 
4220 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4221     typename T6, typename T7, typename T8, typename T9, typename T10,
4222     typename T11, typename T12, typename T13, typename T14, typename T15,
4223     typename T16, typename T17, typename T18, typename T19, typename T20,
4224     typename T21, typename T22, typename T23, typename T24, typename T25,
4225     typename T26, typename T27, typename T28, typename T29, typename T30,
4226     typename T31, typename T32, typename T33, typename T34, typename T35,
4227     typename T36, typename T37, typename T38, typename T39, typename T40>
4228 struct Types40 {
4229   typedef T1 Head;
4230   typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4231       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4232       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
4233 };
4234 
4235 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4236     typename T6, typename T7, typename T8, typename T9, typename T10,
4237     typename T11, typename T12, typename T13, typename T14, typename T15,
4238     typename T16, typename T17, typename T18, typename T19, typename T20,
4239     typename T21, typename T22, typename T23, typename T24, typename T25,
4240     typename T26, typename T27, typename T28, typename T29, typename T30,
4241     typename T31, typename T32, typename T33, typename T34, typename T35,
4242     typename T36, typename T37, typename T38, typename T39, typename T40,
4243     typename T41>
4244 struct Types41 {
4245   typedef T1 Head;
4246   typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4247       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4248       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
4249 };
4250 
4251 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4252     typename T6, typename T7, typename T8, typename T9, typename T10,
4253     typename T11, typename T12, typename T13, typename T14, typename T15,
4254     typename T16, typename T17, typename T18, typename T19, typename T20,
4255     typename T21, typename T22, typename T23, typename T24, typename T25,
4256     typename T26, typename T27, typename T28, typename T29, typename T30,
4257     typename T31, typename T32, typename T33, typename T34, typename T35,
4258     typename T36, typename T37, typename T38, typename T39, typename T40,
4259     typename T41, typename T42>
4260 struct Types42 {
4261   typedef T1 Head;
4262   typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4263       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4264       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
4265 };
4266 
4267 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4268     typename T6, typename T7, typename T8, typename T9, typename T10,
4269     typename T11, typename T12, typename T13, typename T14, typename T15,
4270     typename T16, typename T17, typename T18, typename T19, typename T20,
4271     typename T21, typename T22, typename T23, typename T24, typename T25,
4272     typename T26, typename T27, typename T28, typename T29, typename T30,
4273     typename T31, typename T32, typename T33, typename T34, typename T35,
4274     typename T36, typename T37, typename T38, typename T39, typename T40,
4275     typename T41, typename T42, typename T43>
4276 struct Types43 {
4277   typedef T1 Head;
4278   typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4279       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4280       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
4281       T43> Tail;
4282 };
4283 
4284 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4285     typename T6, typename T7, typename T8, typename T9, typename T10,
4286     typename T11, typename T12, typename T13, typename T14, typename T15,
4287     typename T16, typename T17, typename T18, typename T19, typename T20,
4288     typename T21, typename T22, typename T23, typename T24, typename T25,
4289     typename T26, typename T27, typename T28, typename T29, typename T30,
4290     typename T31, typename T32, typename T33, typename T34, typename T35,
4291     typename T36, typename T37, typename T38, typename T39, typename T40,
4292     typename T41, typename T42, typename T43, typename T44>
4293 struct Types44 {
4294   typedef T1 Head;
4295   typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4296       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4297       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4298       T44> Tail;
4299 };
4300 
4301 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4302     typename T6, typename T7, typename T8, typename T9, typename T10,
4303     typename T11, typename T12, typename T13, typename T14, typename T15,
4304     typename T16, typename T17, typename T18, typename T19, typename T20,
4305     typename T21, typename T22, typename T23, typename T24, typename T25,
4306     typename T26, typename T27, typename T28, typename T29, typename T30,
4307     typename T31, typename T32, typename T33, typename T34, typename T35,
4308     typename T36, typename T37, typename T38, typename T39, typename T40,
4309     typename T41, typename T42, typename T43, typename T44, typename T45>
4310 struct Types45 {
4311   typedef T1 Head;
4312   typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4313       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4314       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4315       T44, T45> Tail;
4316 };
4317 
4318 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4319     typename T6, typename T7, typename T8, typename T9, typename T10,
4320     typename T11, typename T12, typename T13, typename T14, typename T15,
4321     typename T16, typename T17, typename T18, typename T19, typename T20,
4322     typename T21, typename T22, typename T23, typename T24, typename T25,
4323     typename T26, typename T27, typename T28, typename T29, typename T30,
4324     typename T31, typename T32, typename T33, typename T34, typename T35,
4325     typename T36, typename T37, typename T38, typename T39, typename T40,
4326     typename T41, typename T42, typename T43, typename T44, typename T45,
4327     typename T46>
4328 struct Types46 {
4329   typedef T1 Head;
4330   typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4331       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4332       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4333       T44, T45, T46> Tail;
4334 };
4335 
4336 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4337     typename T6, typename T7, typename T8, typename T9, typename T10,
4338     typename T11, typename T12, typename T13, typename T14, typename T15,
4339     typename T16, typename T17, typename T18, typename T19, typename T20,
4340     typename T21, typename T22, typename T23, typename T24, typename T25,
4341     typename T26, typename T27, typename T28, typename T29, typename T30,
4342     typename T31, typename T32, typename T33, typename T34, typename T35,
4343     typename T36, typename T37, typename T38, typename T39, typename T40,
4344     typename T41, typename T42, typename T43, typename T44, typename T45,
4345     typename T46, typename T47>
4346 struct Types47 {
4347   typedef T1 Head;
4348   typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4349       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4350       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4351       T44, T45, T46, T47> Tail;
4352 };
4353 
4354 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4355     typename T6, typename T7, typename T8, typename T9, typename T10,
4356     typename T11, typename T12, typename T13, typename T14, typename T15,
4357     typename T16, typename T17, typename T18, typename T19, typename T20,
4358     typename T21, typename T22, typename T23, typename T24, typename T25,
4359     typename T26, typename T27, typename T28, typename T29, typename T30,
4360     typename T31, typename T32, typename T33, typename T34, typename T35,
4361     typename T36, typename T37, typename T38, typename T39, typename T40,
4362     typename T41, typename T42, typename T43, typename T44, typename T45,
4363     typename T46, typename T47, typename T48>
4364 struct Types48 {
4365   typedef T1 Head;
4366   typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4367       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4368       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4369       T44, T45, T46, T47, T48> Tail;
4370 };
4371 
4372 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4373     typename T6, typename T7, typename T8, typename T9, typename T10,
4374     typename T11, typename T12, typename T13, typename T14, typename T15,
4375     typename T16, typename T17, typename T18, typename T19, typename T20,
4376     typename T21, typename T22, typename T23, typename T24, typename T25,
4377     typename T26, typename T27, typename T28, typename T29, typename T30,
4378     typename T31, typename T32, typename T33, typename T34, typename T35,
4379     typename T36, typename T37, typename T38, typename T39, typename T40,
4380     typename T41, typename T42, typename T43, typename T44, typename T45,
4381     typename T46, typename T47, typename T48, typename T49>
4382 struct Types49 {
4383   typedef T1 Head;
4384   typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4385       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4386       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4387       T44, T45, T46, T47, T48, T49> Tail;
4388 };
4389 
4390 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4391     typename T6, typename T7, typename T8, typename T9, typename T10,
4392     typename T11, typename T12, typename T13, typename T14, typename T15,
4393     typename T16, typename T17, typename T18, typename T19, typename T20,
4394     typename T21, typename T22, typename T23, typename T24, typename T25,
4395     typename T26, typename T27, typename T28, typename T29, typename T30,
4396     typename T31, typename T32, typename T33, typename T34, typename T35,
4397     typename T36, typename T37, typename T38, typename T39, typename T40,
4398     typename T41, typename T42, typename T43, typename T44, typename T45,
4399     typename T46, typename T47, typename T48, typename T49, typename T50>
4400 struct Types50 {
4401   typedef T1 Head;
4402   typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4403       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4404       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4405       T44, T45, T46, T47, T48, T49, T50> Tail;
4406 };
4407 
4408 
4409 }  // namespace internal
4410 
4411 // We don't want to require the users to write TypesN<...> directly,
4412 // as that would require them to count the length.  Types<...> is much
4413 // easier to write, but generates horrible messages when there is a
4414 // compiler error, as gcc insists on printing out each template
4415 // argument, even if it has the default value (this means Types<int>
4416 // will appear as Types<int, None, None, ..., None> in the compiler
4417 // errors).
4418 //
4419 // Our solution is to combine the best part of the two approaches: a
4420 // user would write Types<T1, ..., TN>, and Google Test will translate
4421 // that to TypesN<T1, ..., TN> internally to make error messages
4422 // readable.  The translation is done by the 'type' member of the
4423 // Types template.
4424 template <typename T1 = internal::None, typename T2 = internal::None,
4425     typename T3 = internal::None, typename T4 = internal::None,
4426     typename T5 = internal::None, typename T6 = internal::None,
4427     typename T7 = internal::None, typename T8 = internal::None,
4428     typename T9 = internal::None, typename T10 = internal::None,
4429     typename T11 = internal::None, typename T12 = internal::None,
4430     typename T13 = internal::None, typename T14 = internal::None,
4431     typename T15 = internal::None, typename T16 = internal::None,
4432     typename T17 = internal::None, typename T18 = internal::None,
4433     typename T19 = internal::None, typename T20 = internal::None,
4434     typename T21 = internal::None, typename T22 = internal::None,
4435     typename T23 = internal::None, typename T24 = internal::None,
4436     typename T25 = internal::None, typename T26 = internal::None,
4437     typename T27 = internal::None, typename T28 = internal::None,
4438     typename T29 = internal::None, typename T30 = internal::None,
4439     typename T31 = internal::None, typename T32 = internal::None,
4440     typename T33 = internal::None, typename T34 = internal::None,
4441     typename T35 = internal::None, typename T36 = internal::None,
4442     typename T37 = internal::None, typename T38 = internal::None,
4443     typename T39 = internal::None, typename T40 = internal::None,
4444     typename T41 = internal::None, typename T42 = internal::None,
4445     typename T43 = internal::None, typename T44 = internal::None,
4446     typename T45 = internal::None, typename T46 = internal::None,
4447     typename T47 = internal::None, typename T48 = internal::None,
4448     typename T49 = internal::None, typename T50 = internal::None>
4449 struct Types {
4450   typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4451       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4452       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4453       T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
4454 };
4455 
4456 template <>
4457 struct Types<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, internal::None, internal::None,
4467     internal::None, internal::None, internal::None, internal::None,
4468     internal::None, internal::None, internal::None, internal::None,
4469     internal::None, internal::None> {
4470   typedef internal::Types0 type;
4471 };
4472 template <typename T1>
4473 struct Types<T1, 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, internal::None, internal::None,
4483     internal::None, internal::None, internal::None, internal::None,
4484     internal::None, internal::None, internal::None, internal::None,
4485     internal::None, internal::None> {
4486   typedef internal::Types1<T1> type;
4487 };
4488 template <typename T1, typename T2>
4489 struct Types<T1, T2, 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, internal::None, internal::None, internal::None,
4499     internal::None, internal::None, internal::None, internal::None,
4500     internal::None, internal::None, internal::None, internal::None,
4501     internal::None> {
4502   typedef internal::Types2<T1, T2> type;
4503 };
4504 template <typename T1, typename T2, typename T3>
4505 struct Types<T1, T2, T3, 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     internal::None, internal::None, internal::None, internal::None,
4515     internal::None, internal::None, internal::None, internal::None,
4516     internal::None, internal::None, internal::None, internal::None> {
4517   typedef internal::Types3<T1, T2, T3> type;
4518 };
4519 template <typename T1, typename T2, typename T3, typename T4>
4520 struct Types<T1, T2, T3, T4, 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, internal::None,
4529     internal::None, internal::None, internal::None, internal::None,
4530     internal::None, internal::None, internal::None, internal::None,
4531     internal::None, internal::None, internal::None> {
4532   typedef internal::Types4<T1, T2, T3, T4> type;
4533 };
4534 template <typename T1, typename T2, typename T3, typename T4, typename T5>
4535 struct Types<T1, T2, T3, T4, T5, 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, internal::None,
4544     internal::None, internal::None, internal::None, internal::None,
4545     internal::None, internal::None, internal::None, internal::None,
4546     internal::None, internal::None, internal::None> {
4547   typedef internal::Types5<T1, T2, T3, T4, T5> type;
4548 };
4549 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4550     typename T6>
4551 struct Types<T1, T2, T3, T4, T5, T6, 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, internal::None, internal::None,
4560     internal::None, internal::None, internal::None, internal::None,
4561     internal::None, internal::None, internal::None, internal::None,
4562     internal::None, internal::None> {
4563   typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
4564 };
4565 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4566     typename T6, typename T7>
4567 struct Types<T1, T2, T3, T4, T5, T6, T7, 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, internal::None, internal::None, internal::None,
4576     internal::None, internal::None, internal::None, internal::None,
4577     internal::None, internal::None, internal::None, internal::None,
4578     internal::None> {
4579   typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
4580 };
4581 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4582     typename T6, typename T7, typename T8>
4583 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, 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     internal::None, internal::None, internal::None, internal::None,
4592     internal::None, internal::None, internal::None, internal::None,
4593     internal::None, internal::None, internal::None, internal::None> {
4594   typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
4595 };
4596 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4597     typename T6, typename T7, typename T8, typename T9>
4598 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, 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     internal::None, internal::None, internal::None, internal::None,
4607     internal::None, internal::None, internal::None, internal::None,
4608     internal::None, internal::None, internal::None, internal::None> {
4609   typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
4610 };
4611 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4612     typename T6, typename T7, typename T8, typename T9, typename T10>
4613 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, 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, internal::None,
4621     internal::None, internal::None, internal::None, internal::None,
4622     internal::None, internal::None, internal::None, internal::None,
4623     internal::None, internal::None, internal::None> {
4624   typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
4625 };
4626 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4627     typename T6, typename T7, typename T8, typename T9, typename T10,
4628     typename T11>
4629 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, 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, internal::None, internal::None,
4637     internal::None, internal::None, internal::None, internal::None,
4638     internal::None, internal::None, internal::None, internal::None,
4639     internal::None, internal::None> {
4640   typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
4641 };
4642 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4643     typename T6, typename T7, typename T8, typename T9, typename T10,
4644     typename T11, typename T12>
4645 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, 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, internal::None, internal::None, internal::None,
4653     internal::None, internal::None, internal::None, internal::None,
4654     internal::None, internal::None, internal::None, internal::None,
4655     internal::None> {
4656   typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
4657       T12> type;
4658 };
4659 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4660     typename T6, typename T7, typename T8, typename T9, typename T10,
4661     typename T11, typename T12, typename T13>
4662 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
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, internal::None, internal::None, internal::None,
4670     internal::None, internal::None, internal::None, internal::None,
4671     internal::None, internal::None, internal::None, internal::None,
4672     internal::None> {
4673   typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4674       T13> type;
4675 };
4676 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4677     typename T6, typename T7, typename T8, typename T9, typename T10,
4678     typename T11, typename T12, typename T13, typename T14>
4679 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
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     internal::None, internal::None, internal::None, internal::None,
4687     internal::None, internal::None, internal::None, internal::None,
4688     internal::None, internal::None, internal::None, internal::None> {
4689   typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4690       T13, T14> type;
4691 };
4692 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4693     typename T6, typename T7, typename T8, typename T9, typename T10,
4694     typename T11, typename T12, typename T13, typename T14, typename T15>
4695 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
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, internal::None,
4702     internal::None, internal::None, internal::None, internal::None,
4703     internal::None, internal::None, internal::None, internal::None,
4704     internal::None, internal::None, internal::None> {
4705   typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4706       T13, T14, T15> type;
4707 };
4708 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4709     typename T6, typename T7, typename T8, typename T9, typename T10,
4710     typename T11, typename T12, typename T13, typename T14, typename T15,
4711     typename T16>
4712 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4713     T16, 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, internal::None, internal::None,
4719     internal::None, internal::None, internal::None, internal::None,
4720     internal::None, internal::None, internal::None, internal::None,
4721     internal::None, internal::None> {
4722   typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4723       T13, T14, T15, T16> type;
4724 };
4725 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4726     typename T6, typename T7, typename T8, typename T9, typename T10,
4727     typename T11, typename T12, typename T13, typename T14, typename T15,
4728     typename T16, typename T17>
4729 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4730     T16, T17, 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, internal::None, internal::None, internal::None,
4736     internal::None, internal::None, internal::None, internal::None,
4737     internal::None, internal::None, internal::None, internal::None,
4738     internal::None> {
4739   typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4740       T13, T14, T15, T16, T17> type;
4741 };
4742 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4743     typename T6, typename T7, typename T8, typename T9, typename T10,
4744     typename T11, typename T12, typename T13, typename T14, typename T15,
4745     typename T16, typename T17, typename T18>
4746 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4747     T16, T17, T18, 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, internal::None, internal::None, internal::None,
4753     internal::None, internal::None, internal::None, internal::None,
4754     internal::None, internal::None, internal::None, internal::None,
4755     internal::None> {
4756   typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4757       T13, T14, T15, T16, T17, T18> type;
4758 };
4759 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4760     typename T6, typename T7, typename T8, typename T9, typename T10,
4761     typename T11, typename T12, typename T13, typename T14, typename T15,
4762     typename T16, typename T17, typename T18, typename T19>
4763 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4764     T16, T17, T18, T19, 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     internal::None, internal::None, internal::None, internal::None,
4770     internal::None, internal::None, internal::None, internal::None,
4771     internal::None, internal::None, internal::None, internal::None> {
4772   typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4773       T13, T14, T15, T16, T17, T18, T19> type;
4774 };
4775 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4776     typename T6, typename T7, typename T8, typename T9, typename T10,
4777     typename T11, typename T12, typename T13, typename T14, typename T15,
4778     typename T16, typename T17, typename T18, typename T19, typename T20>
4779 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4780     T16, T17, T18, T19, T20, 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, internal::None,
4785     internal::None, internal::None, internal::None, internal::None,
4786     internal::None, internal::None, internal::None, internal::None,
4787     internal::None, internal::None, internal::None> {
4788   typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4789       T13, T14, T15, T16, T17, T18, T19, T20> type;
4790 };
4791 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4792     typename T6, typename T7, typename T8, typename T9, typename T10,
4793     typename T11, typename T12, typename T13, typename T14, typename T15,
4794     typename T16, typename T17, typename T18, typename T19, typename T20,
4795     typename T21>
4796 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4797     T16, T17, T18, T19, T20, T21, 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, internal::None,
4802     internal::None, internal::None, internal::None, internal::None,
4803     internal::None, internal::None, internal::None, internal::None,
4804     internal::None, internal::None, internal::None> {
4805   typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4806       T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
4807 };
4808 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4809     typename T6, typename T7, typename T8, typename T9, typename T10,
4810     typename T11, typename T12, typename T13, typename T14, typename T15,
4811     typename T16, typename T17, typename T18, typename T19, typename T20,
4812     typename T21, typename T22>
4813 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4814     T16, T17, T18, T19, T20, T21, T22, 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, internal::None, internal::None,
4819     internal::None, internal::None, internal::None, internal::None,
4820     internal::None, internal::None, internal::None, internal::None,
4821     internal::None, internal::None> {
4822   typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4823       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
4824 };
4825 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4826     typename T6, typename T7, typename T8, typename T9, typename T10,
4827     typename T11, typename T12, typename T13, typename T14, typename T15,
4828     typename T16, typename T17, typename T18, typename T19, typename T20,
4829     typename T21, typename T22, typename T23>
4830 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4831     T16, T17, T18, T19, T20, T21, T22, T23, 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, internal::None, internal::None, internal::None,
4836     internal::None, internal::None, internal::None, internal::None,
4837     internal::None, internal::None, internal::None, internal::None,
4838     internal::None> {
4839   typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4840       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
4841 };
4842 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4843     typename T6, typename T7, typename T8, typename T9, typename T10,
4844     typename T11, typename T12, typename T13, typename T14, typename T15,
4845     typename T16, typename T17, typename T18, typename T19, typename T20,
4846     typename T21, typename T22, typename T23, typename T24>
4847 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4848     T16, T17, T18, T19, T20, T21, T22, T23, T24, 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, internal::None, internal::None, internal::None,
4853     internal::None, internal::None, internal::None, internal::None,
4854     internal::None, internal::None, internal::None, internal::None,
4855     internal::None> {
4856   typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4857       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
4858 };
4859 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4860     typename T6, typename T7, typename T8, typename T9, typename T10,
4861     typename T11, typename T12, typename T13, typename T14, typename T15,
4862     typename T16, typename T17, typename T18, typename T19, typename T20,
4863     typename T21, typename T22, typename T23, typename T24, typename T25>
4864 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4865     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, 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     internal::None, internal::None, internal::None, internal::None,
4870     internal::None, internal::None, internal::None, internal::None,
4871     internal::None, internal::None, internal::None, internal::None> {
4872   typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4873       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
4874 };
4875 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4876     typename T6, typename T7, typename T8, typename T9, typename T10,
4877     typename T11, typename T12, typename T13, typename T14, typename T15,
4878     typename T16, typename T17, typename T18, typename T19, typename T20,
4879     typename T21, typename T22, typename T23, typename T24, typename T25,
4880     typename T26>
4881 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4882     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, 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, internal::None,
4886     internal::None, internal::None, internal::None, internal::None,
4887     internal::None, internal::None, internal::None, internal::None,
4888     internal::None, internal::None, internal::None> {
4889   typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4890       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
4891       T26> type;
4892 };
4893 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4894     typename T6, typename T7, typename T8, typename T9, typename T10,
4895     typename T11, typename T12, typename T13, typename T14, typename T15,
4896     typename T16, typename T17, typename T18, typename T19, typename T20,
4897     typename T21, typename T22, typename T23, typename T24, typename T25,
4898     typename T26, typename T27>
4899 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4900     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, 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, internal::None, internal::None,
4904     internal::None, internal::None, internal::None, internal::None,
4905     internal::None, internal::None, internal::None, internal::None,
4906     internal::None, internal::None> {
4907   typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4908       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4909       T27> type;
4910 };
4911 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4912     typename T6, typename T7, typename T8, typename T9, typename T10,
4913     typename T11, typename T12, typename T13, typename T14, typename T15,
4914     typename T16, typename T17, typename T18, typename T19, typename T20,
4915     typename T21, typename T22, typename T23, typename T24, typename T25,
4916     typename T26, typename T27, typename T28>
4917 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4918     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
4919     internal::None, internal::None, internal::None, internal::None,
4920     internal::None, internal::None, internal::None, internal::None,
4921     internal::None, internal::None, internal::None, internal::None,
4922     internal::None, internal::None, internal::None, internal::None,
4923     internal::None, internal::None, internal::None, internal::None,
4924     internal::None, internal::None> {
4925   typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4926       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4927       T27, T28> type;
4928 };
4929 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4930     typename T6, typename T7, typename T8, typename T9, typename T10,
4931     typename T11, typename T12, typename T13, typename T14, typename T15,
4932     typename T16, typename T17, typename T18, typename T19, typename T20,
4933     typename T21, typename T22, typename T23, typename T24, typename T25,
4934     typename T26, typename T27, typename T28, typename T29>
4935 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4936     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4937     internal::None, internal::None, internal::None, internal::None,
4938     internal::None, internal::None, internal::None, internal::None,
4939     internal::None, internal::None, internal::None, internal::None,
4940     internal::None, internal::None, internal::None, internal::None,
4941     internal::None, internal::None, internal::None, internal::None,
4942     internal::None> {
4943   typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4944       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4945       T27, T28, T29> type;
4946 };
4947 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4948     typename T6, typename T7, typename T8, typename T9, typename T10,
4949     typename T11, typename T12, typename T13, typename T14, typename T15,
4950     typename T16, typename T17, typename T18, typename T19, typename T20,
4951     typename T21, typename T22, typename T23, typename T24, typename T25,
4952     typename T26, typename T27, typename T28, typename T29, typename T30>
4953 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4954     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4955     internal::None, internal::None, internal::None, internal::None,
4956     internal::None, internal::None, internal::None, internal::None,
4957     internal::None, internal::None, internal::None, internal::None,
4958     internal::None, internal::None, internal::None, internal::None,
4959     internal::None, internal::None, internal::None, internal::None> {
4960   typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4961       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4962       T27, T28, T29, T30> type;
4963 };
4964 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4965     typename T6, typename T7, typename T8, typename T9, typename T10,
4966     typename T11, typename T12, typename T13, typename T14, typename T15,
4967     typename T16, typename T17, typename T18, typename T19, typename T20,
4968     typename T21, typename T22, typename T23, typename T24, typename T25,
4969     typename T26, typename T27, typename T28, typename T29, typename T30,
4970     typename T31>
4971 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4972     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4973     T31, internal::None, internal::None, internal::None, internal::None,
4974     internal::None, internal::None, internal::None, internal::None,
4975     internal::None, internal::None, internal::None, internal::None,
4976     internal::None, internal::None, internal::None, internal::None,
4977     internal::None, internal::None, internal::None> {
4978   typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4979       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4980       T27, T28, T29, T30, T31> type;
4981 };
4982 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4983     typename T6, typename T7, typename T8, typename T9, typename T10,
4984     typename T11, typename T12, typename T13, typename T14, typename T15,
4985     typename T16, typename T17, typename T18, typename T19, typename T20,
4986     typename T21, typename T22, typename T23, typename T24, typename T25,
4987     typename T26, typename T27, typename T28, typename T29, typename T30,
4988     typename T31, typename T32>
4989 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4990     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4991     T31, T32, internal::None, internal::None, internal::None, internal::None,
4992     internal::None, internal::None, internal::None, internal::None,
4993     internal::None, internal::None, internal::None, internal::None,
4994     internal::None, internal::None, internal::None, internal::None,
4995     internal::None, internal::None> {
4996   typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4997       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4998       T27, T28, T29, T30, T31, T32> type;
4999 };
5000 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5001     typename T6, typename T7, typename T8, typename T9, typename T10,
5002     typename T11, typename T12, typename T13, typename T14, typename T15,
5003     typename T16, typename T17, typename T18, typename T19, typename T20,
5004     typename T21, typename T22, typename T23, typename T24, typename T25,
5005     typename T26, typename T27, typename T28, typename T29, typename T30,
5006     typename T31, typename T32, typename T33>
5007 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5008     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5009     T31, T32, T33, internal::None, internal::None, internal::None,
5010     internal::None, internal::None, internal::None, internal::None,
5011     internal::None, internal::None, internal::None, internal::None,
5012     internal::None, internal::None, internal::None, internal::None,
5013     internal::None, internal::None> {
5014   typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5015       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5016       T27, T28, T29, T30, T31, T32, T33> type;
5017 };
5018 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5019     typename T6, typename T7, typename T8, typename T9, typename T10,
5020     typename T11, typename T12, typename T13, typename T14, typename T15,
5021     typename T16, typename T17, typename T18, typename T19, typename T20,
5022     typename T21, typename T22, typename T23, typename T24, typename T25,
5023     typename T26, typename T27, typename T28, typename T29, typename T30,
5024     typename T31, typename T32, typename T33, typename T34>
5025 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5026     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5027     T31, T32, T33, T34, internal::None, internal::None, internal::None,
5028     internal::None, internal::None, internal::None, internal::None,
5029     internal::None, internal::None, internal::None, internal::None,
5030     internal::None, internal::None, internal::None, internal::None,
5031     internal::None> {
5032   typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5033       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5034       T27, T28, T29, T30, T31, T32, T33, T34> type;
5035 };
5036 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5037     typename T6, typename T7, typename T8, typename T9, typename T10,
5038     typename T11, typename T12, typename T13, typename T14, typename T15,
5039     typename T16, typename T17, typename T18, typename T19, typename T20,
5040     typename T21, typename T22, typename T23, typename T24, typename T25,
5041     typename T26, typename T27, typename T28, typename T29, typename T30,
5042     typename T31, typename T32, typename T33, typename T34, typename T35>
5043 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5044     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5045     T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
5046     internal::None, internal::None, internal::None, internal::None,
5047     internal::None, internal::None, internal::None, internal::None,
5048     internal::None, internal::None, internal::None, internal::None> {
5049   typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5050       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5051       T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
5052 };
5053 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5054     typename T6, typename T7, typename T8, typename T9, typename T10,
5055     typename T11, typename T12, typename T13, typename T14, typename T15,
5056     typename T16, typename T17, typename T18, typename T19, typename T20,
5057     typename T21, typename T22, typename T23, typename T24, typename T25,
5058     typename T26, typename T27, typename T28, typename T29, typename T30,
5059     typename T31, typename T32, typename T33, typename T34, typename T35,
5060     typename T36>
5061 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5062     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5063     T31, T32, T33, T34, T35, T36, internal::None, internal::None,
5064     internal::None, internal::None, internal::None, internal::None,
5065     internal::None, internal::None, internal::None, internal::None,
5066     internal::None, internal::None, internal::None, internal::None> {
5067   typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5068       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5069       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
5070 };
5071 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5072     typename T6, typename T7, typename T8, typename T9, typename T10,
5073     typename T11, typename T12, typename T13, typename T14, typename T15,
5074     typename T16, typename T17, typename T18, typename T19, typename T20,
5075     typename T21, typename T22, typename T23, typename T24, typename T25,
5076     typename T26, typename T27, typename T28, typename T29, typename T30,
5077     typename T31, typename T32, typename T33, typename T34, typename T35,
5078     typename T36, typename T37>
5079 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5080     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5081     T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
5082     internal::None, internal::None, internal::None, internal::None,
5083     internal::None, internal::None, internal::None, internal::None,
5084     internal::None, internal::None, internal::None> {
5085   typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5086       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5087       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
5088 };
5089 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5090     typename T6, typename T7, typename T8, typename T9, typename T10,
5091     typename T11, typename T12, typename T13, typename T14, typename T15,
5092     typename T16, typename T17, typename T18, typename T19, typename T20,
5093     typename T21, typename T22, typename T23, typename T24, typename T25,
5094     typename T26, typename T27, typename T28, typename T29, typename T30,
5095     typename T31, typename T32, typename T33, typename T34, typename T35,
5096     typename T36, typename T37, typename T38>
5097 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5098     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5099     T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
5100     internal::None, internal::None, internal::None, internal::None,
5101     internal::None, internal::None, internal::None, internal::None,
5102     internal::None, internal::None> {
5103   typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5104       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5105       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
5106 };
5107 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5108     typename T6, typename T7, typename T8, typename T9, typename T10,
5109     typename T11, typename T12, typename T13, typename T14, typename T15,
5110     typename T16, typename T17, typename T18, typename T19, typename T20,
5111     typename T21, typename T22, typename T23, typename T24, typename T25,
5112     typename T26, typename T27, typename T28, typename T29, typename T30,
5113     typename T31, typename T32, typename T33, typename T34, typename T35,
5114     typename T36, typename T37, typename T38, typename T39>
5115 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5116     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5117     T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
5118     internal::None, internal::None, internal::None, internal::None,
5119     internal::None, internal::None, internal::None, internal::None,
5120     internal::None, internal::None> {
5121   typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5122       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5123       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
5124 };
5125 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5126     typename T6, typename T7, typename T8, typename T9, typename T10,
5127     typename T11, typename T12, typename T13, typename T14, typename T15,
5128     typename T16, typename T17, typename T18, typename T19, typename T20,
5129     typename T21, typename T22, typename T23, typename T24, typename T25,
5130     typename T26, typename T27, typename T28, typename T29, typename T30,
5131     typename T31, typename T32, typename T33, typename T34, typename T35,
5132     typename T36, typename T37, typename T38, typename T39, typename T40>
5133 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5134     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5135     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
5136     internal::None, internal::None, internal::None, internal::None,
5137     internal::None, internal::None, internal::None, internal::None,
5138     internal::None> {
5139   typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5140       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5141       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
5142       T40> type;
5143 };
5144 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5145     typename T6, typename T7, typename T8, typename T9, typename T10,
5146     typename T11, typename T12, typename T13, typename T14, typename T15,
5147     typename T16, typename T17, typename T18, typename T19, typename T20,
5148     typename T21, typename T22, typename T23, typename T24, typename T25,
5149     typename T26, typename T27, typename T28, typename T29, typename T30,
5150     typename T31, typename T32, typename T33, typename T34, typename T35,
5151     typename T36, typename T37, typename T38, typename T39, typename T40,
5152     typename T41>
5153 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5154     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5155     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
5156     internal::None, internal::None, internal::None, internal::None,
5157     internal::None, internal::None, internal::None, internal::None> {
5158   typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5159       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5160       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5161       T41> type;
5162 };
5163 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5164     typename T6, typename T7, typename T8, typename T9, typename T10,
5165     typename T11, typename T12, typename T13, typename T14, typename T15,
5166     typename T16, typename T17, typename T18, typename T19, typename T20,
5167     typename T21, typename T22, typename T23, typename T24, typename T25,
5168     typename T26, typename T27, typename T28, typename T29, typename T30,
5169     typename T31, typename T32, typename T33, typename T34, typename T35,
5170     typename T36, typename T37, typename T38, typename T39, typename T40,
5171     typename T41, typename T42>
5172 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5173     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5174     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
5175     internal::None, internal::None, internal::None, internal::None,
5176     internal::None, internal::None, internal::None> {
5177   typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5178       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5179       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5180       T41, T42> type;
5181 };
5182 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5183     typename T6, typename T7, typename T8, typename T9, typename T10,
5184     typename T11, typename T12, typename T13, typename T14, typename T15,
5185     typename T16, typename T17, typename T18, typename T19, typename T20,
5186     typename T21, typename T22, typename T23, typename T24, typename T25,
5187     typename T26, typename T27, typename T28, typename T29, typename T30,
5188     typename T31, typename T32, typename T33, typename T34, typename T35,
5189     typename T36, typename T37, typename T38, typename T39, typename T40,
5190     typename T41, typename T42, typename T43>
5191 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5192     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5193     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
5194     internal::None, internal::None, internal::None, internal::None,
5195     internal::None, internal::None, internal::None> {
5196   typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5197       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5198       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5199       T41, T42, T43> type;
5200 };
5201 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5202     typename T6, typename T7, typename T8, typename T9, typename T10,
5203     typename T11, typename T12, typename T13, typename T14, typename T15,
5204     typename T16, typename T17, typename T18, typename T19, typename T20,
5205     typename T21, typename T22, typename T23, typename T24, typename T25,
5206     typename T26, typename T27, typename T28, typename T29, typename T30,
5207     typename T31, typename T32, typename T33, typename T34, typename T35,
5208     typename T36, typename T37, typename T38, typename T39, typename T40,
5209     typename T41, typename T42, typename T43, typename T44>
5210 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5211     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5212     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
5213     internal::None, internal::None, internal::None, internal::None,
5214     internal::None, internal::None> {
5215   typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5216       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5217       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5218       T41, T42, T43, T44> type;
5219 };
5220 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5221     typename T6, typename T7, typename T8, typename T9, typename T10,
5222     typename T11, typename T12, typename T13, typename T14, typename T15,
5223     typename T16, typename T17, typename T18, typename T19, typename T20,
5224     typename T21, typename T22, typename T23, typename T24, typename T25,
5225     typename T26, typename T27, typename T28, typename T29, typename T30,
5226     typename T31, typename T32, typename T33, typename T34, typename T35,
5227     typename T36, typename T37, typename T38, typename T39, typename T40,
5228     typename T41, typename T42, typename T43, typename T44, typename T45>
5229 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5230     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5231     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5232     internal::None, internal::None, internal::None, internal::None,
5233     internal::None> {
5234   typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5235       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5236       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5237       T41, T42, T43, T44, T45> type;
5238 };
5239 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5240     typename T6, typename T7, typename T8, typename T9, typename T10,
5241     typename T11, typename T12, typename T13, typename T14, typename T15,
5242     typename T16, typename T17, typename T18, typename T19, typename T20,
5243     typename T21, typename T22, typename T23, typename T24, typename T25,
5244     typename T26, typename T27, typename T28, typename T29, typename T30,
5245     typename T31, typename T32, typename T33, typename T34, typename T35,
5246     typename T36, typename T37, typename T38, typename T39, typename T40,
5247     typename T41, typename T42, typename T43, typename T44, typename T45,
5248     typename T46>
5249 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5250     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5251     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5252     T46, internal::None, internal::None, internal::None, internal::None> {
5253   typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5254       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5255       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5256       T41, T42, T43, T44, T45, T46> type;
5257 };
5258 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5259     typename T6, typename T7, typename T8, typename T9, typename T10,
5260     typename T11, typename T12, typename T13, typename T14, typename T15,
5261     typename T16, typename T17, typename T18, typename T19, typename T20,
5262     typename T21, typename T22, typename T23, typename T24, typename T25,
5263     typename T26, typename T27, typename T28, typename T29, typename T30,
5264     typename T31, typename T32, typename T33, typename T34, typename T35,
5265     typename T36, typename T37, typename T38, typename T39, typename T40,
5266     typename T41, typename T42, typename T43, typename T44, typename T45,
5267     typename T46, typename T47>
5268 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5269     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5270     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5271     T46, T47, internal::None, internal::None, internal::None> {
5272   typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5273       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5274       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5275       T41, T42, T43, T44, T45, T46, T47> type;
5276 };
5277 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5278     typename T6, typename T7, typename T8, typename T9, typename T10,
5279     typename T11, typename T12, typename T13, typename T14, typename T15,
5280     typename T16, typename T17, typename T18, typename T19, typename T20,
5281     typename T21, typename T22, typename T23, typename T24, typename T25,
5282     typename T26, typename T27, typename T28, typename T29, typename T30,
5283     typename T31, typename T32, typename T33, typename T34, typename T35,
5284     typename T36, typename T37, typename T38, typename T39, typename T40,
5285     typename T41, typename T42, typename T43, typename T44, typename T45,
5286     typename T46, typename T47, typename T48>
5287 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5288     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5289     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5290     T46, T47, T48, internal::None, internal::None> {
5291   typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5292       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5293       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5294       T41, T42, T43, T44, T45, T46, T47, T48> type;
5295 };
5296 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5297     typename T6, typename T7, typename T8, typename T9, typename T10,
5298     typename T11, typename T12, typename T13, typename T14, typename T15,
5299     typename T16, typename T17, typename T18, typename T19, typename T20,
5300     typename T21, typename T22, typename T23, typename T24, typename T25,
5301     typename T26, typename T27, typename T28, typename T29, typename T30,
5302     typename T31, typename T32, typename T33, typename T34, typename T35,
5303     typename T36, typename T37, typename T38, typename T39, typename T40,
5304     typename T41, typename T42, typename T43, typename T44, typename T45,
5305     typename T46, typename T47, typename T48, typename T49>
5306 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5307     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5308     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5309     T46, T47, T48, T49, internal::None> {
5310   typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5311       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5312       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5313       T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
5314 };
5315 
5316 namespace internal {
5317 
5318 # define GTEST_TEMPLATE_ template <typename T> class
5319 
5320 // The template "selector" struct TemplateSel<Tmpl> is used to
5321 // represent Tmpl, which must be a class template with one type
5322 // parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined
5323 // as the type Tmpl<T>.  This allows us to actually instantiate the
5324 // template "selected" by TemplateSel<Tmpl>.
5325 //
5326 // This trick is necessary for simulating typedef for class templates,
5327 // which C++ doesn't support directly.
5328 template <GTEST_TEMPLATE_ Tmpl>
5329 struct TemplateSel {
5330   template <typename T>
5331   struct Bind {
5332     typedef Tmpl<T> type;
5333   };
5334 };
5335 
5336 # define GTEST_BIND_(TmplSel, T) \
5337   TmplSel::template Bind<T>::type
5338 
5339 // A unique struct template used as the default value for the
5340 // arguments of class template Templates.  This allows us to simulate
5341 // variadic templates (e.g. Templates<int>, Templates<int, double>,
5342 // and etc), which C++ doesn't support directly.
5343 template <typename T>
5344 struct NoneT {};
5345 
5346 // The following family of struct and struct templates are used to
5347 // represent template lists.  In particular, TemplatesN<T1, T2, ...,
5348 // TN> represents a list of N templates (T1, T2, ..., and TN).  Except
5349 // for Templates0, every struct in the family has two member types:
5350 // Head for the selector of the first template in the list, and Tail
5351 // for the rest of the list.
5352 
5353 // The empty template list.
5354 struct Templates0 {};
5355 
5356 // Template lists of length 1, 2, 3, and so on.
5357 
5358 template <GTEST_TEMPLATE_ T1>
5359 struct Templates1 {
5360   typedef TemplateSel<T1> Head;
5361   typedef Templates0 Tail;
5362 };
5363 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
5364 struct Templates2 {
5365   typedef TemplateSel<T1> Head;
5366   typedef Templates1<T2> Tail;
5367 };
5368 
5369 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
5370 struct Templates3 {
5371   typedef TemplateSel<T1> Head;
5372   typedef Templates2<T2, T3> Tail;
5373 };
5374 
5375 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5376     GTEST_TEMPLATE_ T4>
5377 struct Templates4 {
5378   typedef TemplateSel<T1> Head;
5379   typedef Templates3<T2, T3, T4> Tail;
5380 };
5381 
5382 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5383     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
5384 struct Templates5 {
5385   typedef TemplateSel<T1> Head;
5386   typedef Templates4<T2, T3, T4, T5> Tail;
5387 };
5388 
5389 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5390     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
5391 struct Templates6 {
5392   typedef TemplateSel<T1> Head;
5393   typedef Templates5<T2, T3, T4, T5, T6> Tail;
5394 };
5395 
5396 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5397     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5398     GTEST_TEMPLATE_ T7>
5399 struct Templates7 {
5400   typedef TemplateSel<T1> Head;
5401   typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
5402 };
5403 
5404 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5405     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5406     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
5407 struct Templates8 {
5408   typedef TemplateSel<T1> Head;
5409   typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
5410 };
5411 
5412 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5413     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5414     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
5415 struct Templates9 {
5416   typedef TemplateSel<T1> Head;
5417   typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
5418 };
5419 
5420 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5421     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5422     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5423     GTEST_TEMPLATE_ T10>
5424 struct Templates10 {
5425   typedef TemplateSel<T1> Head;
5426   typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
5427 };
5428 
5429 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5430     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5431     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5432     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
5433 struct Templates11 {
5434   typedef TemplateSel<T1> Head;
5435   typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
5436 };
5437 
5438 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5439     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5440     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5441     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
5442 struct Templates12 {
5443   typedef TemplateSel<T1> Head;
5444   typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
5445 };
5446 
5447 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5448     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5449     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5450     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5451     GTEST_TEMPLATE_ T13>
5452 struct Templates13 {
5453   typedef TemplateSel<T1> Head;
5454   typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
5455 };
5456 
5457 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5458     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5459     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5460     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5461     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
5462 struct Templates14 {
5463   typedef TemplateSel<T1> Head;
5464   typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5465       T14> Tail;
5466 };
5467 
5468 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5469     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5470     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5471     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5472     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
5473 struct Templates15 {
5474   typedef TemplateSel<T1> Head;
5475   typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5476       T15> Tail;
5477 };
5478 
5479 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5480     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5481     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5482     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5483     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5484     GTEST_TEMPLATE_ T16>
5485 struct Templates16 {
5486   typedef TemplateSel<T1> Head;
5487   typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5488       T15, T16> Tail;
5489 };
5490 
5491 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5492     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5493     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5494     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5495     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5496     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
5497 struct Templates17 {
5498   typedef TemplateSel<T1> Head;
5499   typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5500       T15, T16, T17> Tail;
5501 };
5502 
5503 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5504     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5505     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5506     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5507     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5508     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
5509 struct Templates18 {
5510   typedef TemplateSel<T1> Head;
5511   typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5512       T15, T16, T17, T18> Tail;
5513 };
5514 
5515 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5516     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5517     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5518     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5519     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5520     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5521     GTEST_TEMPLATE_ T19>
5522 struct Templates19 {
5523   typedef TemplateSel<T1> Head;
5524   typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5525       T15, T16, T17, T18, T19> Tail;
5526 };
5527 
5528 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5529     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5530     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5531     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5532     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5533     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5534     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
5535 struct Templates20 {
5536   typedef TemplateSel<T1> Head;
5537   typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5538       T15, T16, T17, T18, T19, T20> Tail;
5539 };
5540 
5541 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5542     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5543     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5544     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5545     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5546     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5547     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
5548 struct Templates21 {
5549   typedef TemplateSel<T1> Head;
5550   typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5551       T15, T16, T17, T18, T19, T20, T21> Tail;
5552 };
5553 
5554 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5555     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5556     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5557     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5558     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5559     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5560     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5561     GTEST_TEMPLATE_ T22>
5562 struct Templates22 {
5563   typedef TemplateSel<T1> Head;
5564   typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5565       T15, T16, T17, T18, T19, T20, T21, T22> Tail;
5566 };
5567 
5568 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5569     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5570     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5571     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5572     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5573     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5574     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5575     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
5576 struct Templates23 {
5577   typedef TemplateSel<T1> Head;
5578   typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5579       T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
5580 };
5581 
5582 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5583     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5584     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5585     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5586     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5587     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5588     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5589     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
5590 struct Templates24 {
5591   typedef TemplateSel<T1> Head;
5592   typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5593       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
5594 };
5595 
5596 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5597     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5598     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5599     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5600     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5601     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5602     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5603     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5604     GTEST_TEMPLATE_ T25>
5605 struct Templates25 {
5606   typedef TemplateSel<T1> Head;
5607   typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5608       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
5609 };
5610 
5611 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5612     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5613     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5614     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5615     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5616     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5617     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5618     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5619     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
5620 struct Templates26 {
5621   typedef TemplateSel<T1> Head;
5622   typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5623       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
5624 };
5625 
5626 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5627     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5628     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5629     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5630     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5631     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5632     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5633     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5634     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
5635 struct Templates27 {
5636   typedef TemplateSel<T1> Head;
5637   typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5638       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
5639 };
5640 
5641 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5642     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5643     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5644     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5645     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5646     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5647     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5648     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5649     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5650     GTEST_TEMPLATE_ T28>
5651 struct Templates28 {
5652   typedef TemplateSel<T1> Head;
5653   typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5654       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5655       T28> Tail;
5656 };
5657 
5658 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5659     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5660     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5661     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5662     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5663     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5664     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5665     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5666     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5667     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
5668 struct Templates29 {
5669   typedef TemplateSel<T1> Head;
5670   typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5671       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5672       T29> Tail;
5673 };
5674 
5675 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5676     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5677     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5678     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5679     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5680     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5681     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5682     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5683     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5684     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
5685 struct Templates30 {
5686   typedef TemplateSel<T1> Head;
5687   typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5688       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5689       T29, T30> Tail;
5690 };
5691 
5692 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5693     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5694     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5695     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5696     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5697     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5698     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5699     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5700     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5701     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5702     GTEST_TEMPLATE_ T31>
5703 struct Templates31 {
5704   typedef TemplateSel<T1> Head;
5705   typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5706       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5707       T29, T30, T31> Tail;
5708 };
5709 
5710 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5711     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5712     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5713     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5714     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5715     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5716     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5717     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5718     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5719     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5720     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
5721 struct Templates32 {
5722   typedef TemplateSel<T1> Head;
5723   typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5724       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5725       T29, T30, T31, T32> Tail;
5726 };
5727 
5728 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5729     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5730     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5731     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5732     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5733     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5734     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5735     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5736     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5737     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5738     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
5739 struct Templates33 {
5740   typedef TemplateSel<T1> Head;
5741   typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5742       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5743       T29, T30, T31, T32, T33> Tail;
5744 };
5745 
5746 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5747     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5748     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5749     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5750     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5751     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5752     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5753     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5754     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5755     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5756     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5757     GTEST_TEMPLATE_ T34>
5758 struct Templates34 {
5759   typedef TemplateSel<T1> Head;
5760   typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5761       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5762       T29, T30, T31, T32, T33, T34> Tail;
5763 };
5764 
5765 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5766     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5767     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5768     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5769     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5770     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5771     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5772     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5773     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5774     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5775     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5776     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
5777 struct Templates35 {
5778   typedef TemplateSel<T1> Head;
5779   typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5780       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5781       T29, T30, T31, T32, T33, T34, T35> Tail;
5782 };
5783 
5784 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5785     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5786     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5787     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5788     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5789     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5790     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5791     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5792     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5793     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5794     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5795     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
5796 struct Templates36 {
5797   typedef TemplateSel<T1> Head;
5798   typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5799       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5800       T29, T30, T31, T32, T33, T34, T35, T36> Tail;
5801 };
5802 
5803 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5804     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5805     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5806     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5807     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5808     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5809     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5810     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5811     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5812     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5813     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5814     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5815     GTEST_TEMPLATE_ T37>
5816 struct Templates37 {
5817   typedef TemplateSel<T1> Head;
5818   typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5819       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5820       T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
5821 };
5822 
5823 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5824     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5825     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5826     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5827     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5828     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5829     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5830     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5831     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5832     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5833     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5834     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5835     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
5836 struct Templates38 {
5837   typedef TemplateSel<T1> Head;
5838   typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5839       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5840       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
5841 };
5842 
5843 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5844     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5845     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5846     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5847     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5848     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5849     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5850     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5851     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5852     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5853     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5854     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5855     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
5856 struct Templates39 {
5857   typedef TemplateSel<T1> Head;
5858   typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5859       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5860       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
5861 };
5862 
5863 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5864     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5865     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5866     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5867     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5868     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5869     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5870     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5871     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5872     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5873     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5874     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5875     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5876     GTEST_TEMPLATE_ T40>
5877 struct Templates40 {
5878   typedef TemplateSel<T1> Head;
5879   typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5880       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5881       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
5882 };
5883 
5884 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5885     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5886     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5887     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5888     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5889     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5890     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5891     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5892     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5893     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5894     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5895     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5896     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5897     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
5898 struct Templates41 {
5899   typedef TemplateSel<T1> Head;
5900   typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5901       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5902       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
5903 };
5904 
5905 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5906     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5907     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5908     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5909     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5910     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5911     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5912     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5913     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5914     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5915     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5916     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5917     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5918     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
5919 struct Templates42 {
5920   typedef TemplateSel<T1> Head;
5921   typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5922       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5923       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
5924       T42> Tail;
5925 };
5926 
5927 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5928     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5929     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5930     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5931     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5932     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5933     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5934     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5935     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5936     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5937     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5938     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5939     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5940     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5941     GTEST_TEMPLATE_ T43>
5942 struct Templates43 {
5943   typedef TemplateSel<T1> Head;
5944   typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5945       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5946       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5947       T43> Tail;
5948 };
5949 
5950 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5951     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5952     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5953     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5954     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5955     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5956     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5957     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5958     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5959     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5960     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5961     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5962     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5963     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5964     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
5965 struct Templates44 {
5966   typedef TemplateSel<T1> Head;
5967   typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5968       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5969       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5970       T43, T44> Tail;
5971 };
5972 
5973 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5974     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5975     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5976     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5977     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5978     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5979     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5980     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5981     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5982     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5983     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5984     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5985     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5986     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5987     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
5988 struct Templates45 {
5989   typedef TemplateSel<T1> Head;
5990   typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5991       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5992       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5993       T43, T44, T45> Tail;
5994 };
5995 
5996 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5997     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5998     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5999     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6000     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6001     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6002     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6003     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6004     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6005     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6006     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6007     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6008     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6009     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6010     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6011     GTEST_TEMPLATE_ T46>
6012 struct Templates46 {
6013   typedef TemplateSel<T1> Head;
6014   typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6015       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6016       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6017       T43, T44, T45, T46> Tail;
6018 };
6019 
6020 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6021     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6022     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6023     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6024     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6025     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6026     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6027     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6028     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6029     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6030     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6031     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6032     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6033     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6034     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6035     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6036 struct Templates47 {
6037   typedef TemplateSel<T1> Head;
6038   typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6039       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6040       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6041       T43, T44, T45, T46, T47> Tail;
6042 };
6043 
6044 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6045     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6046     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6047     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6048     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6049     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6050     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6051     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6052     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6053     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6054     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6055     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6056     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6057     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6058     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6059     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
6060 struct Templates48 {
6061   typedef TemplateSel<T1> Head;
6062   typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6063       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6064       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6065       T43, T44, T45, T46, T47, T48> Tail;
6066 };
6067 
6068 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6069     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6070     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6071     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6072     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6073     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6074     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6075     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6076     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6077     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6078     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6079     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6080     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6081     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6082     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6083     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6084     GTEST_TEMPLATE_ T49>
6085 struct Templates49 {
6086   typedef TemplateSel<T1> Head;
6087   typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6088       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6089       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6090       T43, T44, T45, T46, T47, T48, T49> Tail;
6091 };
6092 
6093 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6094     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6095     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6096     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6097     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6098     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6099     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6100     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6101     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6102     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6103     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6104     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6105     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6106     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6107     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6108     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6109     GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
6110 struct Templates50 {
6111   typedef TemplateSel<T1> Head;
6112   typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6113       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6114       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
6115       T43, T44, T45, T46, T47, T48, T49, T50> Tail;
6116 };
6117 
6118 
6119 // We don't want to require the users to write TemplatesN<...> directly,
6120 // as that would require them to count the length.  Templates<...> is much
6121 // easier to write, but generates horrible messages when there is a
6122 // compiler error, as gcc insists on printing out each template
6123 // argument, even if it has the default value (this means Templates<list>
6124 // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
6125 // errors).
6126 //
6127 // Our solution is to combine the best part of the two approaches: a
6128 // user would write Templates<T1, ..., TN>, and Google Test will translate
6129 // that to TemplatesN<T1, ..., TN> internally to make error messages
6130 // readable.  The translation is done by the 'type' member of the
6131 // Templates template.
6132 template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
6133     GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
6134     GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
6135     GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
6136     GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
6137     GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
6138     GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
6139     GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
6140     GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
6141     GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
6142     GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
6143     GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
6144     GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
6145     GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
6146     GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
6147     GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
6148     GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
6149     GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
6150     GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
6151     GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
6152     GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
6153     GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
6154     GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
6155     GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
6156     GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
6157 struct Templates {
6158   typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6159       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6160       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6161       T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
6162 };
6163 
6164 template <>
6165 struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6166     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6167     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6168     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6169     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6170     NoneT> {
6171   typedef Templates0 type;
6172 };
6173 template <GTEST_TEMPLATE_ T1>
6174 struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6175     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6176     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6177     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6178     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6179     NoneT> {
6180   typedef Templates1<T1> type;
6181 };
6182 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
6183 struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6184     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6185     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6186     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6187     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6188     NoneT> {
6189   typedef Templates2<T1, T2> type;
6190 };
6191 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
6192 struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6193     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6194     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6195     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6196     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6197   typedef Templates3<T1, T2, T3> type;
6198 };
6199 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6200     GTEST_TEMPLATE_ T4>
6201 struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6202     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6203     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6204     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6205     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6206   typedef Templates4<T1, T2, T3, T4> type;
6207 };
6208 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6209     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
6210 struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6211     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6212     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6213     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6214     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6215   typedef Templates5<T1, T2, T3, T4, T5> type;
6216 };
6217 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6218     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
6219 struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
6220     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6221     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6222     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6223     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6224   typedef Templates6<T1, T2, T3, T4, T5, T6> type;
6225 };
6226 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6227     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6228     GTEST_TEMPLATE_ T7>
6229 struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
6230     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6231     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6232     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6233     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6234   typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
6235 };
6236 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6237     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6238     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
6239 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
6240     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6241     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6242     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6243     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6244   typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
6245 };
6246 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6247     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6248     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
6249 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
6250     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6251     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6252     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6253     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6254   typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
6255 };
6256 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6257     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6258     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6259     GTEST_TEMPLATE_ T10>
6260 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
6261     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6262     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6263     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6264     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6265   typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
6266 };
6267 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6268     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6269     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6270     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
6271 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
6272     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6273     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6274     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6275     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6276   typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
6277 };
6278 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6279     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6280     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6281     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
6282 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
6283     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6284     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6285     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6286     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6287   typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
6288 };
6289 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6290     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6291     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6292     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6293     GTEST_TEMPLATE_ T13>
6294 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
6295     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6296     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6297     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6298     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6299   typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6300       T13> type;
6301 };
6302 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6303     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6304     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6305     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6306     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
6307 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6308     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6309     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6310     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6311     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6312   typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6313       T14> type;
6314 };
6315 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6316     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6317     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6318     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6319     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
6320 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6321     T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6322     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6323     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6324     NoneT, NoneT, NoneT, NoneT, NoneT> {
6325   typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6326       T14, T15> type;
6327 };
6328 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6329     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6330     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6331     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6332     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6333     GTEST_TEMPLATE_ T16>
6334 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6335     T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6336     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6337     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6338     NoneT, NoneT, NoneT, NoneT, NoneT> {
6339   typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6340       T14, T15, T16> type;
6341 };
6342 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6343     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6344     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6345     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6346     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6347     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
6348 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6349     T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6350     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6351     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6352     NoneT, NoneT, NoneT, NoneT, NoneT> {
6353   typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6354       T14, T15, T16, T17> type;
6355 };
6356 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6357     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6358     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6359     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6360     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6361     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
6362 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6363     T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6364     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6365     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6366     NoneT, NoneT, NoneT, NoneT> {
6367   typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6368       T14, T15, T16, T17, T18> type;
6369 };
6370 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6371     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6372     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6373     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6374     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6375     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6376     GTEST_TEMPLATE_ T19>
6377 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6378     T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6379     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6380     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6381     NoneT, NoneT, NoneT, NoneT> {
6382   typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6383       T14, T15, T16, T17, T18, T19> type;
6384 };
6385 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6386     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6387     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6388     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6389     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6390     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6391     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
6392 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6393     T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6394     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6395     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6396     NoneT, NoneT, NoneT, NoneT> {
6397   typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6398       T14, T15, T16, T17, T18, T19, T20> type;
6399 };
6400 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6401     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6402     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6403     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6404     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6405     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6406     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
6407 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6408     T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
6409     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6410     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6411     NoneT, NoneT, NoneT, NoneT> {
6412   typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6413       T14, T15, T16, T17, T18, T19, T20, T21> type;
6414 };
6415 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6416     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6417     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6418     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6419     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6420     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6421     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6422     GTEST_TEMPLATE_ T22>
6423 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6424     T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
6425     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6426     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6427     NoneT, NoneT, NoneT> {
6428   typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6429       T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
6430 };
6431 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6432     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6433     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6434     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6435     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6436     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6437     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6438     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
6439 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6440     T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
6441     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6442     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6443     NoneT, NoneT, NoneT> {
6444   typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6445       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
6446 };
6447 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6448     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6449     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6450     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6451     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6452     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6453     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6454     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
6455 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6456     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
6457     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6458     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6459     NoneT, NoneT, NoneT> {
6460   typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6461       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
6462 };
6463 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6464     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6465     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6466     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6467     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6468     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6469     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6470     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6471     GTEST_TEMPLATE_ T25>
6472 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6473     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
6474     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6475     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6476     NoneT, NoneT> {
6477   typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6478       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
6479 };
6480 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6481     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6482     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6483     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6484     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6485     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6486     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6487     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6488     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
6489 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6490     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
6491     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6492     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6493     NoneT, NoneT> {
6494   typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6495       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
6496 };
6497 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6498     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6499     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6500     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6501     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6502     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6503     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6504     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6505     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
6506 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6507     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
6508     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6509     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6510     NoneT, NoneT> {
6511   typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6512       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6513       T27> type;
6514 };
6515 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6516     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6517     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6518     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6519     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6520     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6521     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6522     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6523     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6524     GTEST_TEMPLATE_ T28>
6525 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6526     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6527     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6528     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6529     NoneT, NoneT> {
6530   typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6531       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6532       T28> type;
6533 };
6534 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6535     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6536     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6537     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6538     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6539     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6540     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6541     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6542     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6543     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
6544 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6545     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6546     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6547     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6548     NoneT> {
6549   typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6550       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6551       T28, T29> type;
6552 };
6553 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6554     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6555     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6556     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6557     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6558     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6559     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6560     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6561     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6562     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
6563 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6564     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6565     T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6566     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6567   typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6568       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6569       T28, T29, T30> type;
6570 };
6571 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6572     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6573     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6574     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6575     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6576     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6577     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6578     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6579     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6580     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6581     GTEST_TEMPLATE_ T31>
6582 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6583     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6584     T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6585     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6586   typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6587       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6588       T28, T29, T30, T31> type;
6589 };
6590 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6591     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6592     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6593     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6594     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6595     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6596     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6597     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6598     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6599     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6600     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
6601 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6602     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6603     T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6604     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6605   typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6606       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6607       T28, T29, T30, T31, T32> type;
6608 };
6609 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6610     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6611     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6612     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6613     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6614     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6615     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6616     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6617     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6618     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6619     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
6620 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6621     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6622     T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6623     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6624   typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6625       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6626       T28, T29, T30, T31, T32, T33> type;
6627 };
6628 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6629     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6630     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6631     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6632     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6633     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6634     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6635     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6636     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6637     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6638     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6639     GTEST_TEMPLATE_ T34>
6640 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6641     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6642     T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6643     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6644   typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6645       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6646       T28, T29, T30, T31, T32, T33, T34> type;
6647 };
6648 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6649     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6650     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6651     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6652     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6653     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6654     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6655     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6656     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6657     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6658     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6659     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
6660 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6661     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6662     T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6663     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6664   typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6665       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6666       T28, T29, T30, T31, T32, T33, T34, T35> type;
6667 };
6668 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6669     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6670     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6671     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6672     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6673     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6674     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6675     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6676     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6677     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6678     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6679     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
6680 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6681     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6682     T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
6683     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6684   typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6685       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6686       T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
6687 };
6688 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6689     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6690     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6691     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6692     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6693     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6694     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6695     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6696     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6697     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6698     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6699     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6700     GTEST_TEMPLATE_ T37>
6701 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6702     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6703     T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
6704     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6705   typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6706       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6707       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
6708 };
6709 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6710     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6711     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6712     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6713     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6714     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6715     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6716     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6717     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6718     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6719     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6720     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6721     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
6722 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6723     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6724     T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
6725     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6726   typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6727       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6728       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
6729 };
6730 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6731     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6732     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6733     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6734     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6735     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6736     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6737     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6738     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6739     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6740     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6741     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6742     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
6743 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6744     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6745     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
6746     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6747   typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6748       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6749       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
6750 };
6751 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6752     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6753     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6754     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6755     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6756     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6757     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6758     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6759     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6760     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6761     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6762     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6763     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6764     GTEST_TEMPLATE_ T40>
6765 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6766     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6767     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
6768     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6769   typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6770       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6771       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
6772 };
6773 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6774     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6775     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6776     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6777     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6778     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6779     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6780     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6781     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6782     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6783     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6784     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6785     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6786     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
6787 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6788     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6789     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
6790     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6791   typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6792       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6793       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6794       T41> type;
6795 };
6796 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6797     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6798     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6799     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6800     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6801     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6802     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6803     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6804     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6805     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6806     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6807     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6808     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6809     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
6810 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6811     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6812     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
6813     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6814   typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6815       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6816       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6817       T42> type;
6818 };
6819 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6820     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6821     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6822     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6823     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6824     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6825     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6826     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6827     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6828     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6829     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6830     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6831     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6832     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6833     GTEST_TEMPLATE_ T43>
6834 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6835     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6836     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
6837     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6838   typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6839       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6840       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6841       T42, T43> type;
6842 };
6843 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6844     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6845     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6846     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6847     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6848     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6849     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6850     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6851     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6852     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6853     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6854     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6855     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6856     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6857     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
6858 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6859     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6860     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6861     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6862   typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6863       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6864       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6865       T42, T43, T44> type;
6866 };
6867 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6868     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6869     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6870     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6871     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6872     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6873     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6874     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6875     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6876     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6877     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6878     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6879     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6880     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6881     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
6882 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6883     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6884     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6885     T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
6886   typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6887       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6888       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6889       T42, T43, T44, T45> type;
6890 };
6891 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6892     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6893     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6894     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6895     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6896     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6897     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6898     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6899     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6900     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6901     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6902     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6903     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6904     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6905     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6906     GTEST_TEMPLATE_ T46>
6907 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6908     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6909     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6910     T45, T46, NoneT, NoneT, NoneT, NoneT> {
6911   typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6912       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6913       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6914       T42, T43, T44, T45, T46> type;
6915 };
6916 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6917     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6918     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6919     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6920     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6921     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6922     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6923     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6924     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6925     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6926     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6927     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6928     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6929     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6930     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6931     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6932 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6933     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6934     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6935     T45, T46, T47, NoneT, NoneT, NoneT> {
6936   typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6937       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6938       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6939       T42, T43, T44, T45, T46, T47> type;
6940 };
6941 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6942     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6943     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6944     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6945     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6946     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6947     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6948     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6949     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6950     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6951     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6952     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6953     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6954     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6955     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6956     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
6957 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6958     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6959     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6960     T45, T46, T47, T48, NoneT, NoneT> {
6961   typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6962       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6963       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6964       T42, T43, T44, T45, T46, T47, T48> type;
6965 };
6966 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6967     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6968     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6969     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6970     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6971     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6972     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6973     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6974     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6975     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6976     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6977     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6978     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6979     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6980     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6981     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6982     GTEST_TEMPLATE_ T49>
6983 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6984     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6985     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6986     T45, T46, T47, T48, T49, NoneT> {
6987   typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6988       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6989       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6990       T42, T43, T44, T45, T46, T47, T48, T49> type;
6991 };
6992 
6993 // The TypeList template makes it possible to use either a single type
6994 // or a Types<...> list in TYPED_TEST_CASE() and
6995 // INSTANTIATE_TYPED_TEST_CASE_P().
6996 
6997 template <typename T>
6998 struct TypeList {
6999   typedef Types1<T> type;
7000 };
7001 
7002 template <typename T1, typename T2, typename T3, typename T4, typename T5,
7003     typename T6, typename T7, typename T8, typename T9, typename T10,
7004     typename T11, typename T12, typename T13, typename T14, typename T15,
7005     typename T16, typename T17, typename T18, typename T19, typename T20,
7006     typename T21, typename T22, typename T23, typename T24, typename T25,
7007     typename T26, typename T27, typename T28, typename T29, typename T30,
7008     typename T31, typename T32, typename T33, typename T34, typename T35,
7009     typename T36, typename T37, typename T38, typename T39, typename T40,
7010     typename T41, typename T42, typename T43, typename T44, typename T45,
7011     typename T46, typename T47, typename T48, typename T49, typename T50>
7012 struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
7013     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
7014     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
7015     T44, T45, T46, T47, T48, T49, T50> > {
7016   typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
7017       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
7018       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
7019       T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
7020 };
7021 
7022 #endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7023 
7024 }  // namespace internal
7025 }  // namespace testing
7026 
7027 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
7028 
7029 // Due to C++ preprocessor weirdness, we need double indirection to
7030 // concatenate two tokens when one of them is __LINE__.  Writing
7031 //
7032 //   foo ## __LINE__
7033 //
7034 // will result in the token foo__LINE__, instead of foo followed by
7035 // the current line number.  For more details, see
7036 // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
7037 #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
7038 #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
7039 
7040 class ProtocolMessage;
7041 namespace proto2 { class Message; }
7042 
7043 namespace testing {
7044 
7045 // Forward declarations.
7046 
7047 class AssertionResult;                 // Result of an assertion.
7048 class Message;                         // Represents a failure message.
7049 class Test;                            // Represents a test.
7050 class TestInfo;                        // Information about a test.
7051 class TestPartResult;                  // Result of a test part.
7052 class UnitTest;                        // A collection of test cases.
7053 
7054 template <typename T>
7055 ::std::string PrintToString(const T& value);
7056 
7057 namespace internal {
7058 
7059 struct TraceInfo;                      // Information about a trace point.
7060 class ScopedTrace;                     // Implements scoped trace.
7061 class TestInfoImpl;                    // Opaque implementation of TestInfo
7062 class UnitTestImpl;                    // Opaque implementation of UnitTest
7063 
7064 // How many times InitGoogleTest() has been called.
7065 GTEST_API_ extern int g_init_gtest_count;
7066 
7067 // The text used in failure messages to indicate the start of the
7068 // stack trace.
7069 GTEST_API_ extern const char kStackTraceMarker[];
7070 
7071 // Two overloaded helpers for checking at compile time whether an
7072 // expression is a null pointer literal (i.e. NULL or any 0-valued
7073 // compile-time integral constant).  Their return values have
7074 // different sizes, so we can use sizeof() to test which version is
7075 // picked by the compiler.  These helpers have no implementations, as
7076 // we only need their signatures.
7077 //
7078 // Given IsNullLiteralHelper(x), the compiler will pick the first
7079 // version if x can be implicitly converted to Secret*, and pick the
7080 // second version otherwise.  Since Secret is a secret and incomplete
7081 // type, the only expression a user can write that has type Secret* is
7082 // a null pointer literal.  Therefore, we know that x is a null
7083 // pointer literal if and only if the first version is picked by the
7084 // compiler.
7085 char IsNullLiteralHelper(Secret* p);
7086 char (&IsNullLiteralHelper(...))[2];  // NOLINT
7087 
7088 // A compile-time bool constant that is true if and only if x is a
7089 // null pointer literal (i.e. NULL or any 0-valued compile-time
7090 // integral constant).
7091 #ifdef GTEST_ELLIPSIS_NEEDS_POD_
7092 // We lose support for NULL detection where the compiler doesn't like
7093 // passing non-POD classes through ellipsis (...).
7094 # define GTEST_IS_NULL_LITERAL_(x) false
7095 #else
7096 # define GTEST_IS_NULL_LITERAL_(x) \
7097     (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
7098 #endif  // GTEST_ELLIPSIS_NEEDS_POD_
7099 
7100 // Appends the user-supplied message to the Google-Test-generated message.
7101 GTEST_API_ std::string AppendUserMessage(
7102     const std::string& gtest_msg, const Message& user_msg);
7103 
7104 #if GTEST_HAS_EXCEPTIONS
7105 
7106 // This exception is thrown by (and only by) a failed Google Test
7107 // assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
7108 // are enabled).  We derive it from std::runtime_error, which is for
7109 // errors presumably detectable only at run time.  Since
7110 // std::runtime_error inherits from std::exception, many testing
7111 // frameworks know how to extract and print the message inside it.
7112 class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
7113  public:
7114   explicit GoogleTestFailureException(const TestPartResult& failure);
7115 };
7116 
7117 #endif  // GTEST_HAS_EXCEPTIONS
7118 
7119 // A helper class for creating scoped traces in user programs.
7120 class GTEST_API_ ScopedTrace {
7121  public:
7122   // The c'tor pushes the given source file location and message onto
7123   // a trace stack maintained by Google Test.
7124   ScopedTrace(const char* file, int line, const Message& message);
7125 
7126   // The d'tor pops the info pushed by the c'tor.
7127   //
7128   // Note that the d'tor is not virtual in order to be efficient.
7129   // Don't inherit from ScopedTrace!
7130   ~ScopedTrace();
7131 
7132  private:
7133   GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
7134 } GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its
7135                             // c'tor and d'tor.  Therefore it doesn't
7136                             // need to be used otherwise.
7137 
7138 // Constructs and returns the message for an equality assertion
7139 // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
7140 //
7141 // The first four parameters are the expressions used in the assertion
7142 // and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
7143 // where foo is 5 and bar is 6, we have:
7144 //
7145 //   expected_expression: "foo"
7146 //   actual_expression:   "bar"
7147 //   expected_value:      "5"
7148 //   actual_value:        "6"
7149 //
7150 // The ignoring_case parameter is true iff the assertion is a
7151 // *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will
7152 // be inserted into the message.
7153 GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
7154                                      const char* actual_expression,
7155                                      const std::string& expected_value,
7156                                      const std::string& actual_value,
7157                                      bool ignoring_case);
7158 
7159 // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
7160 GTEST_API_ std::string GetBoolAssertionFailureMessage(
7161     const AssertionResult& assertion_result,
7162     const char* expression_text,
7163     const char* actual_predicate_value,
7164     const char* expected_predicate_value);
7165 
7166 // This template class represents an IEEE floating-point number
7167 // (either single-precision or double-precision, depending on the
7168 // template parameters).
7169 //
7170 // The purpose of this class is to do more sophisticated number
7171 // comparison.  (Due to round-off error, etc, it's very unlikely that
7172 // two floating-points will be equal exactly.  Hence a naive
7173 // comparison by the == operation often doesn't work.)
7174 //
7175 // Format of IEEE floating-point:
7176 //
7177 //   The most-significant bit being the leftmost, an IEEE
7178 //   floating-point looks like
7179 //
7180 //     sign_bit exponent_bits fraction_bits
7181 //
7182 //   Here, sign_bit is a single bit that designates the sign of the
7183 //   number.
7184 //
7185 //   For float, there are 8 exponent bits and 23 fraction bits.
7186 //
7187 //   For double, there are 11 exponent bits and 52 fraction bits.
7188 //
7189 //   More details can be found at
7190 //   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
7191 //
7192 // Template parameter:
7193 //
7194 //   RawType: the raw floating-point type (either float or double)
7195 template <typename RawType>
7196 class FloatingPoint {
7197  public:
7198   // Defines the unsigned integer type that has the same size as the
7199   // floating point number.
7200   typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
7201 
7202   // Constants.
7203 
7204   // # of bits in a number.
7205   static const size_t kBitCount = 8*sizeof(RawType);
7206 
7207   // # of fraction bits in a number.
7208   static const size_t kFractionBitCount =
7209     std::numeric_limits<RawType>::digits - 1;
7210 
7211   // # of exponent bits in a number.
7212   static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
7213 
7214   // The mask for the sign bit.
7215   static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
7216 
7217   // The mask for the fraction bits.
7218   static const Bits kFractionBitMask =
7219     ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
7220 
7221   // The mask for the exponent bits.
7222   static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
7223 
7224   // How many ULP's (Units in the Last Place) we want to tolerate when
7225   // comparing two numbers.  The larger the value, the more error we
7226   // allow.  A 0 value means that two numbers must be exactly the same
7227   // to be considered equal.
7228   //
7229   // The maximum error of a single floating-point operation is 0.5
7230   // units in the last place.  On Intel CPU's, all floating-point
7231   // calculations are done with 80-bit precision, while double has 64
7232   // bits.  Therefore, 4 should be enough for ordinary use.
7233   //
7234   // See the following article for more details on ULP:
7235   // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
7236   static const size_t kMaxUlps = 4;
7237 
7238   // Constructs a FloatingPoint from a raw floating-point number.
7239   //
7240   // On an Intel CPU, passing a non-normalized NAN (Not a Number)
7241   // around may change its bits, although the new value is guaranteed
7242   // to be also a NAN.  Therefore, don't expect this constructor to
7243   // preserve the bits in x when x is a NAN.
7244   explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
7245 
7246   // Static methods
7247 
7248   // Reinterprets a bit pattern as a floating-point number.
7249   //
7250   // This function is needed to test the AlmostEquals() method.
7251   static RawType ReinterpretBits(const Bits bits) {
7252     FloatingPoint fp(0);
7253     fp.u_.bits_ = bits;
7254     return fp.u_.value_;
7255   }
7256 
7257   // Returns the floating-point number that represent positive infinity.
7258   static RawType Infinity() {
7259     return ReinterpretBits(kExponentBitMask);
7260   }
7261 
7262   // Returns the maximum representable finite floating-point number.
7263   static RawType Max();
7264 
7265   // Non-static methods
7266 
7267   // Returns the bits that represents this number.
7268   const Bits &bits() const { return u_.bits_; }
7269 
7270   // Returns the exponent bits of this number.
7271   Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
7272 
7273   // Returns the fraction bits of this number.
7274   Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
7275 
7276   // Returns the sign bit of this number.
7277   Bits sign_bit() const { return kSignBitMask & u_.bits_; }
7278 
7279   // Returns true iff this is NAN (not a number).
7280   bool is_nan() const {
7281     // It's a NAN if the exponent bits are all ones and the fraction
7282     // bits are not entirely zeros.
7283     return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
7284   }
7285 
7286   // Returns true iff this number is at most kMaxUlps ULP's away from
7287   // rhs.  In particular, this function:
7288   //
7289   //   - returns false if either number is (or both are) NAN.
7290   //   - treats really large numbers as almost equal to infinity.
7291   //   - thinks +0.0 and -0.0 are 0 DLP's apart.
7292   bool AlmostEquals(const FloatingPoint& rhs) const {
7293     // The IEEE standard says that any comparison operation involving
7294     // a NAN must return false.
7295     if (is_nan() || rhs.is_nan()) return false;
7296 
7297     return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
7298         <= kMaxUlps;
7299   }
7300 
7301  private:
7302   // The data type used to store the actual floating-point number.
7303   union FloatingPointUnion {
7304     RawType value_;  // The raw floating-point number.
7305     Bits bits_;      // The bits that represent the number.
7306   };
7307 
7308   // Converts an integer from the sign-and-magnitude representation to
7309   // the biased representation.  More precisely, let N be 2 to the
7310   // power of (kBitCount - 1), an integer x is represented by the
7311   // unsigned number x + N.
7312   //
7313   // For instance,
7314   //
7315   //   -N + 1 (the most negative number representable using
7316   //          sign-and-magnitude) is represented by 1;
7317   //   0      is represented by N; and
7318   //   N - 1  (the biggest number representable using
7319   //          sign-and-magnitude) is represented by 2N - 1.
7320   //
7321   // Read http://en.wikipedia.org/wiki/Signed_number_representations
7322   // for more details on signed number representations.
7323   static Bits SignAndMagnitudeToBiased(const Bits &sam) {
7324     if (kSignBitMask & sam) {
7325       // sam represents a negative number.
7326       return ~sam + 1;
7327     } else {
7328       // sam represents a positive number.
7329       return kSignBitMask | sam;
7330     }
7331   }
7332 
7333   // Given two numbers in the sign-and-magnitude representation,
7334   // returns the distance between them as an unsigned number.
7335   static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
7336                                                      const Bits &sam2) {
7337     const Bits biased1 = SignAndMagnitudeToBiased(sam1);
7338     const Bits biased2 = SignAndMagnitudeToBiased(sam2);
7339     return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
7340   }
7341 
7342   FloatingPointUnion u_;
7343 };
7344 
7345 // We cannot use std::numeric_limits<T>::max() as it clashes with the max()
7346 // macro defined by <windows.h>.
7347 template <>
7348 inline float FloatingPoint<float>::Max() { return FLT_MAX; }
7349 template <>
7350 inline double FloatingPoint<double>::Max() { return DBL_MAX; }
7351 
7352 // Typedefs the instances of the FloatingPoint template class that we
7353 // care to use.
7354 typedef FloatingPoint<float> Float;
7355 typedef FloatingPoint<double> Double;
7356 
7357 // In order to catch the mistake of putting tests that use different
7358 // test fixture classes in the same test case, we need to assign
7359 // unique IDs to fixture classes and compare them.  The TypeId type is
7360 // used to hold such IDs.  The user should treat TypeId as an opaque
7361 // type: the only operation allowed on TypeId values is to compare
7362 // them for equality using the == operator.
7363 typedef const void* TypeId;
7364 
7365 template <typename T>
7366 class TypeIdHelper {
7367  public:
7368   // dummy_ must not have a const type.  Otherwise an overly eager
7369   // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
7370   // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
7371   static bool dummy_;
7372 };
7373 
7374 template <typename T>
7375 bool TypeIdHelper<T>::dummy_ = false;
7376 
7377 // GetTypeId<T>() returns the ID of type T.  Different values will be
7378 // returned for different types.  Calling the function twice with the
7379 // same type argument is guaranteed to return the same ID.
7380 template <typename T>
7381 TypeId GetTypeId() {
7382   // The compiler is required to allocate a different
7383   // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
7384   // the template.  Therefore, the address of dummy_ is guaranteed to
7385   // be unique.
7386   return &(TypeIdHelper<T>::dummy_);
7387 }
7388 
7389 // Returns the type ID of ::testing::Test.  Always call this instead
7390 // of GetTypeId< ::testing::Test>() to get the type ID of
7391 // ::testing::Test, as the latter may give the wrong result due to a
7392 // suspected linker bug when compiling Google Test as a Mac OS X
7393 // framework.
7394 GTEST_API_ TypeId GetTestTypeId();
7395 
7396 // Defines the abstract factory interface that creates instances
7397 // of a Test object.
7398 class TestFactoryBase {
7399  public:
7400   virtual ~TestFactoryBase() {}
7401 
7402   // Creates a test instance to run. The instance is both created and destroyed
7403   // within TestInfoImpl::Run()
7404   virtual Test* CreateTest() = 0;
7405 
7406  protected:
7407   TestFactoryBase() {}
7408 
7409  private:
7410   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
7411 };
7412 
7413 // This class provides implementation of TeastFactoryBase interface.
7414 // It is used in TEST and TEST_F macros.
7415 template <class TestClass>
7416 class TestFactoryImpl : public TestFactoryBase {
7417  public:
7418   virtual Test* CreateTest() { return new TestClass; }
7419 };
7420 
7421 #if GTEST_OS_WINDOWS
7422 
7423 // Predicate-formatters for implementing the HRESULT checking macros
7424 // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
7425 // We pass a long instead of HRESULT to avoid causing an
7426 // include dependency for the HRESULT type.
7427 GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
7428                                             long hr);  // NOLINT
7429 GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
7430                                             long hr);  // NOLINT
7431 
7432 #endif  // GTEST_OS_WINDOWS
7433 
7434 // Types of SetUpTestCase() and TearDownTestCase() functions.
7435 typedef void (*SetUpTestCaseFunc)();
7436 typedef void (*TearDownTestCaseFunc)();
7437 
7438 // Creates a new TestInfo object and registers it with Google Test;
7439 // returns the created object.
7440 //
7441 // Arguments:
7442 //
7443 //   test_case_name:   name of the test case
7444 //   name:             name of the test
7445 //   type_param        the name of the test's type parameter, or NULL if
7446 //                     this is not a typed or a type-parameterized test.
7447 //   value_param       text representation of the test's value parameter,
7448 //                     or NULL if this is not a type-parameterized test.
7449 //   fixture_class_id: ID of the test fixture class
7450 //   set_up_tc:        pointer to the function that sets up the test case
7451 //   tear_down_tc:     pointer to the function that tears down the test case
7452 //   factory:          pointer to the factory that creates a test object.
7453 //                     The newly created TestInfo instance will assume
7454 //                     ownership of the factory object.
7455 GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
7456     const char* test_case_name,
7457     const char* name,
7458     const char* type_param,
7459     const char* value_param,
7460     TypeId fixture_class_id,
7461     SetUpTestCaseFunc set_up_tc,
7462     TearDownTestCaseFunc tear_down_tc,
7463     TestFactoryBase* factory);
7464 
7465 // If *pstr starts with the given prefix, modifies *pstr to be right
7466 // past the prefix and returns true; otherwise leaves *pstr unchanged
7467 // and returns false.  None of pstr, *pstr, and prefix can be NULL.
7468 GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
7469 
7470 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7471 
7472 // State of the definition of a type-parameterized test case.
7473 class GTEST_API_ TypedTestCasePState {
7474  public:
7475   TypedTestCasePState() : registered_(false) {}
7476 
7477   // Adds the given test name to defined_test_names_ and return true
7478   // if the test case hasn't been registered; otherwise aborts the
7479   // program.
7480   bool AddTestName(const char* file, int line, const char* case_name,
7481                    const char* test_name) {
7482     if (registered_) {
7483       fprintf(stderr, "%s Test %s must be defined before "
7484               "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
7485               FormatFileLocation(file, line).c_str(), test_name, case_name);
7486       fflush(stderr);
7487       posix::Abort();
7488     }
7489     defined_test_names_.insert(test_name);
7490     return true;
7491   }
7492 
7493   // Verifies that registered_tests match the test names in
7494   // defined_test_names_; returns registered_tests if successful, or
7495   // aborts the program otherwise.
7496   const char* VerifyRegisteredTestNames(
7497       const char* file, int line, const char* registered_tests);
7498 
7499  private:
7500   bool registered_;
7501   ::std::set<const char*> defined_test_names_;
7502 };
7503 
7504 // Skips to the first non-space char after the first comma in 'str';
7505 // returns NULL if no comma is found in 'str'.
7506 inline const char* SkipComma(const char* str) {
7507   const char* comma = strchr(str, ',');
7508   if (comma == NULL) {
7509     return NULL;
7510   }
7511   while (IsSpace(*(++comma))) {}
7512   return comma;
7513 }
7514 
7515 // Returns the prefix of 'str' before the first comma in it; returns
7516 // the entire string if it contains no comma.
7517 inline std::string GetPrefixUntilComma(const char* str) {
7518   const char* comma = strchr(str, ',');
7519   return comma == NULL ? str : std::string(str, comma);
7520 }
7521 
7522 // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
7523 // registers a list of type-parameterized tests with Google Test.  The
7524 // return value is insignificant - we just need to return something
7525 // such that we can call this function in a namespace scope.
7526 //
7527 // Implementation note: The GTEST_TEMPLATE_ macro declares a template
7528 // template parameter.  It's defined in gtest-type-util.h.
7529 template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
7530 class TypeParameterizedTest {
7531  public:
7532   // 'index' is the index of the test in the type list 'Types'
7533   // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
7534   // Types).  Valid values for 'index' are [0, N - 1] where N is the
7535   // length of Types.
7536   static bool Register(const char* prefix, const char* case_name,
7537                        const char* test_names, int index) {
7538     typedef typename Types::Head Type;
7539     typedef Fixture<Type> FixtureClass;
7540     typedef typename GTEST_BIND_(TestSel, Type) TestClass;
7541 
7542     // First, registers the first type-parameterized test in the type
7543     // list.
7544     MakeAndRegisterTestInfo(
7545         (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
7546          + StreamableToString(index)).c_str(),
7547         GetPrefixUntilComma(test_names).c_str(),
7548         GetTypeName<Type>().c_str(),
7549         NULL,  // No value parameter.
7550         GetTypeId<FixtureClass>(),
7551         TestClass::SetUpTestCase,
7552         TestClass::TearDownTestCase,
7553         new TestFactoryImpl<TestClass>);
7554 
7555     // Next, recurses (at compile time) with the tail of the type list.
7556     return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
7557         ::Register(prefix, case_name, test_names, index + 1);
7558   }
7559 };
7560 
7561 // The base case for the compile time recursion.
7562 template <GTEST_TEMPLATE_ Fixture, class TestSel>
7563 class TypeParameterizedTest<Fixture, TestSel, Types0> {
7564  public:
7565   static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7566                        const char* /*test_names*/, int /*index*/) {
7567     return true;
7568   }
7569 };
7570 
7571 // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
7572 // registers *all combinations* of 'Tests' and 'Types' with Google
7573 // Test.  The return value is insignificant - we just need to return
7574 // something such that we can call this function in a namespace scope.
7575 template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
7576 class TypeParameterizedTestCase {
7577  public:
7578   static bool Register(const char* prefix, const char* case_name,
7579                        const char* test_names) {
7580     typedef typename Tests::Head Head;
7581 
7582     // First, register the first test in 'Test' for each type in 'Types'.
7583     TypeParameterizedTest<Fixture, Head, Types>::Register(
7584         prefix, case_name, test_names, 0);
7585 
7586     // Next, recurses (at compile time) with the tail of the test list.
7587     return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
7588         ::Register(prefix, case_name, SkipComma(test_names));
7589   }
7590 };
7591 
7592 // The base case for the compile time recursion.
7593 template <GTEST_TEMPLATE_ Fixture, typename Types>
7594 class TypeParameterizedTestCase<Fixture, Templates0, Types> {
7595  public:
7596   static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7597                        const char* /*test_names*/) {
7598     return true;
7599   }
7600 };
7601 
7602 #endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7603 
7604 // Returns the current OS stack trace as an std::string.
7605 //
7606 // The maximum number of stack frames to be included is specified by
7607 // the gtest_stack_trace_depth flag.  The skip_count parameter
7608 // specifies the number of top frames to be skipped, which doesn't
7609 // count against the number of frames to be included.
7610 //
7611 // For example, if Foo() calls Bar(), which in turn calls
7612 // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
7613 // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
7614 GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
7615     UnitTest* unit_test, int skip_count);
7616 
7617 // Helpers for suppressing warnings on unreachable code or constant
7618 // condition.
7619 
7620 // Always returns true.
7621 GTEST_API_ bool AlwaysTrue();
7622 
7623 // Always returns false.
7624 inline bool AlwaysFalse() { return !AlwaysTrue(); }
7625 
7626 // Helper for suppressing false warning from Clang on a const char*
7627 // variable declared in a conditional expression always being NULL in
7628 // the else branch.
7629 struct GTEST_API_ ConstCharPtr {
7630   ConstCharPtr(const char* str) : value(str) {}
7631   operator bool() const { return true; }
7632   const char* value;
7633 };
7634 
7635 // A simple Linear Congruential Generator for generating random
7636 // numbers with a uniform distribution.  Unlike rand() and srand(), it
7637 // doesn't use global state (and therefore can't interfere with user
7638 // code).  Unlike rand_r(), it's portable.  An LCG isn't very random,
7639 // but it's good enough for our purposes.
7640 class GTEST_API_ Random {
7641  public:
7642   static const UInt32 kMaxRange = 1u << 31;
7643 
7644   explicit Random(UInt32 seed) : state_(seed) {}
7645 
7646   void Reseed(UInt32 seed) { state_ = seed; }
7647 
7648   // Generates a random number from [0, range).  Crashes if 'range' is
7649   // 0 or greater than kMaxRange.
7650   UInt32 Generate(UInt32 range);
7651 
7652  private:
7653   UInt32 state_;
7654   GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
7655 };
7656 
7657 // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
7658 // compiler error iff T1 and T2 are different types.
7659 template <typename T1, typename T2>
7660 struct CompileAssertTypesEqual;
7661 
7662 template <typename T>
7663 struct CompileAssertTypesEqual<T, T> {
7664 };
7665 
7666 // Removes the reference from a type if it is a reference type,
7667 // otherwise leaves it unchanged.  This is the same as
7668 // tr1::remove_reference, which is not widely available yet.
7669 template <typename T>
7670 struct RemoveReference { typedef T type; };  // NOLINT
7671 template <typename T>
7672 struct RemoveReference<T&> { typedef T type; };  // NOLINT
7673 
7674 // A handy wrapper around RemoveReference that works when the argument
7675 // T depends on template parameters.
7676 #define GTEST_REMOVE_REFERENCE_(T) \
7677     typename ::testing::internal::RemoveReference<T>::type
7678 
7679 // Removes const from a type if it is a const type, otherwise leaves
7680 // it unchanged.  This is the same as tr1::remove_const, which is not
7681 // widely available yet.
7682 template <typename T>
7683 struct RemoveConst { typedef T type; };  // NOLINT
7684 template <typename T>
7685 struct RemoveConst<const T> { typedef T type; };  // NOLINT
7686 
7687 // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
7688 // definition to fail to remove the const in 'const int[3]' and 'const
7689 // char[3][4]'.  The following specialization works around the bug.
7690 template <typename T, size_t N>
7691 struct RemoveConst<const T[N]> {
7692   typedef typename RemoveConst<T>::type type[N];
7693 };
7694 
7695 #if defined(_MSC_VER) && _MSC_VER < 1400
7696 // This is the only specialization that allows VC++ 7.1 to remove const in
7697 // 'const int[3] and 'const int[3][4]'.  However, it causes trouble with GCC
7698 // and thus needs to be conditionally compiled.
7699 template <typename T, size_t N>
7700 struct RemoveConst<T[N]> {
7701   typedef typename RemoveConst<T>::type type[N];
7702 };
7703 #endif
7704 
7705 // A handy wrapper around RemoveConst that works when the argument
7706 // T depends on template parameters.
7707 #define GTEST_REMOVE_CONST_(T) \
7708     typename ::testing::internal::RemoveConst<T>::type
7709 
7710 // Turns const U&, U&, const U, and U all into U.
7711 #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
7712     GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
7713 
7714 // Adds reference to a type if it is not a reference type,
7715 // otherwise leaves it unchanged.  This is the same as
7716 // tr1::add_reference, which is not widely available yet.
7717 template <typename T>
7718 struct AddReference { typedef T& type; };  // NOLINT
7719 template <typename T>
7720 struct AddReference<T&> { typedef T& type; };  // NOLINT
7721 
7722 // A handy wrapper around AddReference that works when the argument T
7723 // depends on template parameters.
7724 #define GTEST_ADD_REFERENCE_(T) \
7725     typename ::testing::internal::AddReference<T>::type
7726 
7727 // Adds a reference to const on top of T as necessary.  For example,
7728 // it transforms
7729 //
7730 //   char         ==> const char&
7731 //   const char   ==> const char&
7732 //   char&        ==> const char&
7733 //   const char&  ==> const char&
7734 //
7735 // The argument T must depend on some template parameters.
7736 #define GTEST_REFERENCE_TO_CONST_(T) \
7737     GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
7738 
7739 // ImplicitlyConvertible<From, To>::value is a compile-time bool
7740 // constant that's true iff type From can be implicitly converted to
7741 // type To.
7742 template <typename From, typename To>
7743 class ImplicitlyConvertible {
7744  private:
7745   // We need the following helper functions only for their types.
7746   // They have no implementations.
7747 
7748   // MakeFrom() is an expression whose type is From.  We cannot simply
7749   // use From(), as the type From may not have a public default
7750   // constructor.
7751   static From MakeFrom();
7752 
7753   // These two functions are overloaded.  Given an expression
7754   // Helper(x), the compiler will pick the first version if x can be
7755   // implicitly converted to type To; otherwise it will pick the
7756   // second version.
7757   //
7758   // The first version returns a value of size 1, and the second
7759   // version returns a value of size 2.  Therefore, by checking the
7760   // size of Helper(x), which can be done at compile time, we can tell
7761   // which version of Helper() is used, and hence whether x can be
7762   // implicitly converted to type To.
7763   static char Helper(To);
7764   static char (&Helper(...))[2];  // NOLINT
7765 
7766   // We have to put the 'public' section after the 'private' section,
7767   // or MSVC refuses to compile the code.
7768  public:
7769   // MSVC warns about implicitly converting from double to int for
7770   // possible loss of data, so we need to temporarily disable the
7771   // warning.
7772 #ifdef _MSC_VER
7773 # pragma warning(push)          // Saves the current warning state.
7774 # pragma warning(disable:4244)  // Temporarily disables warning 4244.
7775 
7776   static const bool value =
7777       sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
7778 # pragma warning(pop)           // Restores the warning state.
7779 #elif defined(__BORLANDC__)
7780   // C++Builder cannot use member overload resolution during template
7781   // instantiation.  The simplest workaround is to use its C++0x type traits
7782   // functions (C++Builder 2009 and above only).
7783   static const bool value = __is_convertible(From, To);
7784 #else
7785   static const bool value =
7786       sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
7787 #endif  // _MSV_VER
7788 };
7789 template <typename From, typename To>
7790 const bool ImplicitlyConvertible<From, To>::value;
7791 
7792 // IsAProtocolMessage<T>::value is a compile-time bool constant that's
7793 // true iff T is type ProtocolMessage, proto2::Message, or a subclass
7794 // of those.
7795 template <typename T>
7796 struct IsAProtocolMessage
7797     : public bool_constant<
7798   ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
7799   ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
7800 };
7801 
7802 // When the compiler sees expression IsContainerTest<C>(0), if C is an
7803 // STL-style container class, the first overload of IsContainerTest
7804 // will be viable (since both C::iterator* and C::const_iterator* are
7805 // valid types and NULL can be implicitly converted to them).  It will
7806 // be picked over the second overload as 'int' is a perfect match for
7807 // the type of argument 0.  If C::iterator or C::const_iterator is not
7808 // a valid type, the first overload is not viable, and the second
7809 // overload will be picked.  Therefore, we can determine whether C is
7810 // a container class by checking the type of IsContainerTest<C>(0).
7811 // The value of the expression is insignificant.
7812 //
7813 // Note that we look for both C::iterator and C::const_iterator.  The
7814 // reason is that C++ injects the name of a class as a member of the
7815 // class itself (e.g. you can refer to class iterator as either
7816 // 'iterator' or 'iterator::iterator').  If we look for C::iterator
7817 // only, for example, we would mistakenly think that a class named
7818 // iterator is an STL container.
7819 //
7820 // Also note that the simpler approach of overloading
7821 // IsContainerTest(typename C::const_iterator*) and
7822 // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
7823 typedef int IsContainer;
7824 template <class C>
7825 IsContainer IsContainerTest(int /* dummy */,
7826                             typename C::iterator* /* it */ = NULL,
7827                             typename C::const_iterator* /* const_it */ = NULL) {
7828   return 0;
7829 }
7830 
7831 typedef char IsNotContainer;
7832 template <class C>
7833 IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
7834 
7835 // EnableIf<condition>::type is void when 'Cond' is true, and
7836 // undefined when 'Cond' is false.  To use SFINAE to make a function
7837 // overload only apply when a particular expression is true, add
7838 // "typename EnableIf<expression>::type* = 0" as the last parameter.
7839 template<bool> struct EnableIf;
7840 template<> struct EnableIf<true> { typedef void type; };  // NOLINT
7841 
7842 // Utilities for native arrays.
7843 
7844 // ArrayEq() compares two k-dimensional native arrays using the
7845 // elements' operator==, where k can be any integer >= 0.  When k is
7846 // 0, ArrayEq() degenerates into comparing a single pair of values.
7847 
7848 template <typename T, typename U>
7849 bool ArrayEq(const T* lhs, size_t size, const U* rhs);
7850 
7851 // This generic version is used when k is 0.
7852 template <typename T, typename U>
7853 inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
7854 
7855 // This overload is used when k >= 1.
7856 template <typename T, typename U, size_t N>
7857 inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
7858   return internal::ArrayEq(lhs, N, rhs);
7859 }
7860 
7861 // This helper reduces code bloat.  If we instead put its logic inside
7862 // the previous ArrayEq() function, arrays with different sizes would
7863 // lead to different copies of the template code.
7864 template <typename T, typename U>
7865 bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
7866   for (size_t i = 0; i != size; i++) {
7867     if (!internal::ArrayEq(lhs[i], rhs[i]))
7868       return false;
7869   }
7870   return true;
7871 }
7872 
7873 // Finds the first element in the iterator range [begin, end) that
7874 // equals elem.  Element may be a native array type itself.
7875 template <typename Iter, typename Element>
7876 Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
7877   for (Iter it = begin; it != end; ++it) {
7878     if (internal::ArrayEq(*it, elem))
7879       return it;
7880   }
7881   return end;
7882 }
7883 
7884 // CopyArray() copies a k-dimensional native array using the elements'
7885 // operator=, where k can be any integer >= 0.  When k is 0,
7886 // CopyArray() degenerates into copying a single value.
7887 
7888 template <typename T, typename U>
7889 void CopyArray(const T* from, size_t size, U* to);
7890 
7891 // This generic version is used when k is 0.
7892 template <typename T, typename U>
7893 inline void CopyArray(const T& from, U* to) { *to = from; }
7894 
7895 // This overload is used when k >= 1.
7896 template <typename T, typename U, size_t N>
7897 inline void CopyArray(const T(&from)[N], U(*to)[N]) {
7898   internal::CopyArray(from, N, *to);
7899 }
7900 
7901 // This helper reduces code bloat.  If we instead put its logic inside
7902 // the previous CopyArray() function, arrays with different sizes
7903 // would lead to different copies of the template code.
7904 template <typename T, typename U>
7905 void CopyArray(const T* from, size_t size, U* to) {
7906   for (size_t i = 0; i != size; i++) {
7907     internal::CopyArray(from[i], to + i);
7908   }
7909 }
7910 
7911 // The relation between an NativeArray object (see below) and the
7912 // native array it represents.
7913 enum RelationToSource {
7914   kReference,  // The NativeArray references the native array.
7915   kCopy        // The NativeArray makes a copy of the native array and
7916                // owns the copy.
7917 };
7918 
7919 // Adapts a native array to a read-only STL-style container.  Instead
7920 // of the complete STL container concept, this adaptor only implements
7921 // members useful for Google Mock's container matchers.  New members
7922 // should be added as needed.  To simplify the implementation, we only
7923 // support Element being a raw type (i.e. having no top-level const or
7924 // reference modifier).  It's the client's responsibility to satisfy
7925 // this requirement.  Element can be an array type itself (hence
7926 // multi-dimensional arrays are supported).
7927 template <typename Element>
7928 class NativeArray {
7929  public:
7930   // STL-style container typedefs.
7931   typedef Element value_type;
7932   typedef Element* iterator;
7933   typedef const Element* const_iterator;
7934 
7935   // Constructs from a native array.
7936   NativeArray(const Element* array, size_t count, RelationToSource relation) {
7937     Init(array, count, relation);
7938   }
7939 
7940   // Copy constructor.
7941   NativeArray(const NativeArray& rhs) {
7942     Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
7943   }
7944 
7945   ~NativeArray() {
7946     // Ensures that the user doesn't instantiate NativeArray with a
7947     // const or reference type.
7948     static_cast<void>(StaticAssertTypeEqHelper<Element,
7949         GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
7950     if (relation_to_source_ == kCopy)
7951       delete[] array_;
7952   }
7953 
7954   // STL-style container methods.
7955   size_t size() const { return size_; }
7956   const_iterator begin() const { return array_; }
7957   const_iterator end() const { return array_ + size_; }
7958   bool operator==(const NativeArray& rhs) const {
7959     return size() == rhs.size() &&
7960         ArrayEq(begin(), size(), rhs.begin());
7961   }
7962 
7963  private:
7964   // Initializes this object; makes a copy of the input array if
7965   // 'relation' is kCopy.
7966   void Init(const Element* array, size_t a_size, RelationToSource relation) {
7967     if (relation == kReference) {
7968       array_ = array;
7969     } else {
7970       Element* const copy = new Element[a_size];
7971       CopyArray(array, a_size, copy);
7972       array_ = copy;
7973     }
7974     size_ = a_size;
7975     relation_to_source_ = relation;
7976   }
7977 
7978   const Element* array_;
7979   size_t size_;
7980   RelationToSource relation_to_source_;
7981 
7982   GTEST_DISALLOW_ASSIGN_(NativeArray);
7983 };
7984 
7985 }  // namespace internal
7986 }  // namespace testing
7987 
7988 #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
7989   ::testing::internal::AssertHelper(result_type, file, line, message) \
7990     = ::testing::Message()
7991 
7992 #define GTEST_MESSAGE_(message, result_type) \
7993   GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
7994 
7995 #define GTEST_FATAL_FAILURE_(message) \
7996   return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
7997 
7998 #define GTEST_NONFATAL_FAILURE_(message) \
7999   GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
8000 
8001 #define GTEST_SUCCESS_(message) \
8002   GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
8003 
8004 // Suppresses MSVC warnings 4072 (unreachable code) for the code following
8005 // statement if it returns or throws (or doesn't return or throw in some
8006 // situations).
8007 #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
8008   if (::testing::internal::AlwaysTrue()) { statement; }
8009 
8010 #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
8011   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8012   if (::testing::internal::ConstCharPtr gtest_msg = "") { \
8013     bool gtest_caught_expected = false; \
8014     try { \
8015       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8016     } \
8017     catch (expected_exception const&) { \
8018       gtest_caught_expected = true; \
8019     } \
8020     catch (...) { \
8021       gtest_msg.value = \
8022           "Expected: " #statement " throws an exception of type " \
8023           #expected_exception ".\n  Actual: it throws a different type."; \
8024       goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
8025     } \
8026     if (!gtest_caught_expected) { \
8027       gtest_msg.value = \
8028           "Expected: " #statement " throws an exception of type " \
8029           #expected_exception ".\n  Actual: it throws nothing."; \
8030       goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
8031     } \
8032   } else \
8033     GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
8034       fail(gtest_msg.value)
8035 
8036 #define GTEST_TEST_NO_THROW_(statement, fail) \
8037   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8038   if (::testing::internal::AlwaysTrue()) { \
8039     try { \
8040       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8041     } \
8042     catch (...) { \
8043       goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
8044     } \
8045   } else \
8046     GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
8047       fail("Expected: " #statement " doesn't throw an exception.\n" \
8048            "  Actual: it throws.")
8049 
8050 #define GTEST_TEST_ANY_THROW_(statement, fail) \
8051   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8052   if (::testing::internal::AlwaysTrue()) { \
8053     bool gtest_caught_any = false; \
8054     try { \
8055       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8056     } \
8057     catch (...) { \
8058       gtest_caught_any = true; \
8059     } \
8060     if (!gtest_caught_any) { \
8061       goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
8062     } \
8063   } else \
8064     GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
8065       fail("Expected: " #statement " throws an exception.\n" \
8066            "  Actual: it doesn't.")
8067 
8068 
8069 // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
8070 // either a boolean expression or an AssertionResult. text is a textual
8071 // represenation of expression as it was passed into the EXPECT_TRUE.
8072 #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
8073   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8074   if (const ::testing::AssertionResult gtest_ar_ = \
8075       ::testing::AssertionResult(expression)) \
8076     ; \
8077   else \
8078     fail(::testing::internal::GetBoolAssertionFailureMessage(\
8079         gtest_ar_, text, #actual, #expected).c_str())
8080 
8081 #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
8082   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8083   if (::testing::internal::AlwaysTrue()) { \
8084     ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
8085     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8086     if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
8087       goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
8088     } \
8089   } else \
8090     GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
8091       fail("Expected: " #statement " doesn't generate new fatal " \
8092            "failures in the current thread.\n" \
8093            "  Actual: it does.")
8094 
8095 // Expands to the name of the class that implements the given test.
8096 #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
8097   test_case_name##_##test_name##_Test
8098 
8099 // Helper macro for defining tests.
8100 #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
8101 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
8102  public:\
8103   GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
8104  private:\
8105   virtual void TestBody();\
8106   static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
8107   GTEST_DISALLOW_COPY_AND_ASSIGN_(\
8108       GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
8109 };\
8110 \
8111 ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
8112   ::test_info_ =\
8113     ::testing::internal::MakeAndRegisterTestInfo(\
8114         #test_case_name, #test_name, NULL, NULL, \
8115         (parent_id), \
8116         parent_class::SetUpTestCase, \
8117         parent_class::TearDownTestCase, \
8118         new ::testing::internal::TestFactoryImpl<\
8119             GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
8120 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
8121 
8122 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
8123 // Copyright 2005, Google Inc.
8124 // All rights reserved.
8125 //
8126 // Redistribution and use in source and binary forms, with or without
8127 // modification, are permitted provided that the following conditions are
8128 // met:
8129 //
8130 //     * Redistributions of source code must retain the above copyright
8131 // notice, this list of conditions and the following disclaimer.
8132 //     * Redistributions in binary form must reproduce the above
8133 // copyright notice, this list of conditions and the following disclaimer
8134 // in the documentation and/or other materials provided with the
8135 // distribution.
8136 //     * Neither the name of Google Inc. nor the names of its
8137 // contributors may be used to endorse or promote products derived from
8138 // this software without specific prior written permission.
8139 //
8140 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8141 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8142 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8143 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8144 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8145 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8146 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8147 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8148 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8149 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8150 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8151 //
8152 // Author: wan@google.com (Zhanyong Wan)
8153 //
8154 // The Google C++ Testing Framework (Google Test)
8155 //
8156 // This header file defines the public API for death tests.  It is
8157 // #included by gtest.h so a user doesn't need to include this
8158 // directly.
8159 
8160 #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8161 #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8162 
8163 // Copyright 2005, Google Inc.
8164 // All rights reserved.
8165 //
8166 // Redistribution and use in source and binary forms, with or without
8167 // modification, are permitted provided that the following conditions are
8168 // met:
8169 //
8170 //     * Redistributions of source code must retain the above copyright
8171 // notice, this list of conditions and the following disclaimer.
8172 //     * Redistributions in binary form must reproduce the above
8173 // copyright notice, this list of conditions and the following disclaimer
8174 // in the documentation and/or other materials provided with the
8175 // distribution.
8176 //     * Neither the name of Google Inc. nor the names of its
8177 // contributors may be used to endorse or promote products derived from
8178 // this software without specific prior written permission.
8179 //
8180 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8181 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8182 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8183 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8184 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8185 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8186 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8187 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8188 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8189 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8190 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8191 //
8192 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
8193 //
8194 // The Google C++ Testing Framework (Google Test)
8195 //
8196 // This header file defines internal utilities needed for implementing
8197 // death tests.  They are subject to change without notice.
8198 
8199 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8200 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8201 
8202 
8203 #include <stdio.h>
8204 
8205 namespace testing {
8206 namespace internal {
8207 
8208 GTEST_DECLARE_string_(internal_run_death_test);
8209 
8210 // Names of the flags (needed for parsing Google Test flags).
8211 const char kDeathTestStyleFlag[] = "death_test_style";
8212 const char kDeathTestUseFork[] = "death_test_use_fork";
8213 const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
8214 
8215 #if GTEST_HAS_DEATH_TEST
8216 
8217 // DeathTest is a class that hides much of the complexity of the
8218 // GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method
8219 // returns a concrete class that depends on the prevailing death test
8220 // style, as defined by the --gtest_death_test_style and/or
8221 // --gtest_internal_run_death_test flags.
8222 
8223 // In describing the results of death tests, these terms are used with
8224 // the corresponding definitions:
8225 //
8226 // exit status:  The integer exit information in the format specified
8227 //               by wait(2)
8228 // exit code:    The integer code passed to exit(3), _exit(2), or
8229 //               returned from main()
8230 class GTEST_API_ DeathTest {
8231  public:
8232   // Create returns false if there was an error determining the
8233   // appropriate action to take for the current death test; for example,
8234   // if the gtest_death_test_style flag is set to an invalid value.
8235   // The LastMessage method will return a more detailed message in that
8236   // case.  Otherwise, the DeathTest pointer pointed to by the "test"
8237   // argument is set.  If the death test should be skipped, the pointer
8238   // is set to NULL; otherwise, it is set to the address of a new concrete
8239   // DeathTest object that controls the execution of the current test.
8240   static bool Create(const char* statement, const RE* regex,
8241                      const char* file, int line, DeathTest** test);
8242   DeathTest();
8243   virtual ~DeathTest() { }
8244 
8245   // A helper class that aborts a death test when it's deleted.
8246   class ReturnSentinel {
8247    public:
8248     explicit ReturnSentinel(DeathTest* test) : test_(test) { }
8249     ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
8250    private:
8251     DeathTest* const test_;
8252     GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
8253   } GTEST_ATTRIBUTE_UNUSED_;
8254 
8255   // An enumeration of possible roles that may be taken when a death
8256   // test is encountered.  EXECUTE means that the death test logic should
8257   // be executed immediately.  OVERSEE means that the program should prepare
8258   // the appropriate environment for a child process to execute the death
8259   // test, then wait for it to complete.
8260   enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
8261 
8262   // An enumeration of the three reasons that a test might be aborted.
8263   enum AbortReason {
8264     TEST_ENCOUNTERED_RETURN_STATEMENT,
8265     TEST_THREW_EXCEPTION,
8266     TEST_DID_NOT_DIE
8267   };
8268 
8269   // Assumes one of the above roles.
8270   virtual TestRole AssumeRole() = 0;
8271 
8272   // Waits for the death test to finish and returns its status.
8273   virtual int Wait() = 0;
8274 
8275   // Returns true if the death test passed; that is, the test process
8276   // exited during the test, its exit status matches a user-supplied
8277   // predicate, and its stderr output matches a user-supplied regular
8278   // expression.
8279   // The user-supplied predicate may be a macro expression rather
8280   // than a function pointer or functor, or else Wait and Passed could
8281   // be combined.
8282   virtual bool Passed(bool exit_status_ok) = 0;
8283 
8284   // Signals that the death test did not die as expected.
8285   virtual void Abort(AbortReason reason) = 0;
8286 
8287   // Returns a human-readable outcome message regarding the outcome of
8288   // the last death test.
8289   static const char* LastMessage();
8290 
8291   static void set_last_death_test_message(const std::string& message);
8292 
8293  private:
8294   // A string containing a description of the outcome of the last death test.
8295   static std::string last_death_test_message_;
8296 
8297   GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
8298 };
8299 
8300 // Factory interface for death tests.  May be mocked out for testing.
8301 class DeathTestFactory {
8302  public:
8303   virtual ~DeathTestFactory() { }
8304   virtual bool Create(const char* statement, const RE* regex,
8305                       const char* file, int line, DeathTest** test) = 0;
8306 };
8307 
8308 // A concrete DeathTestFactory implementation for normal use.
8309 class DefaultDeathTestFactory : public DeathTestFactory {
8310  public:
8311   virtual bool Create(const char* statement, const RE* regex,
8312                       const char* file, int line, DeathTest** test);
8313 };
8314 
8315 // Returns true if exit_status describes a process that was terminated
8316 // by a signal, or exited normally with a nonzero exit code.
8317 GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
8318 
8319 // Traps C++ exceptions escaping statement and reports them as test
8320 // failures. Note that trapping SEH exceptions is not implemented here.
8321 # if GTEST_HAS_EXCEPTIONS
8322 #  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
8323   try { \
8324     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8325   } catch (const ::std::exception& gtest_exception) { \
8326     fprintf(\
8327         stderr, \
8328         "\n%s: Caught std::exception-derived exception escaping the " \
8329         "death test statement. Exception message: %s\n", \
8330         ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
8331         gtest_exception.what()); \
8332     fflush(stderr); \
8333     death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
8334   } catch (...) { \
8335     death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
8336   }
8337 
8338 # else
8339 #  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
8340   GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
8341 
8342 # endif
8343 
8344 // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
8345 // ASSERT_EXIT*, and EXPECT_EXIT*.
8346 # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
8347   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8348   if (::testing::internal::AlwaysTrue()) { \
8349     const ::testing::internal::RE& gtest_regex = (regex); \
8350     ::testing::internal::DeathTest* gtest_dt; \
8351     if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
8352         __FILE__, __LINE__, &gtest_dt)) { \
8353       goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
8354     } \
8355     if (gtest_dt != NULL) { \
8356       ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
8357           gtest_dt_ptr(gtest_dt); \
8358       switch (gtest_dt->AssumeRole()) { \
8359         case ::testing::internal::DeathTest::OVERSEE_TEST: \
8360           if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
8361             goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
8362           } \
8363           break; \
8364         case ::testing::internal::DeathTest::EXECUTE_TEST: { \
8365           ::testing::internal::DeathTest::ReturnSentinel \
8366               gtest_sentinel(gtest_dt); \
8367           GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
8368           gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
8369           break; \
8370         } \
8371         default: \
8372           break; \
8373       } \
8374     } \
8375   } else \
8376     GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
8377       fail(::testing::internal::DeathTest::LastMessage())
8378 // The symbol "fail" here expands to something into which a message
8379 // can be streamed.
8380 
8381 // This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
8382 // NDEBUG mode. In this case we need the statements to be executed, the regex is
8383 // ignored, and the macro must accept a streamed message even though the message
8384 // is never printed.
8385 # define GTEST_EXECUTE_STATEMENT_(statement, regex) \
8386   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8387   if (::testing::internal::AlwaysTrue()) { \
8388      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8389   } else \
8390     ::testing::Message()
8391 
8392 // A class representing the parsed contents of the
8393 // --gtest_internal_run_death_test flag, as it existed when
8394 // RUN_ALL_TESTS was called.
8395 class InternalRunDeathTestFlag {
8396  public:
8397   InternalRunDeathTestFlag(const std::string& a_file,
8398                            int a_line,
8399                            int an_index,
8400                            int a_write_fd)
8401       : file_(a_file), line_(a_line), index_(an_index),
8402         write_fd_(a_write_fd) {}
8403 
8404   ~InternalRunDeathTestFlag() {
8405     if (write_fd_ >= 0)
8406       posix::Close(write_fd_);
8407   }
8408 
8409   const std::string& file() const { return file_; }
8410   int line() const { return line_; }
8411   int index() const { return index_; }
8412   int write_fd() const { return write_fd_; }
8413 
8414  private:
8415   std::string file_;
8416   int line_;
8417   int index_;
8418   int write_fd_;
8419 
8420   GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
8421 };
8422 
8423 // Returns a newly created InternalRunDeathTestFlag object with fields
8424 // initialized from the GTEST_FLAG(internal_run_death_test) flag if
8425 // the flag is specified; otherwise returns NULL.
8426 InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
8427 
8428 #else  // GTEST_HAS_DEATH_TEST
8429 
8430 // This macro is used for implementing macros such as
8431 // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
8432 // death tests are not supported. Those macros must compile on such systems
8433 // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
8434 // systems that support death tests. This allows one to write such a macro
8435 // on a system that does not support death tests and be sure that it will
8436 // compile on a death-test supporting system.
8437 //
8438 // Parameters:
8439 //   statement -  A statement that a macro such as EXPECT_DEATH would test
8440 //                for program termination. This macro has to make sure this
8441 //                statement is compiled but not executed, to ensure that
8442 //                EXPECT_DEATH_IF_SUPPORTED compiles with a certain
8443 //                parameter iff EXPECT_DEATH compiles with it.
8444 //   regex     -  A regex that a macro such as EXPECT_DEATH would use to test
8445 //                the output of statement.  This parameter has to be
8446 //                compiled but not evaluated by this macro, to ensure that
8447 //                this macro only accepts expressions that a macro such as
8448 //                EXPECT_DEATH would accept.
8449 //   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
8450 //                and a return statement for ASSERT_DEATH_IF_SUPPORTED.
8451 //                This ensures that ASSERT_DEATH_IF_SUPPORTED will not
8452 //                compile inside functions where ASSERT_DEATH doesn't
8453 //                compile.
8454 //
8455 //  The branch that has an always false condition is used to ensure that
8456 //  statement and regex are compiled (and thus syntactically correct) but
8457 //  never executed. The unreachable code macro protects the terminator
8458 //  statement from generating an 'unreachable code' warning in case
8459 //  statement unconditionally returns or throws. The Message constructor at
8460 //  the end allows the syntax of streaming additional messages into the
8461 //  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
8462 # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
8463     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8464     if (::testing::internal::AlwaysTrue()) { \
8465       GTEST_LOG_(WARNING) \
8466           << "Death tests are not supported on this platform.\n" \
8467           << "Statement '" #statement "' cannot be verified."; \
8468     } else if (::testing::internal::AlwaysFalse()) { \
8469       ::testing::internal::RE::PartialMatch(".*", (regex)); \
8470       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8471       terminator; \
8472     } else \
8473       ::testing::Message()
8474 
8475 #endif  // GTEST_HAS_DEATH_TEST
8476 
8477 }  // namespace internal
8478 }  // namespace testing
8479 
8480 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8481 
8482 namespace testing {
8483 
8484 // This flag controls the style of death tests.  Valid values are "threadsafe",
8485 // meaning that the death test child process will re-execute the test binary
8486 // from the start, running only a single death test, or "fast",
8487 // meaning that the child process will execute the test logic immediately
8488 // after forking.
8489 GTEST_DECLARE_string_(death_test_style);
8490 
8491 #if GTEST_HAS_DEATH_TEST
8492 
8493 namespace internal {
8494 
8495 // Returns a Boolean value indicating whether the caller is currently
8496 // executing in the context of the death test child process.  Tools such as
8497 // Valgrind heap checkers may need this to modify their behavior in death
8498 // tests.  IMPORTANT: This is an internal utility.  Using it may break the
8499 // implementation of death tests.  User code MUST NOT use it.
8500 GTEST_API_ bool InDeathTestChild();
8501 
8502 }  // namespace internal
8503 
8504 // The following macros are useful for writing death tests.
8505 
8506 // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
8507 // executed:
8508 //
8509 //   1. It generates a warning if there is more than one active
8510 //   thread.  This is because it's safe to fork() or clone() only
8511 //   when there is a single thread.
8512 //
8513 //   2. The parent process clone()s a sub-process and runs the death
8514 //   test in it; the sub-process exits with code 0 at the end of the
8515 //   death test, if it hasn't exited already.
8516 //
8517 //   3. The parent process waits for the sub-process to terminate.
8518 //
8519 //   4. The parent process checks the exit code and error message of
8520 //   the sub-process.
8521 //
8522 // Examples:
8523 //
8524 //   ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
8525 //   for (int i = 0; i < 5; i++) {
8526 //     EXPECT_DEATH(server.ProcessRequest(i),
8527 //                  "Invalid request .* in ProcessRequest()")
8528 //                  << "Failed to die on request " << i;
8529 //   }
8530 //
8531 //   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
8532 //
8533 //   bool KilledBySIGHUP(int exit_code) {
8534 //     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
8535 //   }
8536 //
8537 //   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
8538 //
8539 // On the regular expressions used in death tests:
8540 //
8541 //   On POSIX-compliant systems (*nix), we use the <regex.h> library,
8542 //   which uses the POSIX extended regex syntax.
8543 //
8544 //   On other platforms (e.g. Windows), we only support a simple regex
8545 //   syntax implemented as part of Google Test.  This limited
8546 //   implementation should be enough most of the time when writing
8547 //   death tests; though it lacks many features you can find in PCRE
8548 //   or POSIX extended regex syntax.  For example, we don't support
8549 //   union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
8550 //   repetition count ("x{5,7}"), among others.
8551 //
8552 //   Below is the syntax that we do support.  We chose it to be a
8553 //   subset of both PCRE and POSIX extended regex, so it's easy to
8554 //   learn wherever you come from.  In the following: 'A' denotes a
8555 //   literal character, period (.), or a single \\ escape sequence;
8556 //   'x' and 'y' denote regular expressions; 'm' and 'n' are for
8557 //   natural numbers.
8558 //
8559 //     c     matches any literal character c
8560 //     \\d   matches any decimal digit
8561 //     \\D   matches any character that's not a decimal digit
8562 //     \\f   matches \f
8563 //     \\n   matches \n
8564 //     \\r   matches \r
8565 //     \\s   matches any ASCII whitespace, including \n
8566 //     \\S   matches any character that's not a whitespace
8567 //     \\t   matches \t
8568 //     \\v   matches \v
8569 //     \\w   matches any letter, _, or decimal digit
8570 //     \\W   matches any character that \\w doesn't match
8571 //     \\c   matches any literal character c, which must be a punctuation
8572 //     .     matches any single character except \n
8573 //     A?    matches 0 or 1 occurrences of A
8574 //     A*    matches 0 or many occurrences of A
8575 //     A+    matches 1 or many occurrences of A
8576 //     ^     matches the beginning of a string (not that of each line)
8577 //     $     matches the end of a string (not that of each line)
8578 //     xy    matches x followed by y
8579 //
8580 //   If you accidentally use PCRE or POSIX extended regex features
8581 //   not implemented by us, you will get a run-time failure.  In that
8582 //   case, please try to rewrite your regular expression within the
8583 //   above syntax.
8584 //
8585 //   This implementation is *not* meant to be as highly tuned or robust
8586 //   as a compiled regex library, but should perform well enough for a
8587 //   death test, which already incurs significant overhead by launching
8588 //   a child process.
8589 //
8590 // Known caveats:
8591 //
8592 //   A "threadsafe" style death test obtains the path to the test
8593 //   program from argv[0] and re-executes it in the sub-process.  For
8594 //   simplicity, the current implementation doesn't search the PATH
8595 //   when launching the sub-process.  This means that the user must
8596 //   invoke the test program via a path that contains at least one
8597 //   path separator (e.g. path/to/foo_test and
8598 //   /absolute/path/to/bar_test are fine, but foo_test is not).  This
8599 //   is rarely a problem as people usually don't put the test binary
8600 //   directory in PATH.
8601 //
8602 // TODO(wan@google.com): make thread-safe death tests search the PATH.
8603 
8604 // Asserts that a given statement causes the program to exit, with an
8605 // integer exit status that satisfies predicate, and emitting error output
8606 // that matches regex.
8607 # define ASSERT_EXIT(statement, predicate, regex) \
8608     GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
8609 
8610 // Like ASSERT_EXIT, but continues on to successive tests in the
8611 // test case, if any:
8612 # define EXPECT_EXIT(statement, predicate, regex) \
8613     GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
8614 
8615 // Asserts that a given statement causes the program to exit, either by
8616 // explicitly exiting with a nonzero exit code or being killed by a
8617 // signal, and emitting error output that matches regex.
8618 # define ASSERT_DEATH(statement, regex) \
8619     ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
8620 
8621 // Like ASSERT_DEATH, but continues on to successive tests in the
8622 // test case, if any:
8623 # define EXPECT_DEATH(statement, regex) \
8624     EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
8625 
8626 // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
8627 
8628 // Tests that an exit code describes a normal exit with a given exit code.
8629 class GTEST_API_ ExitedWithCode {
8630  public:
8631   explicit ExitedWithCode(int exit_code);
8632   bool operator()(int exit_status) const;
8633  private:
8634   // No implementation - assignment is unsupported.
8635   void operator=(const ExitedWithCode& other);
8636 
8637   const int exit_code_;
8638 };
8639 
8640 # if !GTEST_OS_WINDOWS
8641 // Tests that an exit code describes an exit due to termination by a
8642 // given signal.
8643 class GTEST_API_ KilledBySignal {
8644  public:
8645   explicit KilledBySignal(int signum);
8646   bool operator()(int exit_status) const;
8647  private:
8648   const int signum_;
8649 };
8650 # endif  // !GTEST_OS_WINDOWS
8651 
8652 // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
8653 // The death testing framework causes this to have interesting semantics,
8654 // since the sideeffects of the call are only visible in opt mode, and not
8655 // in debug mode.
8656 //
8657 // In practice, this can be used to test functions that utilize the
8658 // LOG(DFATAL) macro using the following style:
8659 //
8660 // int DieInDebugOr12(int* sideeffect) {
8661 //   if (sideeffect) {
8662 //     *sideeffect = 12;
8663 //   }
8664 //   LOG(DFATAL) << "death";
8665 //   return 12;
8666 // }
8667 //
8668 // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
8669 //   int sideeffect = 0;
8670 //   // Only asserts in dbg.
8671 //   EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
8672 //
8673 // #ifdef NDEBUG
8674 //   // opt-mode has sideeffect visible.
8675 //   EXPECT_EQ(12, sideeffect);
8676 // #else
8677 //   // dbg-mode no visible sideeffect.
8678 //   EXPECT_EQ(0, sideeffect);
8679 // #endif
8680 // }
8681 //
8682 // This will assert that DieInDebugReturn12InOpt() crashes in debug
8683 // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
8684 // appropriate fallback value (12 in this case) in opt mode. If you
8685 // need to test that a function has appropriate side-effects in opt
8686 // mode, include assertions against the side-effects.  A general
8687 // pattern for this is:
8688 //
8689 // EXPECT_DEBUG_DEATH({
8690 //   // Side-effects here will have an effect after this statement in
8691 //   // opt mode, but none in debug mode.
8692 //   EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
8693 // }, "death");
8694 //
8695 # ifdef NDEBUG
8696 
8697 #  define EXPECT_DEBUG_DEATH(statement, regex) \
8698   GTEST_EXECUTE_STATEMENT_(statement, regex)
8699 
8700 #  define ASSERT_DEBUG_DEATH(statement, regex) \
8701   GTEST_EXECUTE_STATEMENT_(statement, regex)
8702 
8703 # else
8704 
8705 #  define EXPECT_DEBUG_DEATH(statement, regex) \
8706   EXPECT_DEATH(statement, regex)
8707 
8708 #  define ASSERT_DEBUG_DEATH(statement, regex) \
8709   ASSERT_DEATH(statement, regex)
8710 
8711 # endif  // NDEBUG for EXPECT_DEBUG_DEATH
8712 #endif  // GTEST_HAS_DEATH_TEST
8713 
8714 // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
8715 // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
8716 // death tests are supported; otherwise they just issue a warning.  This is
8717 // useful when you are combining death test assertions with normal test
8718 // assertions in one test.
8719 #if GTEST_HAS_DEATH_TEST
8720 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
8721     EXPECT_DEATH(statement, regex)
8722 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
8723     ASSERT_DEATH(statement, regex)
8724 #else
8725 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
8726     GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
8727 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
8728     GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
8729 #endif
8730 
8731 }  // namespace testing
8732 
8733 #endif  // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8734 // This file was GENERATED by command:
8735 //     pump.py gtest-param-test.h.pump
8736 // DO NOT EDIT BY HAND!!!
8737 
8738 // Copyright 2008, Google Inc.
8739 // All rights reserved.
8740 //
8741 // Redistribution and use in source and binary forms, with or without
8742 // modification, are permitted provided that the following conditions are
8743 // met:
8744 //
8745 //     * Redistributions of source code must retain the above copyright
8746 // notice, this list of conditions and the following disclaimer.
8747 //     * Redistributions in binary form must reproduce the above
8748 // copyright notice, this list of conditions and the following disclaimer
8749 // in the documentation and/or other materials provided with the
8750 // distribution.
8751 //     * Neither the name of Google Inc. nor the names of its
8752 // contributors may be used to endorse or promote products derived from
8753 // this software without specific prior written permission.
8754 //
8755 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8756 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8757 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8758 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8759 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8760 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8761 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8762 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8763 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8764 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8765 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8766 //
8767 // Authors: vladl@google.com (Vlad Losev)
8768 //
8769 // Macros and functions for implementing parameterized tests
8770 // in Google C++ Testing Framework (Google Test)
8771 //
8772 // This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
8773 //
8774 #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8775 #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8776 
8777 
8778 // Value-parameterized tests allow you to test your code with different
8779 // parameters without writing multiple copies of the same test.
8780 //
8781 // Here is how you use value-parameterized tests:
8782 
8783 #if 0
8784 
8785 // To write value-parameterized tests, first you should define a fixture
8786 // class. It is usually derived from testing::TestWithParam<T> (see below for
8787 // another inheritance scheme that's sometimes useful in more complicated
8788 // class hierarchies), where the type of your parameter values.
8789 // TestWithParam<T> is itself derived from testing::Test. T can be any
8790 // copyable type. If it's a raw pointer, you are responsible for managing the
8791 // lifespan of the pointed values.
8792 
8793 class FooTest : public ::testing::TestWithParam<const char*> {
8794   // You can implement all the usual class fixture members here.
8795 };
8796 
8797 // Then, use the TEST_P macro to define as many parameterized tests
8798 // for this fixture as you want. The _P suffix is for "parameterized"
8799 // or "pattern", whichever you prefer to think.
8800 
8801 TEST_P(FooTest, DoesBlah) {
8802   // Inside a test, access the test parameter with the GetParam() method
8803   // of the TestWithParam<T> class:
8804   EXPECT_TRUE(foo.Blah(GetParam()));
8805   ...
8806 }
8807 
8808 TEST_P(FooTest, HasBlahBlah) {
8809   ...
8810 }
8811 
8812 // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
8813 // case with any set of parameters you want. Google Test defines a number
8814 // of functions for generating test parameters. They return what we call
8815 // (surprise!) parameter generators. Here is a  summary of them, which
8816 // are all in the testing namespace:
8817 //
8818 //
8819 //  Range(begin, end [, step]) - Yields values {begin, begin+step,
8820 //                               begin+step+step, ...}. The values do not
8821 //                               include end. step defaults to 1.
8822 //  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.
8823 //  ValuesIn(container)        - Yields values from a C-style array, an STL
8824 //  ValuesIn(begin,end)          container, or an iterator range [begin, end).
8825 //  Bool()                     - Yields sequence {false, true}.
8826 //  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product
8827 //                               for the math savvy) of the values generated
8828 //                               by the N generators.
8829 //
8830 // For more details, see comments at the definitions of these functions below
8831 // in this file.
8832 //
8833 // The following statement will instantiate tests from the FooTest test case
8834 // each with parameter values "meeny", "miny", and "moe".
8835 
8836 INSTANTIATE_TEST_CASE_P(InstantiationName,
8837                         FooTest,
8838                         Values("meeny", "miny", "moe"));
8839 
8840 // To distinguish different instances of the pattern, (yes, you
8841 // can instantiate it more then once) the first argument to the
8842 // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
8843 // actual test case name. Remember to pick unique prefixes for different
8844 // instantiations. The tests from the instantiation above will have
8845 // these names:
8846 //
8847 //    * InstantiationName/FooTest.DoesBlah/0 for "meeny"
8848 //    * InstantiationName/FooTest.DoesBlah/1 for "miny"
8849 //    * InstantiationName/FooTest.DoesBlah/2 for "moe"
8850 //    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
8851 //    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
8852 //    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
8853 //
8854 // You can use these names in --gtest_filter.
8855 //
8856 // This statement will instantiate all tests from FooTest again, each
8857 // with parameter values "cat" and "dog":
8858 
8859 const char* pets[] = {"cat", "dog"};
8860 INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
8861 
8862 // The tests from the instantiation above will have these names:
8863 //
8864 //    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
8865 //    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
8866 //    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
8867 //    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
8868 //
8869 // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
8870 // in the given test case, whether their definitions come before or
8871 // AFTER the INSTANTIATE_TEST_CASE_P statement.
8872 //
8873 // Please also note that generator expressions (including parameters to the
8874 // generators) are evaluated in InitGoogleTest(), after main() has started.
8875 // This allows the user on one hand, to adjust generator parameters in order
8876 // to dynamically determine a set of tests to run and on the other hand,
8877 // give the user a chance to inspect the generated tests with Google Test
8878 // reflection API before RUN_ALL_TESTS() is executed.
8879 //
8880 // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
8881 // for more examples.
8882 //
8883 // In the future, we plan to publish the API for defining new parameter
8884 // generators. But for now this interface remains part of the internal
8885 // implementation and is subject to change.
8886 //
8887 //
8888 // A parameterized test fixture must be derived from testing::Test and from
8889 // testing::WithParamInterface<T>, where T is the type of the parameter
8890 // values. Inheriting from TestWithParam<T> satisfies that requirement because
8891 // TestWithParam<T> inherits from both Test and WithParamInterface. In more
8892 // complicated hierarchies, however, it is occasionally useful to inherit
8893 // separately from Test and WithParamInterface. For example:
8894 
8895 class BaseTest : public ::testing::Test {
8896   // You can inherit all the usual members for a non-parameterized test
8897   // fixture here.
8898 };
8899 
8900 class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
8901   // The usual test fixture members go here too.
8902 };
8903 
8904 TEST_F(BaseTest, HasFoo) {
8905   // This is an ordinary non-parameterized test.
8906 }
8907 
8908 TEST_P(DerivedTest, DoesBlah) {
8909   // GetParam works just the same here as if you inherit from TestWithParam.
8910   EXPECT_TRUE(foo.Blah(GetParam()));
8911 }
8912 
8913 #endif  // 0
8914 
8915 
8916 #if !GTEST_OS_SYMBIAN
8917 # include <utility>
8918 #endif
8919 
8920 // scripts/fuse_gtest.py depends on gtest's own header being #included
8921 // *unconditionally*.  Therefore these #includes cannot be moved
8922 // inside #if GTEST_HAS_PARAM_TEST.
8923 // Copyright 2008 Google Inc.
8924 // All Rights Reserved.
8925 //
8926 // Redistribution and use in source and binary forms, with or without
8927 // modification, are permitted provided that the following conditions are
8928 // met:
8929 //
8930 //     * Redistributions of source code must retain the above copyright
8931 // notice, this list of conditions and the following disclaimer.
8932 //     * Redistributions in binary form must reproduce the above
8933 // copyright notice, this list of conditions and the following disclaimer
8934 // in the documentation and/or other materials provided with the
8935 // distribution.
8936 //     * Neither the name of Google Inc. nor the names of its
8937 // contributors may be used to endorse or promote products derived from
8938 // this software without specific prior written permission.
8939 //
8940 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8941 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8942 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8943 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8944 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8945 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8946 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8947 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8948 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8949 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8950 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8951 //
8952 // Author: vladl@google.com (Vlad Losev)
8953 
8954 // Type and function utilities for implementing parameterized tests.
8955 
8956 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
8957 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
8958 
8959 #include <iterator>
8960 #include <utility>
8961 #include <vector>
8962 
8963 // scripts/fuse_gtest.py depends on gtest's own header being #included
8964 // *unconditionally*.  Therefore these #includes cannot be moved
8965 // inside #if GTEST_HAS_PARAM_TEST.
8966 // Copyright 2003 Google Inc.
8967 // All rights reserved.
8968 //
8969 // Redistribution and use in source and binary forms, with or without
8970 // modification, are permitted provided that the following conditions are
8971 // met:
8972 //
8973 //     * Redistributions of source code must retain the above copyright
8974 // notice, this list of conditions and the following disclaimer.
8975 //     * Redistributions in binary form must reproduce the above
8976 // copyright notice, this list of conditions and the following disclaimer
8977 // in the documentation and/or other materials provided with the
8978 // distribution.
8979 //     * Neither the name of Google Inc. nor the names of its
8980 // contributors may be used to endorse or promote products derived from
8981 // this software without specific prior written permission.
8982 //
8983 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8984 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8985 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8986 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8987 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8988 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8989 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8990 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8991 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8992 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8993 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8994 //
8995 // Authors: Dan Egnor (egnor@google.com)
8996 //
8997 // A "smart" pointer type with reference tracking.  Every pointer to a
8998 // particular object is kept on a circular linked list.  When the last pointer
8999 // to an object is destroyed or reassigned, the object is deleted.
9000 //
9001 // Used properly, this deletes the object when the last reference goes away.
9002 // There are several caveats:
9003 // - Like all reference counting schemes, cycles lead to leaks.
9004 // - Each smart pointer is actually two pointers (8 bytes instead of 4).
9005 // - Every time a pointer is assigned, the entire list of pointers to that
9006 //   object is traversed.  This class is therefore NOT SUITABLE when there
9007 //   will often be more than two or three pointers to a particular object.
9008 // - References are only tracked as long as linked_ptr<> objects are copied.
9009 //   If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
9010 //   will happen (double deletion).
9011 //
9012 // A good use of this class is storing object references in STL containers.
9013 // You can safely put linked_ptr<> in a vector<>.
9014 // Other uses may not be as good.
9015 //
9016 // Note: If you use an incomplete type with linked_ptr<>, the class
9017 // *containing* linked_ptr<> must have a constructor and destructor (even
9018 // if they do nothing!).
9019 //
9020 // Bill Gibbons suggested we use something like this.
9021 //
9022 // Thread Safety:
9023 //   Unlike other linked_ptr implementations, in this implementation
9024 //   a linked_ptr object is thread-safe in the sense that:
9025 //     - it's safe to copy linked_ptr objects concurrently,
9026 //     - it's safe to copy *from* a linked_ptr and read its underlying
9027 //       raw pointer (e.g. via get()) concurrently, and
9028 //     - it's safe to write to two linked_ptrs that point to the same
9029 //       shared object concurrently.
9030 // TODO(wan@google.com): rename this to safe_linked_ptr to avoid
9031 // confusion with normal linked_ptr.
9032 
9033 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9034 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9035 
9036 #include <stdlib.h>
9037 #include <assert.h>
9038 
9039 
9040 namespace testing {
9041 namespace internal {
9042 
9043 // Protects copying of all linked_ptr objects.
9044 GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
9045 
9046 // This is used internally by all instances of linked_ptr<>.  It needs to be
9047 // a non-template class because different types of linked_ptr<> can refer to
9048 // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
9049 // So, it needs to be possible for different types of linked_ptr to participate
9050 // in the same circular linked list, so we need a single class type here.
9051 //
9052 // DO NOT USE THIS CLASS DIRECTLY YOURSELF.  Use linked_ptr<T>.
9053 class linked_ptr_internal {
9054  public:
9055   // Create a new circle that includes only this instance.
9056   void join_new() {
9057     next_ = this;
9058   }
9059 
9060   // Many linked_ptr operations may change p.link_ for some linked_ptr
9061   // variable p in the same circle as this object.  Therefore we need
9062   // to prevent two such operations from occurring concurrently.
9063   //
9064   // Note that different types of linked_ptr objects can coexist in a
9065   // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
9066   // linked_ptr<Derived2>).  Therefore we must use a single mutex to
9067   // protect all linked_ptr objects.  This can create serious
9068   // contention in production code, but is acceptable in a testing
9069   // framework.
9070 
9071   // Join an existing circle.
9072   void join(linked_ptr_internal const* ptr)
9073       GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
9074     MutexLock lock(&g_linked_ptr_mutex);
9075 
9076     linked_ptr_internal const* p = ptr;
9077     while (p->next_ != ptr) p = p->next_;
9078     p->next_ = this;
9079     next_ = ptr;
9080   }
9081 
9082   // Leave whatever circle we're part of.  Returns true if we were the
9083   // last member of the circle.  Once this is done, you can join() another.
9084   bool depart()
9085       GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
9086     MutexLock lock(&g_linked_ptr_mutex);
9087 
9088     if (next_ == this) return true;
9089     linked_ptr_internal const* p = next_;
9090     while (p->next_ != this) p = p->next_;
9091     p->next_ = next_;
9092     return false;
9093   }
9094 
9095  private:
9096   mutable linked_ptr_internal const* next_;
9097 };
9098 
9099 template <typename T>
9100 class linked_ptr {
9101  public:
9102   typedef T element_type;
9103 
9104   // Take over ownership of a raw pointer.  This should happen as soon as
9105   // possible after the object is created.
9106   explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
9107   ~linked_ptr() { depart(); }
9108 
9109   // Copy an existing linked_ptr<>, adding ourselves to the list of references.
9110   template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
9111   linked_ptr(linked_ptr const& ptr) {  // NOLINT
9112     assert(&ptr != this);
9113     copy(&ptr);
9114   }
9115 
9116   // Assignment releases the old value and acquires the new.
9117   template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
9118     depart();
9119     copy(&ptr);
9120     return *this;
9121   }
9122 
9123   linked_ptr& operator=(linked_ptr const& ptr) {
9124     if (&ptr != this) {
9125       depart();
9126       copy(&ptr);
9127     }
9128     return *this;
9129   }
9130 
9131   // Smart pointer members.
9132   void reset(T* ptr = NULL) {
9133     depart();
9134     capture(ptr);
9135   }
9136   T* get() const { return value_; }
9137   T* operator->() const { return value_; }
9138   T& operator*() const { return *value_; }
9139 
9140   bool operator==(T* p) const { return value_ == p; }
9141   bool operator!=(T* p) const { return value_ != p; }
9142   template <typename U>
9143   bool operator==(linked_ptr<U> const& ptr) const {
9144     return value_ == ptr.get();
9145   }
9146   template <typename U>
9147   bool operator!=(linked_ptr<U> const& ptr) const {
9148     return value_ != ptr.get();
9149   }
9150 
9151  private:
9152   template <typename U>
9153   friend class linked_ptr;
9154 
9155   T* value_;
9156   linked_ptr_internal link_;
9157 
9158   void depart() {
9159     if (link_.depart()) delete value_;
9160   }
9161 
9162   void capture(T* ptr) {
9163     value_ = ptr;
9164     link_.join_new();
9165   }
9166 
9167   template <typename U> void copy(linked_ptr<U> const* ptr) {
9168     value_ = ptr->get();
9169     if (value_)
9170       link_.join(&ptr->link_);
9171     else
9172       link_.join_new();
9173   }
9174 };
9175 
9176 template<typename T> inline
9177 bool operator==(T* ptr, const linked_ptr<T>& x) {
9178   return ptr == x.get();
9179 }
9180 
9181 template<typename T> inline
9182 bool operator!=(T* ptr, const linked_ptr<T>& x) {
9183   return ptr != x.get();
9184 }
9185 
9186 // A function to convert T* into linked_ptr<T>
9187 // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
9188 // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
9189 template <typename T>
9190 linked_ptr<T> make_linked_ptr(T* ptr) {
9191   return linked_ptr<T>(ptr);
9192 }
9193 
9194 }  // namespace internal
9195 }  // namespace testing
9196 
9197 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9198 // Copyright 2007, Google Inc.
9199 // All rights reserved.
9200 //
9201 // Redistribution and use in source and binary forms, with or without
9202 // modification, are permitted provided that the following conditions are
9203 // met:
9204 //
9205 //     * Redistributions of source code must retain the above copyright
9206 // notice, this list of conditions and the following disclaimer.
9207 //     * Redistributions in binary form must reproduce the above
9208 // copyright notice, this list of conditions and the following disclaimer
9209 // in the documentation and/or other materials provided with the
9210 // distribution.
9211 //     * Neither the name of Google Inc. nor the names of its
9212 // contributors may be used to endorse or promote products derived from
9213 // this software without specific prior written permission.
9214 //
9215 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9216 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9217 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9218 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9219 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9220 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9221 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9222 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9223 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9224 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9225 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9226 //
9227 // Author: wan@google.com (Zhanyong Wan)
9228 
9229 // Google Test - The Google C++ Testing Framework
9230 //
9231 // This file implements a universal value printer that can print a
9232 // value of any type T:
9233 //
9234 //   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
9235 //
9236 // A user can teach this function how to print a class type T by
9237 // defining either operator<<() or PrintTo() in the namespace that
9238 // defines T.  More specifically, the FIRST defined function in the
9239 // following list will be used (assuming T is defined in namespace
9240 // foo):
9241 //
9242 //   1. foo::PrintTo(const T&, ostream*)
9243 //   2. operator<<(ostream&, const T&) defined in either foo or the
9244 //      global namespace.
9245 //
9246 // If none of the above is defined, it will print the debug string of
9247 // the value if it is a protocol buffer, or print the raw bytes in the
9248 // value otherwise.
9249 //
9250 // To aid debugging: when T is a reference type, the address of the
9251 // value is also printed; when T is a (const) char pointer, both the
9252 // pointer value and the NUL-terminated string it points to are
9253 // printed.
9254 //
9255 // We also provide some convenient wrappers:
9256 //
9257 //   // Prints a value to a string.  For a (const or not) char
9258 //   // pointer, the NUL-terminated string (but not the pointer) is
9259 //   // printed.
9260 //   std::string ::testing::PrintToString(const T& value);
9261 //
9262 //   // Prints a value tersely: for a reference type, the referenced
9263 //   // value (but not the address) is printed; for a (const or not) char
9264 //   // pointer, the NUL-terminated string (but not the pointer) is
9265 //   // printed.
9266 //   void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
9267 //
9268 //   // Prints value using the type inferred by the compiler.  The difference
9269 //   // from UniversalTersePrint() is that this function prints both the
9270 //   // pointer and the NUL-terminated string for a (const or not) char pointer.
9271 //   void ::testing::internal::UniversalPrint(const T& value, ostream*);
9272 //
9273 //   // Prints the fields of a tuple tersely to a string vector, one
9274 //   // element for each field. Tuple support must be enabled in
9275 //   // gtest-port.h.
9276 //   std::vector<string> UniversalTersePrintTupleFieldsToStrings(
9277 //       const Tuple& value);
9278 //
9279 // Known limitation:
9280 //
9281 // The print primitives print the elements of an STL-style container
9282 // using the compiler-inferred type of *iter where iter is a
9283 // const_iterator of the container.  When const_iterator is an input
9284 // iterator but not a forward iterator, this inferred type may not
9285 // match value_type, and the print output may be incorrect.  In
9286 // practice, this is rarely a problem as for most containers
9287 // const_iterator is a forward iterator.  We'll fix this if there's an
9288 // actual need for it.  Note that this fix cannot rely on value_type
9289 // being defined as many user-defined container types don't have
9290 // value_type.
9291 
9292 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9293 #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9294 
9295 #include <ostream>  // NOLINT
9296 #include <sstream>
9297 #include <string>
9298 #include <utility>
9299 #include <vector>
9300 
9301 namespace testing {
9302 
9303 // Definitions in the 'internal' and 'internal2' name spaces are
9304 // subject to change without notice.  DO NOT USE THEM IN USER CODE!
9305 namespace internal2 {
9306 
9307 // Prints the given number of bytes in the given object to the given
9308 // ostream.
9309 GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
9310                                      size_t count,
9311                                      ::std::ostream* os);
9312 
9313 // For selecting which printer to use when a given type has neither <<
9314 // nor PrintTo().
9315 enum TypeKind {
9316   kProtobuf,              // a protobuf type
9317   kConvertibleToInteger,  // a type implicitly convertible to BiggestInt
9318                           // (e.g. a named or unnamed enum type)
9319   kOtherType              // anything else
9320 };
9321 
9322 // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
9323 // by the universal printer to print a value of type T when neither
9324 // operator<< nor PrintTo() is defined for T, where kTypeKind is the
9325 // "kind" of T as defined by enum TypeKind.
9326 template <typename T, TypeKind kTypeKind>
9327 class TypeWithoutFormatter {
9328  public:
9329   // This default version is called when kTypeKind is kOtherType.
9330   static void PrintValue(const T& value, ::std::ostream* os) {
9331     PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
9332                          sizeof(value), os);
9333   }
9334 };
9335 
9336 // We print a protobuf using its ShortDebugString() when the string
9337 // doesn't exceed this many characters; otherwise we print it using
9338 // DebugString() for better readability.
9339 const size_t kProtobufOneLinerMaxLength = 50;
9340 
9341 template <typename T>
9342 class TypeWithoutFormatter<T, kProtobuf> {
9343  public:
9344   static void PrintValue(const T& value, ::std::ostream* os) {
9345     const ::testing::internal::string short_str = value.ShortDebugString();
9346     const ::testing::internal::string pretty_str =
9347         short_str.length() <= kProtobufOneLinerMaxLength ?
9348         short_str : ("\n" + value.DebugString());
9349     *os << ("<" + pretty_str + ">");
9350   }
9351 };
9352 
9353 template <typename T>
9354 class TypeWithoutFormatter<T, kConvertibleToInteger> {
9355  public:
9356   // Since T has no << operator or PrintTo() but can be implicitly
9357   // converted to BiggestInt, we print it as a BiggestInt.
9358   //
9359   // Most likely T is an enum type (either named or unnamed), in which
9360   // case printing it as an integer is the desired behavior.  In case
9361   // T is not an enum, printing it as an integer is the best we can do
9362   // given that it has no user-defined printer.
9363   static void PrintValue(const T& value, ::std::ostream* os) {
9364     const internal::BiggestInt kBigInt = value;
9365     *os << kBigInt;
9366   }
9367 };
9368 
9369 // Prints the given value to the given ostream.  If the value is a
9370 // protocol message, its debug string is printed; if it's an enum or
9371 // of a type implicitly convertible to BiggestInt, it's printed as an
9372 // integer; otherwise the bytes in the value are printed.  This is
9373 // what UniversalPrinter<T>::Print() does when it knows nothing about
9374 // type T and T has neither << operator nor PrintTo().
9375 //
9376 // A user can override this behavior for a class type Foo by defining
9377 // a << operator in the namespace where Foo is defined.
9378 //
9379 // We put this operator in namespace 'internal2' instead of 'internal'
9380 // to simplify the implementation, as much code in 'internal' needs to
9381 // use << in STL, which would conflict with our own << were it defined
9382 // in 'internal'.
9383 //
9384 // Note that this operator<< takes a generic std::basic_ostream<Char,
9385 // CharTraits> type instead of the more restricted std::ostream.  If
9386 // we define it to take an std::ostream instead, we'll get an
9387 // "ambiguous overloads" compiler error when trying to print a type
9388 // Foo that supports streaming to std::basic_ostream<Char,
9389 // CharTraits>, as the compiler cannot tell whether
9390 // operator<<(std::ostream&, const T&) or
9391 // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
9392 // specific.
9393 template <typename Char, typename CharTraits, typename T>
9394 ::std::basic_ostream<Char, CharTraits>& operator<<(
9395     ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
9396   TypeWithoutFormatter<T,
9397       (internal::IsAProtocolMessage<T>::value ? kProtobuf :
9398        internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
9399        kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
9400   return os;
9401 }
9402 
9403 }  // namespace internal2
9404 }  // namespace testing
9405 
9406 // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
9407 // magic needed for implementing UniversalPrinter won't work.
9408 namespace testing_internal {
9409 
9410 // Used to print a value that is not an STL-style container when the
9411 // user doesn't define PrintTo() for it.
9412 template <typename T>
9413 void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
9414   // With the following statement, during unqualified name lookup,
9415   // testing::internal2::operator<< appears as if it was declared in
9416   // the nearest enclosing namespace that contains both
9417   // ::testing_internal and ::testing::internal2, i.e. the global
9418   // namespace.  For more details, refer to the C++ Standard section
9419   // 7.3.4-1 [namespace.udir].  This allows us to fall back onto
9420   // testing::internal2::operator<< in case T doesn't come with a <<
9421   // operator.
9422   //
9423   // We cannot write 'using ::testing::internal2::operator<<;', which
9424   // gcc 3.3 fails to compile due to a compiler bug.
9425   using namespace ::testing::internal2;  // NOLINT
9426 
9427   // Assuming T is defined in namespace foo, in the next statement,
9428   // the compiler will consider all of:
9429   //
9430   //   1. foo::operator<< (thanks to Koenig look-up),
9431   //   2. ::operator<< (as the current namespace is enclosed in ::),
9432   //   3. testing::internal2::operator<< (thanks to the using statement above).
9433   //
9434   // The operator<< whose type matches T best will be picked.
9435   //
9436   // We deliberately allow #2 to be a candidate, as sometimes it's
9437   // impossible to define #1 (e.g. when foo is ::std, defining
9438   // anything in it is undefined behavior unless you are a compiler
9439   // vendor.).
9440   *os << value;
9441 }
9442 
9443 }  // namespace testing_internal
9444 
9445 namespace testing {
9446 namespace internal {
9447 
9448 // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
9449 // value to the given ostream.  The caller must ensure that
9450 // 'ostream_ptr' is not NULL, or the behavior is undefined.
9451 //
9452 // We define UniversalPrinter as a class template (as opposed to a
9453 // function template), as we need to partially specialize it for
9454 // reference types, which cannot be done with function templates.
9455 template <typename T>
9456 class UniversalPrinter;
9457 
9458 template <typename T>
9459 void UniversalPrint(const T& value, ::std::ostream* os);
9460 
9461 // Used to print an STL-style container when the user doesn't define
9462 // a PrintTo() for it.
9463 template <typename C>
9464 void DefaultPrintTo(IsContainer /* dummy */,
9465                     false_type /* is not a pointer */,
9466                     const C& container, ::std::ostream* os) {
9467   const size_t kMaxCount = 32;  // The maximum number of elements to print.
9468   *os << '{';
9469   size_t count = 0;
9470   for (typename C::const_iterator it = container.begin();
9471        it != container.end(); ++it, ++count) {
9472     if (count > 0) {
9473       *os << ',';
9474       if (count == kMaxCount) {  // Enough has been printed.
9475         *os << " ...";
9476         break;
9477       }
9478     }
9479     *os << ' ';
9480     // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
9481     // handle *it being a native array.
9482     internal::UniversalPrint(*it, os);
9483   }
9484 
9485   if (count > 0) {
9486     *os << ' ';
9487   }
9488   *os << '}';
9489 }
9490 
9491 // Used to print a pointer that is neither a char pointer nor a member
9492 // pointer, when the user doesn't define PrintTo() for it.  (A member
9493 // variable pointer or member function pointer doesn't really point to
9494 // a location in the address space.  Their representation is
9495 // implementation-defined.  Therefore they will be printed as raw
9496 // bytes.)
9497 template <typename T>
9498 void DefaultPrintTo(IsNotContainer /* dummy */,
9499                     true_type /* is a pointer */,
9500                     T* p, ::std::ostream* os) {
9501   if (p == NULL) {
9502     *os << "NULL";
9503   } else {
9504     // C++ doesn't allow casting from a function pointer to any object
9505     // pointer.
9506     //
9507     // IsTrue() silences warnings: "Condition is always true",
9508     // "unreachable code".
9509     if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
9510       // T is not a function type.  We just call << to print p,
9511       // relying on ADL to pick up user-defined << for their pointer
9512       // types, if any.
9513       *os << p;
9514     } else {
9515       // T is a function type, so '*os << p' doesn't do what we want
9516       // (it just prints p as bool).  We want to print p as a const
9517       // void*.  However, we cannot cast it to const void* directly,
9518       // even using reinterpret_cast, as earlier versions of gcc
9519       // (e.g. 3.4.5) cannot compile the cast when p is a function
9520       // pointer.  Casting to UInt64 first solves the problem.
9521       *os << reinterpret_cast<const void*>(
9522           reinterpret_cast<internal::UInt64>(p));
9523     }
9524   }
9525 }
9526 
9527 // Used to print a non-container, non-pointer value when the user
9528 // doesn't define PrintTo() for it.
9529 template <typename T>
9530 void DefaultPrintTo(IsNotContainer /* dummy */,
9531                     false_type /* is not a pointer */,
9532                     const T& value, ::std::ostream* os) {
9533   ::testing_internal::DefaultPrintNonContainerTo(value, os);
9534 }
9535 
9536 // Prints the given value using the << operator if it has one;
9537 // otherwise prints the bytes in it.  This is what
9538 // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
9539 // or overloaded for type T.
9540 //
9541 // A user can override this behavior for a class type Foo by defining
9542 // an overload of PrintTo() in the namespace where Foo is defined.  We
9543 // give the user this option as sometimes defining a << operator for
9544 // Foo is not desirable (e.g. the coding style may prevent doing it,
9545 // or there is already a << operator but it doesn't do what the user
9546 // wants).
9547 template <typename T>
9548 void PrintTo(const T& value, ::std::ostream* os) {
9549   // DefaultPrintTo() is overloaded.  The type of its first two
9550   // arguments determine which version will be picked.  If T is an
9551   // STL-style container, the version for container will be called; if
9552   // T is a pointer, the pointer version will be called; otherwise the
9553   // generic version will be called.
9554   //
9555   // Note that we check for container types here, prior to we check
9556   // for protocol message types in our operator<<.  The rationale is:
9557   //
9558   // For protocol messages, we want to give people a chance to
9559   // override Google Mock's format by defining a PrintTo() or
9560   // operator<<.  For STL containers, other formats can be
9561   // incompatible with Google Mock's format for the container
9562   // elements; therefore we check for container types here to ensure
9563   // that our format is used.
9564   //
9565   // The second argument of DefaultPrintTo() is needed to bypass a bug
9566   // in Symbian's C++ compiler that prevents it from picking the right
9567   // overload between:
9568   //
9569   //   PrintTo(const T& x, ...);
9570   //   PrintTo(T* x, ...);
9571   DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
9572 }
9573 
9574 // The following list of PrintTo() overloads tells
9575 // UniversalPrinter<T>::Print() how to print standard types (built-in
9576 // types, strings, plain arrays, and pointers).
9577 
9578 // Overloads for various char types.
9579 GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
9580 GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
9581 inline void PrintTo(char c, ::std::ostream* os) {
9582   // When printing a plain char, we always treat it as unsigned.  This
9583   // way, the output won't be affected by whether the compiler thinks
9584   // char is signed or not.
9585   PrintTo(static_cast<unsigned char>(c), os);
9586 }
9587 
9588 // Overloads for other simple built-in types.
9589 inline void PrintTo(bool x, ::std::ostream* os) {
9590   *os << (x ? "true" : "false");
9591 }
9592 
9593 // Overload for wchar_t type.
9594 // Prints a wchar_t as a symbol if it is printable or as its internal
9595 // code otherwise and also as its decimal code (except for L'\0').
9596 // The L'\0' char is printed as "L'\\0'". The decimal code is printed
9597 // as signed integer when wchar_t is implemented by the compiler
9598 // as a signed type and is printed as an unsigned integer when wchar_t
9599 // is implemented as an unsigned type.
9600 GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
9601 
9602 // Overloads for C strings.
9603 GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
9604 inline void PrintTo(char* s, ::std::ostream* os) {
9605   PrintTo(ImplicitCast_<const char*>(s), os);
9606 }
9607 
9608 // signed/unsigned char is often used for representing binary data, so
9609 // we print pointers to it as void* to be safe.
9610 inline void PrintTo(const signed char* s, ::std::ostream* os) {
9611   PrintTo(ImplicitCast_<const void*>(s), os);
9612 }
9613 inline void PrintTo(signed char* s, ::std::ostream* os) {
9614   PrintTo(ImplicitCast_<const void*>(s), os);
9615 }
9616 inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
9617   PrintTo(ImplicitCast_<const void*>(s), os);
9618 }
9619 inline void PrintTo(unsigned char* s, ::std::ostream* os) {
9620   PrintTo(ImplicitCast_<const void*>(s), os);
9621 }
9622 
9623 // MSVC can be configured to define wchar_t as a typedef of unsigned
9624 // short.  It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
9625 // type.  When wchar_t is a typedef, defining an overload for const
9626 // wchar_t* would cause unsigned short* be printed as a wide string,
9627 // possibly causing invalid memory accesses.
9628 #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
9629 // Overloads for wide C strings
9630 GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
9631 inline void PrintTo(wchar_t* s, ::std::ostream* os) {
9632   PrintTo(ImplicitCast_<const wchar_t*>(s), os);
9633 }
9634 #endif
9635 
9636 // Overload for C arrays.  Multi-dimensional arrays are printed
9637 // properly.
9638 
9639 // Prints the given number of elements in an array, without printing
9640 // the curly braces.
9641 template <typename T>
9642 void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
9643   UniversalPrint(a[0], os);
9644   for (size_t i = 1; i != count; i++) {
9645     *os << ", ";
9646     UniversalPrint(a[i], os);
9647   }
9648 }
9649 
9650 // Overloads for ::string and ::std::string.
9651 #if GTEST_HAS_GLOBAL_STRING
9652 GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
9653 inline void PrintTo(const ::string& s, ::std::ostream* os) {
9654   PrintStringTo(s, os);
9655 }
9656 #endif  // GTEST_HAS_GLOBAL_STRING
9657 
9658 GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
9659 inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
9660   PrintStringTo(s, os);
9661 }
9662 
9663 // Overloads for ::wstring and ::std::wstring.
9664 #if GTEST_HAS_GLOBAL_WSTRING
9665 GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
9666 inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
9667   PrintWideStringTo(s, os);
9668 }
9669 #endif  // GTEST_HAS_GLOBAL_WSTRING
9670 
9671 #if GTEST_HAS_STD_WSTRING
9672 GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
9673 inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
9674   PrintWideStringTo(s, os);
9675 }
9676 #endif  // GTEST_HAS_STD_WSTRING
9677 
9678 #if GTEST_HAS_TR1_TUPLE
9679 // Overload for ::std::tr1::tuple.  Needed for printing function arguments,
9680 // which are packed as tuples.
9681 
9682 // Helper function for printing a tuple.  T must be instantiated with
9683 // a tuple type.
9684 template <typename T>
9685 void PrintTupleTo(const T& t, ::std::ostream* os);
9686 
9687 // Overloaded PrintTo() for tuples of various arities.  We support
9688 // tuples of up-to 10 fields.  The following implementation works
9689 // regardless of whether tr1::tuple is implemented using the
9690 // non-standard variadic template feature or not.
9691 
9692 inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
9693   PrintTupleTo(t, os);
9694 }
9695 
9696 template <typename T1>
9697 void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
9698   PrintTupleTo(t, os);
9699 }
9700 
9701 template <typename T1, typename T2>
9702 void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
9703   PrintTupleTo(t, os);
9704 }
9705 
9706 template <typename T1, typename T2, typename T3>
9707 void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
9708   PrintTupleTo(t, os);
9709 }
9710 
9711 template <typename T1, typename T2, typename T3, typename T4>
9712 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
9713   PrintTupleTo(t, os);
9714 }
9715 
9716 template <typename T1, typename T2, typename T3, typename T4, typename T5>
9717 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
9718              ::std::ostream* os) {
9719   PrintTupleTo(t, os);
9720 }
9721 
9722 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9723           typename T6>
9724 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
9725              ::std::ostream* os) {
9726   PrintTupleTo(t, os);
9727 }
9728 
9729 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9730           typename T6, typename T7>
9731 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
9732              ::std::ostream* os) {
9733   PrintTupleTo(t, os);
9734 }
9735 
9736 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9737           typename T6, typename T7, typename T8>
9738 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
9739              ::std::ostream* os) {
9740   PrintTupleTo(t, os);
9741 }
9742 
9743 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9744           typename T6, typename T7, typename T8, typename T9>
9745 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
9746              ::std::ostream* os) {
9747   PrintTupleTo(t, os);
9748 }
9749 
9750 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9751           typename T6, typename T7, typename T8, typename T9, typename T10>
9752 void PrintTo(
9753     const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
9754     ::std::ostream* os) {
9755   PrintTupleTo(t, os);
9756 }
9757 #endif  // GTEST_HAS_TR1_TUPLE
9758 
9759 // Overload for std::pair.
9760 template <typename T1, typename T2>
9761 void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
9762   *os << '(';
9763   // We cannot use UniversalPrint(value.first, os) here, as T1 may be
9764   // a reference type.  The same for printing value.second.
9765   UniversalPrinter<T1>::Print(value.first, os);
9766   *os << ", ";
9767   UniversalPrinter<T2>::Print(value.second, os);
9768   *os << ')';
9769 }
9770 
9771 // Implements printing a non-reference type T by letting the compiler
9772 // pick the right overload of PrintTo() for T.
9773 template <typename T>
9774 class UniversalPrinter {
9775  public:
9776   // MSVC warns about adding const to a function type, so we want to
9777   // disable the warning.
9778 #ifdef _MSC_VER
9779 # pragma warning(push)          // Saves the current warning state.
9780 # pragma warning(disable:4180)  // Temporarily disables warning 4180.
9781 #endif  // _MSC_VER
9782 
9783   // Note: we deliberately don't call this PrintTo(), as that name
9784   // conflicts with ::testing::internal::PrintTo in the body of the
9785   // function.
9786   static void Print(const T& value, ::std::ostream* os) {
9787     // By default, ::testing::internal::PrintTo() is used for printing
9788     // the value.
9789     //
9790     // Thanks to Koenig look-up, if T is a class and has its own
9791     // PrintTo() function defined in its namespace, that function will
9792     // be visible here.  Since it is more specific than the generic ones
9793     // in ::testing::internal, it will be picked by the compiler in the
9794     // following statement - exactly what we want.
9795     PrintTo(value, os);
9796   }
9797 
9798 #ifdef _MSC_VER
9799 # pragma warning(pop)           // Restores the warning state.
9800 #endif  // _MSC_VER
9801 };
9802 
9803 // UniversalPrintArray(begin, len, os) prints an array of 'len'
9804 // elements, starting at address 'begin'.
9805 template <typename T>
9806 void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
9807   if (len == 0) {
9808     *os << "{}";
9809   } else {
9810     *os << "{ ";
9811     const size_t kThreshold = 18;
9812     const size_t kChunkSize = 8;
9813     // If the array has more than kThreshold elements, we'll have to
9814     // omit some details by printing only the first and the last
9815     // kChunkSize elements.
9816     // TODO(wan@google.com): let the user control the threshold using a flag.
9817     if (len <= kThreshold) {
9818       PrintRawArrayTo(begin, len, os);
9819     } else {
9820       PrintRawArrayTo(begin, kChunkSize, os);
9821       *os << ", ..., ";
9822       PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
9823     }
9824     *os << " }";
9825   }
9826 }
9827 // This overload prints a (const) char array compactly.
9828 GTEST_API_ void UniversalPrintArray(
9829     const char* begin, size_t len, ::std::ostream* os);
9830 
9831 // This overload prints a (const) wchar_t array compactly.
9832 GTEST_API_ void UniversalPrintArray(
9833     const wchar_t* begin, size_t len, ::std::ostream* os);
9834 
9835 // Implements printing an array type T[N].
9836 template <typename T, size_t N>
9837 class UniversalPrinter<T[N]> {
9838  public:
9839   // Prints the given array, omitting some elements when there are too
9840   // many.
9841   static void Print(const T (&a)[N], ::std::ostream* os) {
9842     UniversalPrintArray(a, N, os);
9843   }
9844 };
9845 
9846 // Implements printing a reference type T&.
9847 template <typename T>
9848 class UniversalPrinter<T&> {
9849  public:
9850   // MSVC warns about adding const to a function type, so we want to
9851   // disable the warning.
9852 #ifdef _MSC_VER
9853 # pragma warning(push)          // Saves the current warning state.
9854 # pragma warning(disable:4180)  // Temporarily disables warning 4180.
9855 #endif  // _MSC_VER
9856 
9857   static void Print(const T& value, ::std::ostream* os) {
9858     // Prints the address of the value.  We use reinterpret_cast here
9859     // as static_cast doesn't compile when T is a function type.
9860     *os << "@" << reinterpret_cast<const void*>(&value) << " ";
9861 
9862     // Then prints the value itself.
9863     UniversalPrint(value, os);
9864   }
9865 
9866 #ifdef _MSC_VER
9867 # pragma warning(pop)           // Restores the warning state.
9868 #endif  // _MSC_VER
9869 };
9870 
9871 // Prints a value tersely: for a reference type, the referenced value
9872 // (but not the address) is printed; for a (const) char pointer, the
9873 // NUL-terminated string (but not the pointer) is printed.
9874 
9875 template <typename T>
9876 class UniversalTersePrinter {
9877  public:
9878   static void Print(const T& value, ::std::ostream* os) {
9879     UniversalPrint(value, os);
9880   }
9881 };
9882 template <typename T>
9883 class UniversalTersePrinter<T&> {
9884  public:
9885   static void Print(const T& value, ::std::ostream* os) {
9886     UniversalPrint(value, os);
9887   }
9888 };
9889 template <typename T, size_t N>
9890 class UniversalTersePrinter<T[N]> {
9891  public:
9892   static void Print(const T (&value)[N], ::std::ostream* os) {
9893     UniversalPrinter<T[N]>::Print(value, os);
9894   }
9895 };
9896 template <>
9897 class UniversalTersePrinter<const char*> {
9898  public:
9899   static void Print(const char* str, ::std::ostream* os) {
9900     if (str == NULL) {
9901       *os << "NULL";
9902     } else {
9903       UniversalPrint(string(str), os);
9904     }
9905   }
9906 };
9907 template <>
9908 class UniversalTersePrinter<char*> {
9909  public:
9910   static void Print(char* str, ::std::ostream* os) {
9911     UniversalTersePrinter<const char*>::Print(str, os);
9912   }
9913 };
9914 
9915 #if GTEST_HAS_STD_WSTRING
9916 template <>
9917 class UniversalTersePrinter<const wchar_t*> {
9918  public:
9919   static void Print(const wchar_t* str, ::std::ostream* os) {
9920     if (str == NULL) {
9921       *os << "NULL";
9922     } else {
9923       UniversalPrint(::std::wstring(str), os);
9924     }
9925   }
9926 };
9927 #endif
9928 
9929 template <>
9930 class UniversalTersePrinter<wchar_t*> {
9931  public:
9932   static void Print(wchar_t* str, ::std::ostream* os) {
9933     UniversalTersePrinter<const wchar_t*>::Print(str, os);
9934   }
9935 };
9936 
9937 template <typename T>
9938 void UniversalTersePrint(const T& value, ::std::ostream* os) {
9939   UniversalTersePrinter<T>::Print(value, os);
9940 }
9941 
9942 // Prints a value using the type inferred by the compiler.  The
9943 // difference between this and UniversalTersePrint() is that for a
9944 // (const) char pointer, this prints both the pointer and the
9945 // NUL-terminated string.
9946 template <typename T>
9947 void UniversalPrint(const T& value, ::std::ostream* os) {
9948   // A workaround for the bug in VC++ 7.1 that prevents us from instantiating
9949   // UniversalPrinter with T directly.
9950   typedef T T1;
9951   UniversalPrinter<T1>::Print(value, os);
9952 }
9953 
9954 #if GTEST_HAS_TR1_TUPLE
9955 typedef ::std::vector<string> Strings;
9956 
9957 // This helper template allows PrintTo() for tuples and
9958 // UniversalTersePrintTupleFieldsToStrings() to be defined by
9959 // induction on the number of tuple fields.  The idea is that
9960 // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
9961 // fields in tuple t, and can be defined in terms of
9962 // TuplePrefixPrinter<N - 1>.
9963 
9964 // The inductive case.
9965 template <size_t N>
9966 struct TuplePrefixPrinter {
9967   // Prints the first N fields of a tuple.
9968   template <typename Tuple>
9969   static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
9970     TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
9971     *os << ", ";
9972     UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
9973         ::Print(::std::tr1::get<N - 1>(t), os);
9974   }
9975 
9976   // Tersely prints the first N fields of a tuple to a string vector,
9977   // one element for each field.
9978   template <typename Tuple>
9979   static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
9980     TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
9981     ::std::stringstream ss;
9982     UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
9983     strings->push_back(ss.str());
9984   }
9985 };
9986 
9987 // Base cases.
9988 template <>
9989 struct TuplePrefixPrinter<0> {
9990   template <typename Tuple>
9991   static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
9992 
9993   template <typename Tuple>
9994   static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
9995 };
9996 // We have to specialize the entire TuplePrefixPrinter<> class
9997 // template here, even though the definition of
9998 // TersePrintPrefixToStrings() is the same as the generic version, as
9999 // Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
10000 // support specializing a method template of a class template.
10001 template <>
10002 struct TuplePrefixPrinter<1> {
10003   template <typename Tuple>
10004   static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
10005     UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
10006         Print(::std::tr1::get<0>(t), os);
10007   }
10008 
10009   template <typename Tuple>
10010   static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
10011     ::std::stringstream ss;
10012     UniversalTersePrint(::std::tr1::get<0>(t), &ss);
10013     strings->push_back(ss.str());
10014   }
10015 };
10016 
10017 // Helper function for printing a tuple.  T must be instantiated with
10018 // a tuple type.
10019 template <typename T>
10020 void PrintTupleTo(const T& t, ::std::ostream* os) {
10021   *os << "(";
10022   TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
10023       PrintPrefixTo(t, os);
10024   *os << ")";
10025 }
10026 
10027 // Prints the fields of a tuple tersely to a string vector, one
10028 // element for each field.  See the comment before
10029 // UniversalTersePrint() for how we define "tersely".
10030 template <typename Tuple>
10031 Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
10032   Strings result;
10033   TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
10034       TersePrintPrefixToStrings(value, &result);
10035   return result;
10036 }
10037 #endif  // GTEST_HAS_TR1_TUPLE
10038 
10039 }  // namespace internal
10040 
10041 template <typename T>
10042 ::std::string PrintToString(const T& value) {
10043   ::std::stringstream ss;
10044   internal::UniversalTersePrinter<T>::Print(value, &ss);
10045   return ss.str();
10046 }
10047 
10048 }  // namespace testing
10049 
10050 #endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10051 
10052 #if GTEST_HAS_PARAM_TEST
10053 
10054 namespace testing {
10055 namespace internal {
10056 
10057 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10058 //
10059 // Outputs a message explaining invalid registration of different
10060 // fixture class for the same test case. This may happen when
10061 // TEST_P macro is used to define two tests with the same name
10062 // but in different namespaces.
10063 GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
10064                                           const char* file, int line);
10065 
10066 template <typename> class ParamGeneratorInterface;
10067 template <typename> class ParamGenerator;
10068 
10069 // Interface for iterating over elements provided by an implementation
10070 // of ParamGeneratorInterface<T>.
10071 template <typename T>
10072 class ParamIteratorInterface {
10073  public:
10074   virtual ~ParamIteratorInterface() {}
10075   // A pointer to the base generator instance.
10076   // Used only for the purposes of iterator comparison
10077   // to make sure that two iterators belong to the same generator.
10078   virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
10079   // Advances iterator to point to the next element
10080   // provided by the generator. The caller is responsible
10081   // for not calling Advance() on an iterator equal to
10082   // BaseGenerator()->End().
10083   virtual void Advance() = 0;
10084   // Clones the iterator object. Used for implementing copy semantics
10085   // of ParamIterator<T>.
10086   virtual ParamIteratorInterface* Clone() const = 0;
10087   // Dereferences the current iterator and provides (read-only) access
10088   // to the pointed value. It is the caller's responsibility not to call
10089   // Current() on an iterator equal to BaseGenerator()->End().
10090   // Used for implementing ParamGenerator<T>::operator*().
10091   virtual const T* Current() const = 0;
10092   // Determines whether the given iterator and other point to the same
10093   // element in the sequence generated by the generator.
10094   // Used for implementing ParamGenerator<T>::operator==().
10095   virtual bool Equals(const ParamIteratorInterface& other) const = 0;
10096 };
10097 
10098 // Class iterating over elements provided by an implementation of
10099 // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
10100 // and implements the const forward iterator concept.
10101 template <typename T>
10102 class ParamIterator {
10103  public:
10104   typedef T value_type;
10105   typedef const T& reference;
10106   typedef ptrdiff_t difference_type;
10107 
10108   // ParamIterator assumes ownership of the impl_ pointer.
10109   ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
10110   ParamIterator& operator=(const ParamIterator& other) {
10111     if (this != &other)
10112       impl_.reset(other.impl_->Clone());
10113     return *this;
10114   }
10115 
10116   const T& operator*() const { return *impl_->Current(); }
10117   const T* operator->() const { return impl_->Current(); }
10118   // Prefix version of operator++.
10119   ParamIterator& operator++() {
10120     impl_->Advance();
10121     return *this;
10122   }
10123   // Postfix version of operator++.
10124   ParamIterator operator++(int /*unused*/) {
10125     ParamIteratorInterface<T>* clone = impl_->Clone();
10126     impl_->Advance();
10127     return ParamIterator(clone);
10128   }
10129   bool operator==(const ParamIterator& other) const {
10130     return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
10131   }
10132   bool operator!=(const ParamIterator& other) const {
10133     return !(*this == other);
10134   }
10135 
10136  private:
10137   friend class ParamGenerator<T>;
10138   explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
10139   scoped_ptr<ParamIteratorInterface<T> > impl_;
10140 };
10141 
10142 // ParamGeneratorInterface<T> is the binary interface to access generators
10143 // defined in other translation units.
10144 template <typename T>
10145 class ParamGeneratorInterface {
10146  public:
10147   typedef T ParamType;
10148 
10149   virtual ~ParamGeneratorInterface() {}
10150 
10151   // Generator interface definition
10152   virtual ParamIteratorInterface<T>* Begin() const = 0;
10153   virtual ParamIteratorInterface<T>* End() const = 0;
10154 };
10155 
10156 // Wraps ParamGeneratorInterface<T> and provides general generator syntax
10157 // compatible with the STL Container concept.
10158 // This class implements copy initialization semantics and the contained
10159 // ParamGeneratorInterface<T> instance is shared among all copies
10160 // of the original object. This is possible because that instance is immutable.
10161 template<typename T>
10162 class ParamGenerator {
10163  public:
10164   typedef ParamIterator<T> iterator;
10165 
10166   explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
10167   ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
10168 
10169   ParamGenerator& operator=(const ParamGenerator& other) {
10170     impl_ = other.impl_;
10171     return *this;
10172   }
10173 
10174   iterator begin() const { return iterator(impl_->Begin()); }
10175   iterator end() const { return iterator(impl_->End()); }
10176 
10177  private:
10178   linked_ptr<const ParamGeneratorInterface<T> > impl_;
10179 };
10180 
10181 // Generates values from a range of two comparable values. Can be used to
10182 // generate sequences of user-defined types that implement operator+() and
10183 // operator<().
10184 // This class is used in the Range() function.
10185 template <typename T, typename IncrementT>
10186 class RangeGenerator : public ParamGeneratorInterface<T> {
10187  public:
10188   RangeGenerator(T begin, T end, IncrementT step)
10189       : begin_(begin), end_(end),
10190         step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
10191   virtual ~RangeGenerator() {}
10192 
10193   virtual ParamIteratorInterface<T>* Begin() const {
10194     return new Iterator(this, begin_, 0, step_);
10195   }
10196   virtual ParamIteratorInterface<T>* End() const {
10197     return new Iterator(this, end_, end_index_, step_);
10198   }
10199 
10200  private:
10201   class Iterator : public ParamIteratorInterface<T> {
10202    public:
10203     Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
10204              IncrementT step)
10205         : base_(base), value_(value), index_(index), step_(step) {}
10206     virtual ~Iterator() {}
10207 
10208     virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10209       return base_;
10210     }
10211     virtual void Advance() {
10212       value_ = value_ + step_;
10213       index_++;
10214     }
10215     virtual ParamIteratorInterface<T>* Clone() const {
10216       return new Iterator(*this);
10217     }
10218     virtual const T* Current() const { return &value_; }
10219     virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10220       // Having the same base generator guarantees that the other
10221       // iterator is of the same type and we can downcast.
10222       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10223           << "The program attempted to compare iterators "
10224           << "from different generators." << std::endl;
10225       const int other_index =
10226           CheckedDowncastToActualType<const Iterator>(&other)->index_;
10227       return index_ == other_index;
10228     }
10229 
10230    private:
10231     Iterator(const Iterator& other)
10232         : ParamIteratorInterface<T>(),
10233           base_(other.base_), value_(other.value_), index_(other.index_),
10234           step_(other.step_) {}
10235 
10236     // No implementation - assignment is unsupported.
10237     void operator=(const Iterator& other);
10238 
10239     const ParamGeneratorInterface<T>* const base_;
10240     T value_;
10241     int index_;
10242     const IncrementT step_;
10243   };  // class RangeGenerator::Iterator
10244 
10245   static int CalculateEndIndex(const T& begin,
10246                                const T& end,
10247                                const IncrementT& step) {
10248     int end_index = 0;
10249     for (T i = begin; i < end; i = i + step)
10250       end_index++;
10251     return end_index;
10252   }
10253 
10254   // No implementation - assignment is unsupported.
10255   void operator=(const RangeGenerator& other);
10256 
10257   const T begin_;
10258   const T end_;
10259   const IncrementT step_;
10260   // The index for the end() iterator. All the elements in the generated
10261   // sequence are indexed (0-based) to aid iterator comparison.
10262   const int end_index_;
10263 };  // class RangeGenerator
10264 
10265 
10266 // Generates values from a pair of STL-style iterators. Used in the
10267 // ValuesIn() function. The elements are copied from the source range
10268 // since the source can be located on the stack, and the generator
10269 // is likely to persist beyond that stack frame.
10270 template <typename T>
10271 class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
10272  public:
10273   template <typename ForwardIterator>
10274   ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
10275       : container_(begin, end) {}
10276   virtual ~ValuesInIteratorRangeGenerator() {}
10277 
10278   virtual ParamIteratorInterface<T>* Begin() const {
10279     return new Iterator(this, container_.begin());
10280   }
10281   virtual ParamIteratorInterface<T>* End() const {
10282     return new Iterator(this, container_.end());
10283   }
10284 
10285  private:
10286   typedef typename ::std::vector<T> ContainerType;
10287 
10288   class Iterator : public ParamIteratorInterface<T> {
10289    public:
10290     Iterator(const ParamGeneratorInterface<T>* base,
10291              typename ContainerType::const_iterator iterator)
10292         : base_(base), iterator_(iterator) {}
10293     virtual ~Iterator() {}
10294 
10295     virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10296       return base_;
10297     }
10298     virtual void Advance() {
10299       ++iterator_;
10300       value_.reset();
10301     }
10302     virtual ParamIteratorInterface<T>* Clone() const {
10303       return new Iterator(*this);
10304     }
10305     // We need to use cached value referenced by iterator_ because *iterator_
10306     // can return a temporary object (and of type other then T), so just
10307     // having "return &*iterator_;" doesn't work.
10308     // value_ is updated here and not in Advance() because Advance()
10309     // can advance iterator_ beyond the end of the range, and we cannot
10310     // detect that fact. The client code, on the other hand, is
10311     // responsible for not calling Current() on an out-of-range iterator.
10312     virtual const T* Current() const {
10313       if (value_.get() == NULL)
10314         value_.reset(new T(*iterator_));
10315       return value_.get();
10316     }
10317     virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10318       // Having the same base generator guarantees that the other
10319       // iterator is of the same type and we can downcast.
10320       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10321           << "The program attempted to compare iterators "
10322           << "from different generators." << std::endl;
10323       return iterator_ ==
10324           CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
10325     }
10326 
10327    private:
10328     Iterator(const Iterator& other)
10329           // The explicit constructor call suppresses a false warning
10330           // emitted by gcc when supplied with the -Wextra option.
10331         : ParamIteratorInterface<T>(),
10332           base_(other.base_),
10333           iterator_(other.iterator_) {}
10334 
10335     const ParamGeneratorInterface<T>* const base_;
10336     typename ContainerType::const_iterator iterator_;
10337     // A cached value of *iterator_. We keep it here to allow access by
10338     // pointer in the wrapping iterator's operator->().
10339     // value_ needs to be mutable to be accessed in Current().
10340     // Use of scoped_ptr helps manage cached value's lifetime,
10341     // which is bound by the lifespan of the iterator itself.
10342     mutable scoped_ptr<const T> value_;
10343   };  // class ValuesInIteratorRangeGenerator::Iterator
10344 
10345   // No implementation - assignment is unsupported.
10346   void operator=(const ValuesInIteratorRangeGenerator& other);
10347 
10348   const ContainerType container_;
10349 };  // class ValuesInIteratorRangeGenerator
10350 
10351 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10352 //
10353 // Stores a parameter value and later creates tests parameterized with that
10354 // value.
10355 template <class TestClass>
10356 class ParameterizedTestFactory : public TestFactoryBase {
10357  public:
10358   typedef typename TestClass::ParamType ParamType;
10359   explicit ParameterizedTestFactory(ParamType parameter) :
10360       parameter_(parameter) {}
10361   virtual Test* CreateTest() {
10362     TestClass::SetParam(&parameter_);
10363     return new TestClass();
10364   }
10365 
10366  private:
10367   const ParamType parameter_;
10368 
10369   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
10370 };
10371 
10372 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10373 //
10374 // TestMetaFactoryBase is a base class for meta-factories that create
10375 // test factories for passing into MakeAndRegisterTestInfo function.
10376 template <class ParamType>
10377 class TestMetaFactoryBase {
10378  public:
10379   virtual ~TestMetaFactoryBase() {}
10380 
10381   virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
10382 };
10383 
10384 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10385 //
10386 // TestMetaFactory creates test factories for passing into
10387 // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
10388 // ownership of test factory pointer, same factory object cannot be passed
10389 // into that method twice. But ParameterizedTestCaseInfo is going to call
10390 // it for each Test/Parameter value combination. Thus it needs meta factory
10391 // creator class.
10392 template <class TestCase>
10393 class TestMetaFactory
10394     : public TestMetaFactoryBase<typename TestCase::ParamType> {
10395  public:
10396   typedef typename TestCase::ParamType ParamType;
10397 
10398   TestMetaFactory() {}
10399 
10400   virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
10401     return new ParameterizedTestFactory<TestCase>(parameter);
10402   }
10403 
10404  private:
10405   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
10406 };
10407 
10408 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10409 //
10410 // ParameterizedTestCaseInfoBase is a generic interface
10411 // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
10412 // accumulates test information provided by TEST_P macro invocations
10413 // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
10414 // and uses that information to register all resulting test instances
10415 // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
10416 // a collection of pointers to the ParameterizedTestCaseInfo objects
10417 // and calls RegisterTests() on each of them when asked.
10418 class ParameterizedTestCaseInfoBase {
10419  public:
10420   virtual ~ParameterizedTestCaseInfoBase() {}
10421 
10422   // Base part of test case name for display purposes.
10423   virtual const string& GetTestCaseName() const = 0;
10424   // Test case id to verify identity.
10425   virtual TypeId GetTestCaseTypeId() const = 0;
10426   // UnitTest class invokes this method to register tests in this
10427   // test case right before running them in RUN_ALL_TESTS macro.
10428   // This method should not be called more then once on any single
10429   // instance of a ParameterizedTestCaseInfoBase derived class.
10430   virtual void RegisterTests() = 0;
10431 
10432  protected:
10433   ParameterizedTestCaseInfoBase() {}
10434 
10435  private:
10436   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
10437 };
10438 
10439 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10440 //
10441 // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
10442 // macro invocations for a particular test case and generators
10443 // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
10444 // test case. It registers tests with all values generated by all
10445 // generators when asked.
10446 template <class TestCase>
10447 class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
10448  public:
10449   // ParamType and GeneratorCreationFunc are private types but are required
10450   // for declarations of public methods AddTestPattern() and
10451   // AddTestCaseInstantiation().
10452   typedef typename TestCase::ParamType ParamType;
10453   // A function that returns an instance of appropriate generator type.
10454   typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
10455 
10456   explicit ParameterizedTestCaseInfo(const char* name)
10457       : test_case_name_(name) {}
10458 
10459   // Test case base name for display purposes.
10460   virtual const string& GetTestCaseName() const { return test_case_name_; }
10461   // Test case id to verify identity.
10462   virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
10463   // TEST_P macro uses AddTestPattern() to record information
10464   // about a single test in a LocalTestInfo structure.
10465   // test_case_name is the base name of the test case (without invocation
10466   // prefix). test_base_name is the name of an individual test without
10467   // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
10468   // test case base name and DoBar is test base name.
10469   void AddTestPattern(const char* test_case_name,
10470                       const char* test_base_name,
10471                       TestMetaFactoryBase<ParamType>* meta_factory) {
10472     tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
10473                                                        test_base_name,
10474                                                        meta_factory)));
10475   }
10476   // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
10477   // about a generator.
10478   int AddTestCaseInstantiation(const string& instantiation_name,
10479                                GeneratorCreationFunc* func,
10480                                const char* /* file */,
10481                                int /* line */) {
10482     instantiations_.push_back(::std::make_pair(instantiation_name, func));
10483     return 0;  // Return value used only to run this method in namespace scope.
10484   }
10485   // UnitTest class invokes this method to register tests in this test case
10486   // test cases right before running tests in RUN_ALL_TESTS macro.
10487   // This method should not be called more then once on any single
10488   // instance of a ParameterizedTestCaseInfoBase derived class.
10489   // UnitTest has a guard to prevent from calling this method more then once.
10490   virtual void RegisterTests() {
10491     for (typename TestInfoContainer::iterator test_it = tests_.begin();
10492          test_it != tests_.end(); ++test_it) {
10493       linked_ptr<TestInfo> test_info = *test_it;
10494       for (typename InstantiationContainer::iterator gen_it =
10495                instantiations_.begin(); gen_it != instantiations_.end();
10496                ++gen_it) {
10497         const string& instantiation_name = gen_it->first;
10498         ParamGenerator<ParamType> generator((*gen_it->second)());
10499 
10500         string test_case_name;
10501         if ( !instantiation_name.empty() )
10502           test_case_name = instantiation_name + "/";
10503         test_case_name += test_info->test_case_base_name;
10504 
10505         int i = 0;
10506         for (typename ParamGenerator<ParamType>::iterator param_it =
10507                  generator.begin();
10508              param_it != generator.end(); ++param_it, ++i) {
10509           Message test_name_stream;
10510           test_name_stream << test_info->test_base_name << "/" << i;
10511           MakeAndRegisterTestInfo(
10512               test_case_name.c_str(),
10513               test_name_stream.GetString().c_str(),
10514               NULL,  // No type parameter.
10515               PrintToString(*param_it).c_str(),
10516               GetTestCaseTypeId(),
10517               TestCase::SetUpTestCase,
10518               TestCase::TearDownTestCase,
10519               test_info->test_meta_factory->CreateTestFactory(*param_it));
10520         }  // for param_it
10521       }  // for gen_it
10522     }  // for test_it
10523   }  // RegisterTests
10524 
10525  private:
10526   // LocalTestInfo structure keeps information about a single test registered
10527   // with TEST_P macro.
10528   struct TestInfo {
10529     TestInfo(const char* a_test_case_base_name,
10530              const char* a_test_base_name,
10531              TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
10532         test_case_base_name(a_test_case_base_name),
10533         test_base_name(a_test_base_name),
10534         test_meta_factory(a_test_meta_factory) {}
10535 
10536     const string test_case_base_name;
10537     const string test_base_name;
10538     const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
10539   };
10540   typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
10541   // Keeps pairs of <Instantiation name, Sequence generator creation function>
10542   // received from INSTANTIATE_TEST_CASE_P macros.
10543   typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
10544       InstantiationContainer;
10545 
10546   const string test_case_name_;
10547   TestInfoContainer tests_;
10548   InstantiationContainer instantiations_;
10549 
10550   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
10551 };  // class ParameterizedTestCaseInfo
10552 
10553 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10554 //
10555 // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
10556 // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
10557 // macros use it to locate their corresponding ParameterizedTestCaseInfo
10558 // descriptors.
10559 class ParameterizedTestCaseRegistry {
10560  public:
10561   ParameterizedTestCaseRegistry() {}
10562   ~ParameterizedTestCaseRegistry() {
10563     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10564          it != test_case_infos_.end(); ++it) {
10565       delete *it;
10566     }
10567   }
10568 
10569   // Looks up or creates and returns a structure containing information about
10570   // tests and instantiations of a particular test case.
10571   template <class TestCase>
10572   ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
10573       const char* test_case_name,
10574       const char* file,
10575       int line) {
10576     ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
10577     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10578          it != test_case_infos_.end(); ++it) {
10579       if ((*it)->GetTestCaseName() == test_case_name) {
10580         if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
10581           // Complain about incorrect usage of Google Test facilities
10582           // and terminate the program since we cannot guaranty correct
10583           // test case setup and tear-down in this case.
10584           ReportInvalidTestCaseType(test_case_name,  file, line);
10585           posix::Abort();
10586         } else {
10587           // At this point we are sure that the object we found is of the same
10588           // type we are looking for, so we downcast it to that type
10589           // without further checks.
10590           typed_test_info = CheckedDowncastToActualType<
10591               ParameterizedTestCaseInfo<TestCase> >(*it);
10592         }
10593         break;
10594       }
10595     }
10596     if (typed_test_info == NULL) {
10597       typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
10598       test_case_infos_.push_back(typed_test_info);
10599     }
10600     return typed_test_info;
10601   }
10602   void RegisterTests() {
10603     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10604          it != test_case_infos_.end(); ++it) {
10605       (*it)->RegisterTests();
10606     }
10607   }
10608 
10609  private:
10610   typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
10611 
10612   TestCaseInfoContainer test_case_infos_;
10613 
10614   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
10615 };
10616 
10617 }  // namespace internal
10618 }  // namespace testing
10619 
10620 #endif  //  GTEST_HAS_PARAM_TEST
10621 
10622 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
10623 // This file was GENERATED by command:
10624 //     pump.py gtest-param-util-generated.h.pump
10625 // DO NOT EDIT BY HAND!!!
10626 
10627 // Copyright 2008 Google Inc.
10628 // All Rights Reserved.
10629 //
10630 // Redistribution and use in source and binary forms, with or without
10631 // modification, are permitted provided that the following conditions are
10632 // met:
10633 //
10634 //     * Redistributions of source code must retain the above copyright
10635 // notice, this list of conditions and the following disclaimer.
10636 //     * Redistributions in binary form must reproduce the above
10637 // copyright notice, this list of conditions and the following disclaimer
10638 // in the documentation and/or other materials provided with the
10639 // distribution.
10640 //     * Neither the name of Google Inc. nor the names of its
10641 // contributors may be used to endorse or promote products derived from
10642 // this software without specific prior written permission.
10643 //
10644 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10645 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10646 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10647 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10648 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10649 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10650 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10651 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10652 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10653 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10654 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10655 //
10656 // Author: vladl@google.com (Vlad Losev)
10657 
10658 // Type and function utilities for implementing parameterized tests.
10659 // This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
10660 //
10661 // Currently Google Test supports at most 50 arguments in Values,
10662 // and at most 10 arguments in Combine. Please contact
10663 // googletestframework@googlegroups.com if you need more.
10664 // Please note that the number of arguments to Combine is limited
10665 // by the maximum arity of the implementation of tr1::tuple which is
10666 // currently set at 10.
10667 
10668 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10669 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10670 
10671 // scripts/fuse_gtest.py depends on gtest's own header being #included
10672 // *unconditionally*.  Therefore these #includes cannot be moved
10673 // inside #if GTEST_HAS_PARAM_TEST.
10674 
10675 #if GTEST_HAS_PARAM_TEST
10676 
10677 namespace testing {
10678 
10679 // Forward declarations of ValuesIn(), which is implemented in
10680 // include/gtest/gtest-param-test.h.
10681 template <typename ForwardIterator>
10682 internal::ParamGenerator<
10683   typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
10684 ValuesIn(ForwardIterator begin, ForwardIterator end);
10685 
10686 template <typename T, size_t N>
10687 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
10688 
10689 template <class Container>
10690 internal::ParamGenerator<typename Container::value_type> ValuesIn(
10691     const Container& container);
10692 
10693 namespace internal {
10694 
10695 // Used in the Values() function to provide polymorphic capabilities.
10696 template <typename T1>
10697 class ValueArray1 {
10698  public:
10699   explicit ValueArray1(T1 v1) : v1_(v1) {}
10700 
10701   template <typename T>
10702   operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
10703 
10704  private:
10705   // No implementation - assignment is unsupported.
10706   void operator=(const ValueArray1& other);
10707 
10708   const T1 v1_;
10709 };
10710 
10711 template <typename T1, typename T2>
10712 class ValueArray2 {
10713  public:
10714   ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
10715 
10716   template <typename T>
10717   operator ParamGenerator<T>() const {
10718     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
10719     return ValuesIn(array);
10720   }
10721 
10722  private:
10723   // No implementation - assignment is unsupported.
10724   void operator=(const ValueArray2& other);
10725 
10726   const T1 v1_;
10727   const T2 v2_;
10728 };
10729 
10730 template <typename T1, typename T2, typename T3>
10731 class ValueArray3 {
10732  public:
10733   ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
10734 
10735   template <typename T>
10736   operator ParamGenerator<T>() const {
10737     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10738         static_cast<T>(v3_)};
10739     return ValuesIn(array);
10740   }
10741 
10742  private:
10743   // No implementation - assignment is unsupported.
10744   void operator=(const ValueArray3& other);
10745 
10746   const T1 v1_;
10747   const T2 v2_;
10748   const T3 v3_;
10749 };
10750 
10751 template <typename T1, typename T2, typename T3, typename T4>
10752 class ValueArray4 {
10753  public:
10754   ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
10755       v4_(v4) {}
10756 
10757   template <typename T>
10758   operator ParamGenerator<T>() const {
10759     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10760         static_cast<T>(v3_), static_cast<T>(v4_)};
10761     return ValuesIn(array);
10762   }
10763 
10764  private:
10765   // No implementation - assignment is unsupported.
10766   void operator=(const ValueArray4& other);
10767 
10768   const T1 v1_;
10769   const T2 v2_;
10770   const T3 v3_;
10771   const T4 v4_;
10772 };
10773 
10774 template <typename T1, typename T2, typename T3, typename T4, typename T5>
10775 class ValueArray5 {
10776  public:
10777   ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
10778       v4_(v4), v5_(v5) {}
10779 
10780   template <typename T>
10781   operator ParamGenerator<T>() const {
10782     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10783         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
10784     return ValuesIn(array);
10785   }
10786 
10787  private:
10788   // No implementation - assignment is unsupported.
10789   void operator=(const ValueArray5& other);
10790 
10791   const T1 v1_;
10792   const T2 v2_;
10793   const T3 v3_;
10794   const T4 v4_;
10795   const T5 v5_;
10796 };
10797 
10798 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10799     typename T6>
10800 class ValueArray6 {
10801  public:
10802   ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
10803       v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
10804 
10805   template <typename T>
10806   operator ParamGenerator<T>() const {
10807     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10808         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10809         static_cast<T>(v6_)};
10810     return ValuesIn(array);
10811   }
10812 
10813  private:
10814   // No implementation - assignment is unsupported.
10815   void operator=(const ValueArray6& other);
10816 
10817   const T1 v1_;
10818   const T2 v2_;
10819   const T3 v3_;
10820   const T4 v4_;
10821   const T5 v5_;
10822   const T6 v6_;
10823 };
10824 
10825 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10826     typename T6, typename T7>
10827 class ValueArray7 {
10828  public:
10829   ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
10830       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
10831 
10832   template <typename T>
10833   operator ParamGenerator<T>() const {
10834     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10835         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10836         static_cast<T>(v6_), static_cast<T>(v7_)};
10837     return ValuesIn(array);
10838   }
10839 
10840  private:
10841   // No implementation - assignment is unsupported.
10842   void operator=(const ValueArray7& other);
10843 
10844   const T1 v1_;
10845   const T2 v2_;
10846   const T3 v3_;
10847   const T4 v4_;
10848   const T5 v5_;
10849   const T6 v6_;
10850   const T7 v7_;
10851 };
10852 
10853 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10854     typename T6, typename T7, typename T8>
10855 class ValueArray8 {
10856  public:
10857   ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
10858       T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10859       v8_(v8) {}
10860 
10861   template <typename T>
10862   operator ParamGenerator<T>() const {
10863     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10864         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10865         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
10866     return ValuesIn(array);
10867   }
10868 
10869  private:
10870   // No implementation - assignment is unsupported.
10871   void operator=(const ValueArray8& other);
10872 
10873   const T1 v1_;
10874   const T2 v2_;
10875   const T3 v3_;
10876   const T4 v4_;
10877   const T5 v5_;
10878   const T6 v6_;
10879   const T7 v7_;
10880   const T8 v8_;
10881 };
10882 
10883 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10884     typename T6, typename T7, typename T8, typename T9>
10885 class ValueArray9 {
10886  public:
10887   ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
10888       T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10889       v8_(v8), v9_(v9) {}
10890 
10891   template <typename T>
10892   operator ParamGenerator<T>() const {
10893     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10894         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10895         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10896         static_cast<T>(v9_)};
10897     return ValuesIn(array);
10898   }
10899 
10900  private:
10901   // No implementation - assignment is unsupported.
10902   void operator=(const ValueArray9& other);
10903 
10904   const T1 v1_;
10905   const T2 v2_;
10906   const T3 v3_;
10907   const T4 v4_;
10908   const T5 v5_;
10909   const T6 v6_;
10910   const T7 v7_;
10911   const T8 v8_;
10912   const T9 v9_;
10913 };
10914 
10915 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10916     typename T6, typename T7, typename T8, typename T9, typename T10>
10917 class ValueArray10 {
10918  public:
10919   ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10920       T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10921       v8_(v8), v9_(v9), v10_(v10) {}
10922 
10923   template <typename T>
10924   operator ParamGenerator<T>() const {
10925     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10926         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10927         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10928         static_cast<T>(v9_), static_cast<T>(v10_)};
10929     return ValuesIn(array);
10930   }
10931 
10932  private:
10933   // No implementation - assignment is unsupported.
10934   void operator=(const ValueArray10& other);
10935 
10936   const T1 v1_;
10937   const T2 v2_;
10938   const T3 v3_;
10939   const T4 v4_;
10940   const T5 v5_;
10941   const T6 v6_;
10942   const T7 v7_;
10943   const T8 v8_;
10944   const T9 v9_;
10945   const T10 v10_;
10946 };
10947 
10948 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10949     typename T6, typename T7, typename T8, typename T9, typename T10,
10950     typename T11>
10951 class ValueArray11 {
10952  public:
10953   ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10954       T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
10955       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
10956 
10957   template <typename T>
10958   operator ParamGenerator<T>() const {
10959     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10960         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10961         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10962         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
10963     return ValuesIn(array);
10964   }
10965 
10966  private:
10967   // No implementation - assignment is unsupported.
10968   void operator=(const ValueArray11& other);
10969 
10970   const T1 v1_;
10971   const T2 v2_;
10972   const T3 v3_;
10973   const T4 v4_;
10974   const T5 v5_;
10975   const T6 v6_;
10976   const T7 v7_;
10977   const T8 v8_;
10978   const T9 v9_;
10979   const T10 v10_;
10980   const T11 v11_;
10981 };
10982 
10983 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10984     typename T6, typename T7, typename T8, typename T9, typename T10,
10985     typename T11, typename T12>
10986 class ValueArray12 {
10987  public:
10988   ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10989       T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
10990       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
10991 
10992   template <typename T>
10993   operator ParamGenerator<T>() const {
10994     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10995         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10996         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10997         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
10998         static_cast<T>(v12_)};
10999     return ValuesIn(array);
11000   }
11001 
11002  private:
11003   // No implementation - assignment is unsupported.
11004   void operator=(const ValueArray12& other);
11005 
11006   const T1 v1_;
11007   const T2 v2_;
11008   const T3 v3_;
11009   const T4 v4_;
11010   const T5 v5_;
11011   const T6 v6_;
11012   const T7 v7_;
11013   const T8 v8_;
11014   const T9 v9_;
11015   const T10 v10_;
11016   const T11 v11_;
11017   const T12 v12_;
11018 };
11019 
11020 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11021     typename T6, typename T7, typename T8, typename T9, typename T10,
11022     typename T11, typename T12, typename T13>
11023 class ValueArray13 {
11024  public:
11025   ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11026       T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11027       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11028       v12_(v12), v13_(v13) {}
11029 
11030   template <typename T>
11031   operator ParamGenerator<T>() const {
11032     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11033         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11034         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11035         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11036         static_cast<T>(v12_), static_cast<T>(v13_)};
11037     return ValuesIn(array);
11038   }
11039 
11040  private:
11041   // No implementation - assignment is unsupported.
11042   void operator=(const ValueArray13& other);
11043 
11044   const T1 v1_;
11045   const T2 v2_;
11046   const T3 v3_;
11047   const T4 v4_;
11048   const T5 v5_;
11049   const T6 v6_;
11050   const T7 v7_;
11051   const T8 v8_;
11052   const T9 v9_;
11053   const T10 v10_;
11054   const T11 v11_;
11055   const T12 v12_;
11056   const T13 v13_;
11057 };
11058 
11059 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11060     typename T6, typename T7, typename T8, typename T9, typename T10,
11061     typename T11, typename T12, typename T13, typename T14>
11062 class ValueArray14 {
11063  public:
11064   ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11065       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
11066       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11067       v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
11068 
11069   template <typename T>
11070   operator ParamGenerator<T>() const {
11071     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11072         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11073         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11074         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11075         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
11076     return ValuesIn(array);
11077   }
11078 
11079  private:
11080   // No implementation - assignment is unsupported.
11081   void operator=(const ValueArray14& other);
11082 
11083   const T1 v1_;
11084   const T2 v2_;
11085   const T3 v3_;
11086   const T4 v4_;
11087   const T5 v5_;
11088   const T6 v6_;
11089   const T7 v7_;
11090   const T8 v8_;
11091   const T9 v9_;
11092   const T10 v10_;
11093   const T11 v11_;
11094   const T12 v12_;
11095   const T13 v13_;
11096   const T14 v14_;
11097 };
11098 
11099 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11100     typename T6, typename T7, typename T8, typename T9, typename T10,
11101     typename T11, typename T12, typename T13, typename T14, typename T15>
11102 class ValueArray15 {
11103  public:
11104   ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11105       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
11106       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11107       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
11108 
11109   template <typename T>
11110   operator ParamGenerator<T>() const {
11111     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11112         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11113         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11114         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11115         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11116         static_cast<T>(v15_)};
11117     return ValuesIn(array);
11118   }
11119 
11120  private:
11121   // No implementation - assignment is unsupported.
11122   void operator=(const ValueArray15& other);
11123 
11124   const T1 v1_;
11125   const T2 v2_;
11126   const T3 v3_;
11127   const T4 v4_;
11128   const T5 v5_;
11129   const T6 v6_;
11130   const T7 v7_;
11131   const T8 v8_;
11132   const T9 v9_;
11133   const T10 v10_;
11134   const T11 v11_;
11135   const T12 v12_;
11136   const T13 v13_;
11137   const T14 v14_;
11138   const T15 v15_;
11139 };
11140 
11141 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11142     typename T6, typename T7, typename T8, typename T9, typename T10,
11143     typename T11, typename T12, typename T13, typename T14, typename T15,
11144     typename T16>
11145 class ValueArray16 {
11146  public:
11147   ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11148       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
11149       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11150       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11151       v16_(v16) {}
11152 
11153   template <typename T>
11154   operator ParamGenerator<T>() const {
11155     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11156         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11157         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11158         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11159         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11160         static_cast<T>(v15_), static_cast<T>(v16_)};
11161     return ValuesIn(array);
11162   }
11163 
11164  private:
11165   // No implementation - assignment is unsupported.
11166   void operator=(const ValueArray16& other);
11167 
11168   const T1 v1_;
11169   const T2 v2_;
11170   const T3 v3_;
11171   const T4 v4_;
11172   const T5 v5_;
11173   const T6 v6_;
11174   const T7 v7_;
11175   const T8 v8_;
11176   const T9 v9_;
11177   const T10 v10_;
11178   const T11 v11_;
11179   const T12 v12_;
11180   const T13 v13_;
11181   const T14 v14_;
11182   const T15 v15_;
11183   const T16 v16_;
11184 };
11185 
11186 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11187     typename T6, typename T7, typename T8, typename T9, typename T10,
11188     typename T11, typename T12, typename T13, typename T14, typename T15,
11189     typename T16, typename T17>
11190 class ValueArray17 {
11191  public:
11192   ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11193       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
11194       T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11195       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11196       v15_(v15), v16_(v16), v17_(v17) {}
11197 
11198   template <typename T>
11199   operator ParamGenerator<T>() const {
11200     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11201         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11202         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11203         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11204         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11205         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
11206     return ValuesIn(array);
11207   }
11208 
11209  private:
11210   // No implementation - assignment is unsupported.
11211   void operator=(const ValueArray17& other);
11212 
11213   const T1 v1_;
11214   const T2 v2_;
11215   const T3 v3_;
11216   const T4 v4_;
11217   const T5 v5_;
11218   const T6 v6_;
11219   const T7 v7_;
11220   const T8 v8_;
11221   const T9 v9_;
11222   const T10 v10_;
11223   const T11 v11_;
11224   const T12 v12_;
11225   const T13 v13_;
11226   const T14 v14_;
11227   const T15 v15_;
11228   const T16 v16_;
11229   const T17 v17_;
11230 };
11231 
11232 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11233     typename T6, typename T7, typename T8, typename T9, typename T10,
11234     typename T11, typename T12, typename T13, typename T14, typename T15,
11235     typename T16, typename T17, typename T18>
11236 class ValueArray18 {
11237  public:
11238   ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11239       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11240       T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11241       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11242       v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
11243 
11244   template <typename T>
11245   operator ParamGenerator<T>() const {
11246     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11247         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11248         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11249         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11250         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11251         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11252         static_cast<T>(v18_)};
11253     return ValuesIn(array);
11254   }
11255 
11256  private:
11257   // No implementation - assignment is unsupported.
11258   void operator=(const ValueArray18& other);
11259 
11260   const T1 v1_;
11261   const T2 v2_;
11262   const T3 v3_;
11263   const T4 v4_;
11264   const T5 v5_;
11265   const T6 v6_;
11266   const T7 v7_;
11267   const T8 v8_;
11268   const T9 v9_;
11269   const T10 v10_;
11270   const T11 v11_;
11271   const T12 v12_;
11272   const T13 v13_;
11273   const T14 v14_;
11274   const T15 v15_;
11275   const T16 v16_;
11276   const T17 v17_;
11277   const T18 v18_;
11278 };
11279 
11280 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11281     typename T6, typename T7, typename T8, typename T9, typename T10,
11282     typename T11, typename T12, typename T13, typename T14, typename T15,
11283     typename T16, typename T17, typename T18, typename T19>
11284 class ValueArray19 {
11285  public:
11286   ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11287       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11288       T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11289       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11290       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
11291 
11292   template <typename T>
11293   operator ParamGenerator<T>() const {
11294     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11295         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11296         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11297         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11298         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11299         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11300         static_cast<T>(v18_), static_cast<T>(v19_)};
11301     return ValuesIn(array);
11302   }
11303 
11304  private:
11305   // No implementation - assignment is unsupported.
11306   void operator=(const ValueArray19& other);
11307 
11308   const T1 v1_;
11309   const T2 v2_;
11310   const T3 v3_;
11311   const T4 v4_;
11312   const T5 v5_;
11313   const T6 v6_;
11314   const T7 v7_;
11315   const T8 v8_;
11316   const T9 v9_;
11317   const T10 v10_;
11318   const T11 v11_;
11319   const T12 v12_;
11320   const T13 v13_;
11321   const T14 v14_;
11322   const T15 v15_;
11323   const T16 v16_;
11324   const T17 v17_;
11325   const T18 v18_;
11326   const T19 v19_;
11327 };
11328 
11329 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11330     typename T6, typename T7, typename T8, typename T9, typename T10,
11331     typename T11, typename T12, typename T13, typename T14, typename T15,
11332     typename T16, typename T17, typename T18, typename T19, typename T20>
11333 class ValueArray20 {
11334  public:
11335   ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11336       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11337       T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11338       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11339       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11340       v19_(v19), v20_(v20) {}
11341 
11342   template <typename T>
11343   operator ParamGenerator<T>() const {
11344     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11345         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11346         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11347         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11348         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11349         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11350         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
11351     return ValuesIn(array);
11352   }
11353 
11354  private:
11355   // No implementation - assignment is unsupported.
11356   void operator=(const ValueArray20& other);
11357 
11358   const T1 v1_;
11359   const T2 v2_;
11360   const T3 v3_;
11361   const T4 v4_;
11362   const T5 v5_;
11363   const T6 v6_;
11364   const T7 v7_;
11365   const T8 v8_;
11366   const T9 v9_;
11367   const T10 v10_;
11368   const T11 v11_;
11369   const T12 v12_;
11370   const T13 v13_;
11371   const T14 v14_;
11372   const T15 v15_;
11373   const T16 v16_;
11374   const T17 v17_;
11375   const T18 v18_;
11376   const T19 v19_;
11377   const T20 v20_;
11378 };
11379 
11380 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11381     typename T6, typename T7, typename T8, typename T9, typename T10,
11382     typename T11, typename T12, typename T13, typename T14, typename T15,
11383     typename T16, typename T17, typename T18, typename T19, typename T20,
11384     typename T21>
11385 class ValueArray21 {
11386  public:
11387   ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11388       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11389       T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11390       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11391       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11392       v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
11393 
11394   template <typename T>
11395   operator ParamGenerator<T>() const {
11396     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11397         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11398         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11399         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11400         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11401         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11402         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11403         static_cast<T>(v21_)};
11404     return ValuesIn(array);
11405   }
11406 
11407  private:
11408   // No implementation - assignment is unsupported.
11409   void operator=(const ValueArray21& other);
11410 
11411   const T1 v1_;
11412   const T2 v2_;
11413   const T3 v3_;
11414   const T4 v4_;
11415   const T5 v5_;
11416   const T6 v6_;
11417   const T7 v7_;
11418   const T8 v8_;
11419   const T9 v9_;
11420   const T10 v10_;
11421   const T11 v11_;
11422   const T12 v12_;
11423   const T13 v13_;
11424   const T14 v14_;
11425   const T15 v15_;
11426   const T16 v16_;
11427   const T17 v17_;
11428   const T18 v18_;
11429   const T19 v19_;
11430   const T20 v20_;
11431   const T21 v21_;
11432 };
11433 
11434 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11435     typename T6, typename T7, typename T8, typename T9, typename T10,
11436     typename T11, typename T12, typename T13, typename T14, typename T15,
11437     typename T16, typename T17, typename T18, typename T19, typename T20,
11438     typename T21, typename T22>
11439 class ValueArray22 {
11440  public:
11441   ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11442       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11443       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
11444       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11445       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11446       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
11447 
11448   template <typename T>
11449   operator ParamGenerator<T>() const {
11450     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11451         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11452         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11453         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11454         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11455         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11456         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11457         static_cast<T>(v21_), static_cast<T>(v22_)};
11458     return ValuesIn(array);
11459   }
11460 
11461  private:
11462   // No implementation - assignment is unsupported.
11463   void operator=(const ValueArray22& other);
11464 
11465   const T1 v1_;
11466   const T2 v2_;
11467   const T3 v3_;
11468   const T4 v4_;
11469   const T5 v5_;
11470   const T6 v6_;
11471   const T7 v7_;
11472   const T8 v8_;
11473   const T9 v9_;
11474   const T10 v10_;
11475   const T11 v11_;
11476   const T12 v12_;
11477   const T13 v13_;
11478   const T14 v14_;
11479   const T15 v15_;
11480   const T16 v16_;
11481   const T17 v17_;
11482   const T18 v18_;
11483   const T19 v19_;
11484   const T20 v20_;
11485   const T21 v21_;
11486   const T22 v22_;
11487 };
11488 
11489 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11490     typename T6, typename T7, typename T8, typename T9, typename T10,
11491     typename T11, typename T12, typename T13, typename T14, typename T15,
11492     typename T16, typename T17, typename T18, typename T19, typename T20,
11493     typename T21, typename T22, typename T23>
11494 class ValueArray23 {
11495  public:
11496   ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11497       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11498       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
11499       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11500       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11501       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11502       v23_(v23) {}
11503 
11504   template <typename T>
11505   operator ParamGenerator<T>() const {
11506     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11507         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11508         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11509         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11510         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11511         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11512         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11513         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
11514     return ValuesIn(array);
11515   }
11516 
11517  private:
11518   // No implementation - assignment is unsupported.
11519   void operator=(const ValueArray23& other);
11520 
11521   const T1 v1_;
11522   const T2 v2_;
11523   const T3 v3_;
11524   const T4 v4_;
11525   const T5 v5_;
11526   const T6 v6_;
11527   const T7 v7_;
11528   const T8 v8_;
11529   const T9 v9_;
11530   const T10 v10_;
11531   const T11 v11_;
11532   const T12 v12_;
11533   const T13 v13_;
11534   const T14 v14_;
11535   const T15 v15_;
11536   const T16 v16_;
11537   const T17 v17_;
11538   const T18 v18_;
11539   const T19 v19_;
11540   const T20 v20_;
11541   const T21 v21_;
11542   const T22 v22_;
11543   const T23 v23_;
11544 };
11545 
11546 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11547     typename T6, typename T7, typename T8, typename T9, typename T10,
11548     typename T11, typename T12, typename T13, typename T14, typename T15,
11549     typename T16, typename T17, typename T18, typename T19, typename T20,
11550     typename T21, typename T22, typename T23, typename T24>
11551 class ValueArray24 {
11552  public:
11553   ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11554       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11555       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
11556       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11557       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11558       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
11559       v22_(v22), v23_(v23), v24_(v24) {}
11560 
11561   template <typename T>
11562   operator ParamGenerator<T>() const {
11563     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11564         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11565         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11566         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11567         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11568         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11569         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11570         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11571         static_cast<T>(v24_)};
11572     return ValuesIn(array);
11573   }
11574 
11575  private:
11576   // No implementation - assignment is unsupported.
11577   void operator=(const ValueArray24& other);
11578 
11579   const T1 v1_;
11580   const T2 v2_;
11581   const T3 v3_;
11582   const T4 v4_;
11583   const T5 v5_;
11584   const T6 v6_;
11585   const T7 v7_;
11586   const T8 v8_;
11587   const T9 v9_;
11588   const T10 v10_;
11589   const T11 v11_;
11590   const T12 v12_;
11591   const T13 v13_;
11592   const T14 v14_;
11593   const T15 v15_;
11594   const T16 v16_;
11595   const T17 v17_;
11596   const T18 v18_;
11597   const T19 v19_;
11598   const T20 v20_;
11599   const T21 v21_;
11600   const T22 v22_;
11601   const T23 v23_;
11602   const T24 v24_;
11603 };
11604 
11605 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11606     typename T6, typename T7, typename T8, typename T9, typename T10,
11607     typename T11, typename T12, typename T13, typename T14, typename T15,
11608     typename T16, typename T17, typename T18, typename T19, typename T20,
11609     typename T21, typename T22, typename T23, typename T24, typename T25>
11610 class ValueArray25 {
11611  public:
11612   ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11613       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11614       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
11615       T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11616       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11617       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11618       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
11619 
11620   template <typename T>
11621   operator ParamGenerator<T>() const {
11622     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11623         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11624         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11625         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11626         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11627         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11628         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11629         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11630         static_cast<T>(v24_), static_cast<T>(v25_)};
11631     return ValuesIn(array);
11632   }
11633 
11634  private:
11635   // No implementation - assignment is unsupported.
11636   void operator=(const ValueArray25& other);
11637 
11638   const T1 v1_;
11639   const T2 v2_;
11640   const T3 v3_;
11641   const T4 v4_;
11642   const T5 v5_;
11643   const T6 v6_;
11644   const T7 v7_;
11645   const T8 v8_;
11646   const T9 v9_;
11647   const T10 v10_;
11648   const T11 v11_;
11649   const T12 v12_;
11650   const T13 v13_;
11651   const T14 v14_;
11652   const T15 v15_;
11653   const T16 v16_;
11654   const T17 v17_;
11655   const T18 v18_;
11656   const T19 v19_;
11657   const T20 v20_;
11658   const T21 v21_;
11659   const T22 v22_;
11660   const T23 v23_;
11661   const T24 v24_;
11662   const T25 v25_;
11663 };
11664 
11665 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11666     typename T6, typename T7, typename T8, typename T9, typename T10,
11667     typename T11, typename T12, typename T13, typename T14, typename T15,
11668     typename T16, typename T17, typename T18, typename T19, typename T20,
11669     typename T21, typename T22, typename T23, typename T24, typename T25,
11670     typename T26>
11671 class ValueArray26 {
11672  public:
11673   ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11674       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11675       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11676       T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11677       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11678       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11679       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
11680 
11681   template <typename T>
11682   operator ParamGenerator<T>() const {
11683     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11684         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11685         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11686         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11687         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11688         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11689         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11690         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11691         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
11692     return ValuesIn(array);
11693   }
11694 
11695  private:
11696   // No implementation - assignment is unsupported.
11697   void operator=(const ValueArray26& other);
11698 
11699   const T1 v1_;
11700   const T2 v2_;
11701   const T3 v3_;
11702   const T4 v4_;
11703   const T5 v5_;
11704   const T6 v6_;
11705   const T7 v7_;
11706   const T8 v8_;
11707   const T9 v9_;
11708   const T10 v10_;
11709   const T11 v11_;
11710   const T12 v12_;
11711   const T13 v13_;
11712   const T14 v14_;
11713   const T15 v15_;
11714   const T16 v16_;
11715   const T17 v17_;
11716   const T18 v18_;
11717   const T19 v19_;
11718   const T20 v20_;
11719   const T21 v21_;
11720   const T22 v22_;
11721   const T23 v23_;
11722   const T24 v24_;
11723   const T25 v25_;
11724   const T26 v26_;
11725 };
11726 
11727 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11728     typename T6, typename T7, typename T8, typename T9, typename T10,
11729     typename T11, typename T12, typename T13, typename T14, typename T15,
11730     typename T16, typename T17, typename T18, typename T19, typename T20,
11731     typename T21, typename T22, typename T23, typename T24, typename T25,
11732     typename T26, typename T27>
11733 class ValueArray27 {
11734  public:
11735   ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11736       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11737       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11738       T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11739       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11740       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
11741       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
11742       v26_(v26), v27_(v27) {}
11743 
11744   template <typename T>
11745   operator ParamGenerator<T>() const {
11746     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11747         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11748         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11749         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11750         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11751         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11752         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11753         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11754         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11755         static_cast<T>(v27_)};
11756     return ValuesIn(array);
11757   }
11758 
11759  private:
11760   // No implementation - assignment is unsupported.
11761   void operator=(const ValueArray27& other);
11762 
11763   const T1 v1_;
11764   const T2 v2_;
11765   const T3 v3_;
11766   const T4 v4_;
11767   const T5 v5_;
11768   const T6 v6_;
11769   const T7 v7_;
11770   const T8 v8_;
11771   const T9 v9_;
11772   const T10 v10_;
11773   const T11 v11_;
11774   const T12 v12_;
11775   const T13 v13_;
11776   const T14 v14_;
11777   const T15 v15_;
11778   const T16 v16_;
11779   const T17 v17_;
11780   const T18 v18_;
11781   const T19 v19_;
11782   const T20 v20_;
11783   const T21 v21_;
11784   const T22 v22_;
11785   const T23 v23_;
11786   const T24 v24_;
11787   const T25 v25_;
11788   const T26 v26_;
11789   const T27 v27_;
11790 };
11791 
11792 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11793     typename T6, typename T7, typename T8, typename T9, typename T10,
11794     typename T11, typename T12, typename T13, typename T14, typename T15,
11795     typename T16, typename T17, typename T18, typename T19, typename T20,
11796     typename T21, typename T22, typename T23, typename T24, typename T25,
11797     typename T26, typename T27, typename T28>
11798 class ValueArray28 {
11799  public:
11800   ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11801       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11802       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11803       T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11804       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11805       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11806       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
11807       v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
11808 
11809   template <typename T>
11810   operator ParamGenerator<T>() const {
11811     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11812         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11813         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11814         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11815         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11816         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11817         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11818         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11819         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11820         static_cast<T>(v27_), static_cast<T>(v28_)};
11821     return ValuesIn(array);
11822   }
11823 
11824  private:
11825   // No implementation - assignment is unsupported.
11826   void operator=(const ValueArray28& other);
11827 
11828   const T1 v1_;
11829   const T2 v2_;
11830   const T3 v3_;
11831   const T4 v4_;
11832   const T5 v5_;
11833   const T6 v6_;
11834   const T7 v7_;
11835   const T8 v8_;
11836   const T9 v9_;
11837   const T10 v10_;
11838   const T11 v11_;
11839   const T12 v12_;
11840   const T13 v13_;
11841   const T14 v14_;
11842   const T15 v15_;
11843   const T16 v16_;
11844   const T17 v17_;
11845   const T18 v18_;
11846   const T19 v19_;
11847   const T20 v20_;
11848   const T21 v21_;
11849   const T22 v22_;
11850   const T23 v23_;
11851   const T24 v24_;
11852   const T25 v25_;
11853   const T26 v26_;
11854   const T27 v27_;
11855   const T28 v28_;
11856 };
11857 
11858 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11859     typename T6, typename T7, typename T8, typename T9, typename T10,
11860     typename T11, typename T12, typename T13, typename T14, typename T15,
11861     typename T16, typename T17, typename T18, typename T19, typename T20,
11862     typename T21, typename T22, typename T23, typename T24, typename T25,
11863     typename T26, typename T27, typename T28, typename T29>
11864 class ValueArray29 {
11865  public:
11866   ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11867       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11868       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11869       T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11870       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11871       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11872       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
11873       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
11874 
11875   template <typename T>
11876   operator ParamGenerator<T>() const {
11877     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11878         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11879         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11880         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11881         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11882         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11883         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11884         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11885         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11886         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
11887     return ValuesIn(array);
11888   }
11889 
11890  private:
11891   // No implementation - assignment is unsupported.
11892   void operator=(const ValueArray29& other);
11893 
11894   const T1 v1_;
11895   const T2 v2_;
11896   const T3 v3_;
11897   const T4 v4_;
11898   const T5 v5_;
11899   const T6 v6_;
11900   const T7 v7_;
11901   const T8 v8_;
11902   const T9 v9_;
11903   const T10 v10_;
11904   const T11 v11_;
11905   const T12 v12_;
11906   const T13 v13_;
11907   const T14 v14_;
11908   const T15 v15_;
11909   const T16 v16_;
11910   const T17 v17_;
11911   const T18 v18_;
11912   const T19 v19_;
11913   const T20 v20_;
11914   const T21 v21_;
11915   const T22 v22_;
11916   const T23 v23_;
11917   const T24 v24_;
11918   const T25 v25_;
11919   const T26 v26_;
11920   const T27 v27_;
11921   const T28 v28_;
11922   const T29 v29_;
11923 };
11924 
11925 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11926     typename T6, typename T7, typename T8, typename T9, typename T10,
11927     typename T11, typename T12, typename T13, typename T14, typename T15,
11928     typename T16, typename T17, typename T18, typename T19, typename T20,
11929     typename T21, typename T22, typename T23, typename T24, typename T25,
11930     typename T26, typename T27, typename T28, typename T29, typename T30>
11931 class ValueArray30 {
11932  public:
11933   ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11934       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11935       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11936       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
11937       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11938       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11939       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11940       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
11941       v29_(v29), v30_(v30) {}
11942 
11943   template <typename T>
11944   operator ParamGenerator<T>() const {
11945     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11946         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11947         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11948         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11949         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11950         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11951         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11952         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11953         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11954         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
11955         static_cast<T>(v30_)};
11956     return ValuesIn(array);
11957   }
11958 
11959  private:
11960   // No implementation - assignment is unsupported.
11961   void operator=(const ValueArray30& other);
11962 
11963   const T1 v1_;
11964   const T2 v2_;
11965   const T3 v3_;
11966   const T4 v4_;
11967   const T5 v5_;
11968   const T6 v6_;
11969   const T7 v7_;
11970   const T8 v8_;
11971   const T9 v9_;
11972   const T10 v10_;
11973   const T11 v11_;
11974   const T12 v12_;
11975   const T13 v13_;
11976   const T14 v14_;
11977   const T15 v15_;
11978   const T16 v16_;
11979   const T17 v17_;
11980   const T18 v18_;
11981   const T19 v19_;
11982   const T20 v20_;
11983   const T21 v21_;
11984   const T22 v22_;
11985   const T23 v23_;
11986   const T24 v24_;
11987   const T25 v25_;
11988   const T26 v26_;
11989   const T27 v27_;
11990   const T28 v28_;
11991   const T29 v29_;
11992   const T30 v30_;
11993 };
11994 
11995 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11996     typename T6, typename T7, typename T8, typename T9, typename T10,
11997     typename T11, typename T12, typename T13, typename T14, typename T15,
11998     typename T16, typename T17, typename T18, typename T19, typename T20,
11999     typename T21, typename T22, typename T23, typename T24, typename T25,
12000     typename T26, typename T27, typename T28, typename T29, typename T30,
12001     typename T31>
12002 class ValueArray31 {
12003  public:
12004   ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12005       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12006       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12007       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
12008       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12009       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12010       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12011       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12012       v29_(v29), v30_(v30), v31_(v31) {}
12013 
12014   template <typename T>
12015   operator ParamGenerator<T>() const {
12016     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12017         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12018         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12019         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12020         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12021         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12022         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12023         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12024         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12025         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12026         static_cast<T>(v30_), static_cast<T>(v31_)};
12027     return ValuesIn(array);
12028   }
12029 
12030  private:
12031   // No implementation - assignment is unsupported.
12032   void operator=(const ValueArray31& other);
12033 
12034   const T1 v1_;
12035   const T2 v2_;
12036   const T3 v3_;
12037   const T4 v4_;
12038   const T5 v5_;
12039   const T6 v6_;
12040   const T7 v7_;
12041   const T8 v8_;
12042   const T9 v9_;
12043   const T10 v10_;
12044   const T11 v11_;
12045   const T12 v12_;
12046   const T13 v13_;
12047   const T14 v14_;
12048   const T15 v15_;
12049   const T16 v16_;
12050   const T17 v17_;
12051   const T18 v18_;
12052   const T19 v19_;
12053   const T20 v20_;
12054   const T21 v21_;
12055   const T22 v22_;
12056   const T23 v23_;
12057   const T24 v24_;
12058   const T25 v25_;
12059   const T26 v26_;
12060   const T27 v27_;
12061   const T28 v28_;
12062   const T29 v29_;
12063   const T30 v30_;
12064   const T31 v31_;
12065 };
12066 
12067 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12068     typename T6, typename T7, typename T8, typename T9, typename T10,
12069     typename T11, typename T12, typename T13, typename T14, typename T15,
12070     typename T16, typename T17, typename T18, typename T19, typename T20,
12071     typename T21, typename T22, typename T23, typename T24, typename T25,
12072     typename T26, typename T27, typename T28, typename T29, typename T30,
12073     typename T31, typename T32>
12074 class ValueArray32 {
12075  public:
12076   ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12077       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12078       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12079       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
12080       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12081       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12082       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12083       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12084       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
12085 
12086   template <typename T>
12087   operator ParamGenerator<T>() const {
12088     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12089         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12090         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12091         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12092         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12093         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12094         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12095         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12096         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12097         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12098         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
12099     return ValuesIn(array);
12100   }
12101 
12102  private:
12103   // No implementation - assignment is unsupported.
12104   void operator=(const ValueArray32& other);
12105 
12106   const T1 v1_;
12107   const T2 v2_;
12108   const T3 v3_;
12109   const T4 v4_;
12110   const T5 v5_;
12111   const T6 v6_;
12112   const T7 v7_;
12113   const T8 v8_;
12114   const T9 v9_;
12115   const T10 v10_;
12116   const T11 v11_;
12117   const T12 v12_;
12118   const T13 v13_;
12119   const T14 v14_;
12120   const T15 v15_;
12121   const T16 v16_;
12122   const T17 v17_;
12123   const T18 v18_;
12124   const T19 v19_;
12125   const T20 v20_;
12126   const T21 v21_;
12127   const T22 v22_;
12128   const T23 v23_;
12129   const T24 v24_;
12130   const T25 v25_;
12131   const T26 v26_;
12132   const T27 v27_;
12133   const T28 v28_;
12134   const T29 v29_;
12135   const T30 v30_;
12136   const T31 v31_;
12137   const T32 v32_;
12138 };
12139 
12140 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12141     typename T6, typename T7, typename T8, typename T9, typename T10,
12142     typename T11, typename T12, typename T13, typename T14, typename T15,
12143     typename T16, typename T17, typename T18, typename T19, typename T20,
12144     typename T21, typename T22, typename T23, typename T24, typename T25,
12145     typename T26, typename T27, typename T28, typename T29, typename T30,
12146     typename T31, typename T32, typename T33>
12147 class ValueArray33 {
12148  public:
12149   ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12150       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12151       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12152       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
12153       T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12154       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12155       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12156       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12157       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12158       v33_(v33) {}
12159 
12160   template <typename T>
12161   operator ParamGenerator<T>() const {
12162     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12163         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12164         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12165         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12166         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12167         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12168         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12169         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12170         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12171         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12172         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12173         static_cast<T>(v33_)};
12174     return ValuesIn(array);
12175   }
12176 
12177  private:
12178   // No implementation - assignment is unsupported.
12179   void operator=(const ValueArray33& other);
12180 
12181   const T1 v1_;
12182   const T2 v2_;
12183   const T3 v3_;
12184   const T4 v4_;
12185   const T5 v5_;
12186   const T6 v6_;
12187   const T7 v7_;
12188   const T8 v8_;
12189   const T9 v9_;
12190   const T10 v10_;
12191   const T11 v11_;
12192   const T12 v12_;
12193   const T13 v13_;
12194   const T14 v14_;
12195   const T15 v15_;
12196   const T16 v16_;
12197   const T17 v17_;
12198   const T18 v18_;
12199   const T19 v19_;
12200   const T20 v20_;
12201   const T21 v21_;
12202   const T22 v22_;
12203   const T23 v23_;
12204   const T24 v24_;
12205   const T25 v25_;
12206   const T26 v26_;
12207   const T27 v27_;
12208   const T28 v28_;
12209   const T29 v29_;
12210   const T30 v30_;
12211   const T31 v31_;
12212   const T32 v32_;
12213   const T33 v33_;
12214 };
12215 
12216 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12217     typename T6, typename T7, typename T8, typename T9, typename T10,
12218     typename T11, typename T12, typename T13, typename T14, typename T15,
12219     typename T16, typename T17, typename T18, typename T19, typename T20,
12220     typename T21, typename T22, typename T23, typename T24, typename T25,
12221     typename T26, typename T27, typename T28, typename T29, typename T30,
12222     typename T31, typename T32, typename T33, typename T34>
12223 class ValueArray34 {
12224  public:
12225   ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12226       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12227       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12228       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12229       T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12230       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12231       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12232       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12233       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12234       v33_(v33), v34_(v34) {}
12235 
12236   template <typename T>
12237   operator ParamGenerator<T>() const {
12238     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12239         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12240         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12241         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12242         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12243         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12244         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12245         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12246         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12247         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12248         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12249         static_cast<T>(v33_), static_cast<T>(v34_)};
12250     return ValuesIn(array);
12251   }
12252 
12253  private:
12254   // No implementation - assignment is unsupported.
12255   void operator=(const ValueArray34& other);
12256 
12257   const T1 v1_;
12258   const T2 v2_;
12259   const T3 v3_;
12260   const T4 v4_;
12261   const T5 v5_;
12262   const T6 v6_;
12263   const T7 v7_;
12264   const T8 v8_;
12265   const T9 v9_;
12266   const T10 v10_;
12267   const T11 v11_;
12268   const T12 v12_;
12269   const T13 v13_;
12270   const T14 v14_;
12271   const T15 v15_;
12272   const T16 v16_;
12273   const T17 v17_;
12274   const T18 v18_;
12275   const T19 v19_;
12276   const T20 v20_;
12277   const T21 v21_;
12278   const T22 v22_;
12279   const T23 v23_;
12280   const T24 v24_;
12281   const T25 v25_;
12282   const T26 v26_;
12283   const T27 v27_;
12284   const T28 v28_;
12285   const T29 v29_;
12286   const T30 v30_;
12287   const T31 v31_;
12288   const T32 v32_;
12289   const T33 v33_;
12290   const T34 v34_;
12291 };
12292 
12293 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12294     typename T6, typename T7, typename T8, typename T9, typename T10,
12295     typename T11, typename T12, typename T13, typename T14, typename T15,
12296     typename T16, typename T17, typename T18, typename T19, typename T20,
12297     typename T21, typename T22, typename T23, typename T24, typename T25,
12298     typename T26, typename T27, typename T28, typename T29, typename T30,
12299     typename T31, typename T32, typename T33, typename T34, typename T35>
12300 class ValueArray35 {
12301  public:
12302   ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12303       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12304       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12305       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12306       T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12307       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12308       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12309       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12310       v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12311       v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
12312 
12313   template <typename T>
12314   operator ParamGenerator<T>() const {
12315     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12316         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12317         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12318         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12319         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12320         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12321         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12322         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12323         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12324         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12325         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12326         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
12327     return ValuesIn(array);
12328   }
12329 
12330  private:
12331   // No implementation - assignment is unsupported.
12332   void operator=(const ValueArray35& other);
12333 
12334   const T1 v1_;
12335   const T2 v2_;
12336   const T3 v3_;
12337   const T4 v4_;
12338   const T5 v5_;
12339   const T6 v6_;
12340   const T7 v7_;
12341   const T8 v8_;
12342   const T9 v9_;
12343   const T10 v10_;
12344   const T11 v11_;
12345   const T12 v12_;
12346   const T13 v13_;
12347   const T14 v14_;
12348   const T15 v15_;
12349   const T16 v16_;
12350   const T17 v17_;
12351   const T18 v18_;
12352   const T19 v19_;
12353   const T20 v20_;
12354   const T21 v21_;
12355   const T22 v22_;
12356   const T23 v23_;
12357   const T24 v24_;
12358   const T25 v25_;
12359   const T26 v26_;
12360   const T27 v27_;
12361   const T28 v28_;
12362   const T29 v29_;
12363   const T30 v30_;
12364   const T31 v31_;
12365   const T32 v32_;
12366   const T33 v33_;
12367   const T34 v34_;
12368   const T35 v35_;
12369 };
12370 
12371 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12372     typename T6, typename T7, typename T8, typename T9, typename T10,
12373     typename T11, typename T12, typename T13, typename T14, typename T15,
12374     typename T16, typename T17, typename T18, typename T19, typename T20,
12375     typename T21, typename T22, typename T23, typename T24, typename T25,
12376     typename T26, typename T27, typename T28, typename T29, typename T30,
12377     typename T31, typename T32, typename T33, typename T34, typename T35,
12378     typename T36>
12379 class ValueArray36 {
12380  public:
12381   ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12382       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12383       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12384       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12385       T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12386       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12387       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12388       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
12389       v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
12390       v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
12391 
12392   template <typename T>
12393   operator ParamGenerator<T>() const {
12394     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12395         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12396         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12397         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12398         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12399         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12400         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12401         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12402         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12403         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12404         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12405         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12406         static_cast<T>(v36_)};
12407     return ValuesIn(array);
12408   }
12409 
12410  private:
12411   // No implementation - assignment is unsupported.
12412   void operator=(const ValueArray36& other);
12413 
12414   const T1 v1_;
12415   const T2 v2_;
12416   const T3 v3_;
12417   const T4 v4_;
12418   const T5 v5_;
12419   const T6 v6_;
12420   const T7 v7_;
12421   const T8 v8_;
12422   const T9 v9_;
12423   const T10 v10_;
12424   const T11 v11_;
12425   const T12 v12_;
12426   const T13 v13_;
12427   const T14 v14_;
12428   const T15 v15_;
12429   const T16 v16_;
12430   const T17 v17_;
12431   const T18 v18_;
12432   const T19 v19_;
12433   const T20 v20_;
12434   const T21 v21_;
12435   const T22 v22_;
12436   const T23 v23_;
12437   const T24 v24_;
12438   const T25 v25_;
12439   const T26 v26_;
12440   const T27 v27_;
12441   const T28 v28_;
12442   const T29 v29_;
12443   const T30 v30_;
12444   const T31 v31_;
12445   const T32 v32_;
12446   const T33 v33_;
12447   const T34 v34_;
12448   const T35 v35_;
12449   const T36 v36_;
12450 };
12451 
12452 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12453     typename T6, typename T7, typename T8, typename T9, typename T10,
12454     typename T11, typename T12, typename T13, typename T14, typename T15,
12455     typename T16, typename T17, typename T18, typename T19, typename T20,
12456     typename T21, typename T22, typename T23, typename T24, typename T25,
12457     typename T26, typename T27, typename T28, typename T29, typename T30,
12458     typename T31, typename T32, typename T33, typename T34, typename T35,
12459     typename T36, typename T37>
12460 class ValueArray37 {
12461  public:
12462   ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12463       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12464       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12465       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12466       T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12467       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12468       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
12469       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
12470       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
12471       v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
12472       v36_(v36), v37_(v37) {}
12473 
12474   template <typename T>
12475   operator ParamGenerator<T>() const {
12476     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12477         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12478         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12479         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12480         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12481         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12482         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12483         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12484         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12485         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12486         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12487         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12488         static_cast<T>(v36_), static_cast<T>(v37_)};
12489     return ValuesIn(array);
12490   }
12491 
12492  private:
12493   // No implementation - assignment is unsupported.
12494   void operator=(const ValueArray37& other);
12495 
12496   const T1 v1_;
12497   const T2 v2_;
12498   const T3 v3_;
12499   const T4 v4_;
12500   const T5 v5_;
12501   const T6 v6_;
12502   const T7 v7_;
12503   const T8 v8_;
12504   const T9 v9_;
12505   const T10 v10_;
12506   const T11 v11_;
12507   const T12 v12_;
12508   const T13 v13_;
12509   const T14 v14_;
12510   const T15 v15_;
12511   const T16 v16_;
12512   const T17 v17_;
12513   const T18 v18_;
12514   const T19 v19_;
12515   const T20 v20_;
12516   const T21 v21_;
12517   const T22 v22_;
12518   const T23 v23_;
12519   const T24 v24_;
12520   const T25 v25_;
12521   const T26 v26_;
12522   const T27 v27_;
12523   const T28 v28_;
12524   const T29 v29_;
12525   const T30 v30_;
12526   const T31 v31_;
12527   const T32 v32_;
12528   const T33 v33_;
12529   const T34 v34_;
12530   const T35 v35_;
12531   const T36 v36_;
12532   const T37 v37_;
12533 };
12534 
12535 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12536     typename T6, typename T7, typename T8, typename T9, typename T10,
12537     typename T11, typename T12, typename T13, typename T14, typename T15,
12538     typename T16, typename T17, typename T18, typename T19, typename T20,
12539     typename T21, typename T22, typename T23, typename T24, typename T25,
12540     typename T26, typename T27, typename T28, typename T29, typename T30,
12541     typename T31, typename T32, typename T33, typename T34, typename T35,
12542     typename T36, typename T37, typename T38>
12543 class ValueArray38 {
12544  public:
12545   ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12546       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12547       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12548       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12549       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
12550       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12551       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12552       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12553       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12554       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12555       v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
12556 
12557   template <typename T>
12558   operator ParamGenerator<T>() const {
12559     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12560         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12561         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12562         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12563         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12564         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12565         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12566         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12567         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12568         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12569         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12570         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12571         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
12572     return ValuesIn(array);
12573   }
12574 
12575  private:
12576   // No implementation - assignment is unsupported.
12577   void operator=(const ValueArray38& other);
12578 
12579   const T1 v1_;
12580   const T2 v2_;
12581   const T3 v3_;
12582   const T4 v4_;
12583   const T5 v5_;
12584   const T6 v6_;
12585   const T7 v7_;
12586   const T8 v8_;
12587   const T9 v9_;
12588   const T10 v10_;
12589   const T11 v11_;
12590   const T12 v12_;
12591   const T13 v13_;
12592   const T14 v14_;
12593   const T15 v15_;
12594   const T16 v16_;
12595   const T17 v17_;
12596   const T18 v18_;
12597   const T19 v19_;
12598   const T20 v20_;
12599   const T21 v21_;
12600   const T22 v22_;
12601   const T23 v23_;
12602   const T24 v24_;
12603   const T25 v25_;
12604   const T26 v26_;
12605   const T27 v27_;
12606   const T28 v28_;
12607   const T29 v29_;
12608   const T30 v30_;
12609   const T31 v31_;
12610   const T32 v32_;
12611   const T33 v33_;
12612   const T34 v34_;
12613   const T35 v35_;
12614   const T36 v36_;
12615   const T37 v37_;
12616   const T38 v38_;
12617 };
12618 
12619 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12620     typename T6, typename T7, typename T8, typename T9, typename T10,
12621     typename T11, typename T12, typename T13, typename T14, typename T15,
12622     typename T16, typename T17, typename T18, typename T19, typename T20,
12623     typename T21, typename T22, typename T23, typename T24, typename T25,
12624     typename T26, typename T27, typename T28, typename T29, typename T30,
12625     typename T31, typename T32, typename T33, typename T34, typename T35,
12626     typename T36, typename T37, typename T38, typename T39>
12627 class ValueArray39 {
12628  public:
12629   ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12630       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12631       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12632       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12633       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
12634       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12635       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12636       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12637       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12638       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12639       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
12640 
12641   template <typename T>
12642   operator ParamGenerator<T>() const {
12643     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12644         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12645         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12646         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12647         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12648         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12649         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12650         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12651         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12652         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12653         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12654         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12655         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12656         static_cast<T>(v39_)};
12657     return ValuesIn(array);
12658   }
12659 
12660  private:
12661   // No implementation - assignment is unsupported.
12662   void operator=(const ValueArray39& other);
12663 
12664   const T1 v1_;
12665   const T2 v2_;
12666   const T3 v3_;
12667   const T4 v4_;
12668   const T5 v5_;
12669   const T6 v6_;
12670   const T7 v7_;
12671   const T8 v8_;
12672   const T9 v9_;
12673   const T10 v10_;
12674   const T11 v11_;
12675   const T12 v12_;
12676   const T13 v13_;
12677   const T14 v14_;
12678   const T15 v15_;
12679   const T16 v16_;
12680   const T17 v17_;
12681   const T18 v18_;
12682   const T19 v19_;
12683   const T20 v20_;
12684   const T21 v21_;
12685   const T22 v22_;
12686   const T23 v23_;
12687   const T24 v24_;
12688   const T25 v25_;
12689   const T26 v26_;
12690   const T27 v27_;
12691   const T28 v28_;
12692   const T29 v29_;
12693   const T30 v30_;
12694   const T31 v31_;
12695   const T32 v32_;
12696   const T33 v33_;
12697   const T34 v34_;
12698   const T35 v35_;
12699   const T36 v36_;
12700   const T37 v37_;
12701   const T38 v38_;
12702   const T39 v39_;
12703 };
12704 
12705 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12706     typename T6, typename T7, typename T8, typename T9, typename T10,
12707     typename T11, typename T12, typename T13, typename T14, typename T15,
12708     typename T16, typename T17, typename T18, typename T19, typename T20,
12709     typename T21, typename T22, typename T23, typename T24, typename T25,
12710     typename T26, typename T27, typename T28, typename T29, typename T30,
12711     typename T31, typename T32, typename T33, typename T34, typename T35,
12712     typename T36, typename T37, typename T38, typename T39, typename T40>
12713 class ValueArray40 {
12714  public:
12715   ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12716       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12717       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12718       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12719       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
12720       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12721       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12722       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12723       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12724       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
12725       v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
12726       v40_(v40) {}
12727 
12728   template <typename T>
12729   operator ParamGenerator<T>() const {
12730     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12731         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12732         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12733         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12734         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12735         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12736         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12737         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12738         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12739         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12740         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12741         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12742         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12743         static_cast<T>(v39_), static_cast<T>(v40_)};
12744     return ValuesIn(array);
12745   }
12746 
12747  private:
12748   // No implementation - assignment is unsupported.
12749   void operator=(const ValueArray40& other);
12750 
12751   const T1 v1_;
12752   const T2 v2_;
12753   const T3 v3_;
12754   const T4 v4_;
12755   const T5 v5_;
12756   const T6 v6_;
12757   const T7 v7_;
12758   const T8 v8_;
12759   const T9 v9_;
12760   const T10 v10_;
12761   const T11 v11_;
12762   const T12 v12_;
12763   const T13 v13_;
12764   const T14 v14_;
12765   const T15 v15_;
12766   const T16 v16_;
12767   const T17 v17_;
12768   const T18 v18_;
12769   const T19 v19_;
12770   const T20 v20_;
12771   const T21 v21_;
12772   const T22 v22_;
12773   const T23 v23_;
12774   const T24 v24_;
12775   const T25 v25_;
12776   const T26 v26_;
12777   const T27 v27_;
12778   const T28 v28_;
12779   const T29 v29_;
12780   const T30 v30_;
12781   const T31 v31_;
12782   const T32 v32_;
12783   const T33 v33_;
12784   const T34 v34_;
12785   const T35 v35_;
12786   const T36 v36_;
12787   const T37 v37_;
12788   const T38 v38_;
12789   const T39 v39_;
12790   const T40 v40_;
12791 };
12792 
12793 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12794     typename T6, typename T7, typename T8, typename T9, typename T10,
12795     typename T11, typename T12, typename T13, typename T14, typename T15,
12796     typename T16, typename T17, typename T18, typename T19, typename T20,
12797     typename T21, typename T22, typename T23, typename T24, typename T25,
12798     typename T26, typename T27, typename T28, typename T29, typename T30,
12799     typename T31, typename T32, typename T33, typename T34, typename T35,
12800     typename T36, typename T37, typename T38, typename T39, typename T40,
12801     typename T41>
12802 class ValueArray41 {
12803  public:
12804   ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12805       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12806       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12807       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12808       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
12809       T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12810       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12811       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12812       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12813       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12814       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12815       v39_(v39), v40_(v40), v41_(v41) {}
12816 
12817   template <typename T>
12818   operator ParamGenerator<T>() const {
12819     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12820         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12821         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12822         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12823         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12824         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12825         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12826         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12827         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12828         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12829         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12830         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12831         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12832         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
12833     return ValuesIn(array);
12834   }
12835 
12836  private:
12837   // No implementation - assignment is unsupported.
12838   void operator=(const ValueArray41& other);
12839 
12840   const T1 v1_;
12841   const T2 v2_;
12842   const T3 v3_;
12843   const T4 v4_;
12844   const T5 v5_;
12845   const T6 v6_;
12846   const T7 v7_;
12847   const T8 v8_;
12848   const T9 v9_;
12849   const T10 v10_;
12850   const T11 v11_;
12851   const T12 v12_;
12852   const T13 v13_;
12853   const T14 v14_;
12854   const T15 v15_;
12855   const T16 v16_;
12856   const T17 v17_;
12857   const T18 v18_;
12858   const T19 v19_;
12859   const T20 v20_;
12860   const T21 v21_;
12861   const T22 v22_;
12862   const T23 v23_;
12863   const T24 v24_;
12864   const T25 v25_;
12865   const T26 v26_;
12866   const T27 v27_;
12867   const T28 v28_;
12868   const T29 v29_;
12869   const T30 v30_;
12870   const T31 v31_;
12871   const T32 v32_;
12872   const T33 v33_;
12873   const T34 v34_;
12874   const T35 v35_;
12875   const T36 v36_;
12876   const T37 v37_;
12877   const T38 v38_;
12878   const T39 v39_;
12879   const T40 v40_;
12880   const T41 v41_;
12881 };
12882 
12883 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12884     typename T6, typename T7, typename T8, typename T9, typename T10,
12885     typename T11, typename T12, typename T13, typename T14, typename T15,
12886     typename T16, typename T17, typename T18, typename T19, typename T20,
12887     typename T21, typename T22, typename T23, typename T24, typename T25,
12888     typename T26, typename T27, typename T28, typename T29, typename T30,
12889     typename T31, typename T32, typename T33, typename T34, typename T35,
12890     typename T36, typename T37, typename T38, typename T39, typename T40,
12891     typename T41, typename T42>
12892 class ValueArray42 {
12893  public:
12894   ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12895       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12896       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12897       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12898       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12899       T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12900       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12901       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12902       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12903       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12904       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12905       v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
12906 
12907   template <typename T>
12908   operator ParamGenerator<T>() const {
12909     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12910         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12911         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12912         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12913         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12914         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12915         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12916         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12917         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12918         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12919         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12920         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12921         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12922         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
12923         static_cast<T>(v42_)};
12924     return ValuesIn(array);
12925   }
12926 
12927  private:
12928   // No implementation - assignment is unsupported.
12929   void operator=(const ValueArray42& other);
12930 
12931   const T1 v1_;
12932   const T2 v2_;
12933   const T3 v3_;
12934   const T4 v4_;
12935   const T5 v5_;
12936   const T6 v6_;
12937   const T7 v7_;
12938   const T8 v8_;
12939   const T9 v9_;
12940   const T10 v10_;
12941   const T11 v11_;
12942   const T12 v12_;
12943   const T13 v13_;
12944   const T14 v14_;
12945   const T15 v15_;
12946   const T16 v16_;
12947   const T17 v17_;
12948   const T18 v18_;
12949   const T19 v19_;
12950   const T20 v20_;
12951   const T21 v21_;
12952   const T22 v22_;
12953   const T23 v23_;
12954   const T24 v24_;
12955   const T25 v25_;
12956   const T26 v26_;
12957   const T27 v27_;
12958   const T28 v28_;
12959   const T29 v29_;
12960   const T30 v30_;
12961   const T31 v31_;
12962   const T32 v32_;
12963   const T33 v33_;
12964   const T34 v34_;
12965   const T35 v35_;
12966   const T36 v36_;
12967   const T37 v37_;
12968   const T38 v38_;
12969   const T39 v39_;
12970   const T40 v40_;
12971   const T41 v41_;
12972   const T42 v42_;
12973 };
12974 
12975 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12976     typename T6, typename T7, typename T8, typename T9, typename T10,
12977     typename T11, typename T12, typename T13, typename T14, typename T15,
12978     typename T16, typename T17, typename T18, typename T19, typename T20,
12979     typename T21, typename T22, typename T23, typename T24, typename T25,
12980     typename T26, typename T27, typename T28, typename T29, typename T30,
12981     typename T31, typename T32, typename T33, typename T34, typename T35,
12982     typename T36, typename T37, typename T38, typename T39, typename T40,
12983     typename T41, typename T42, typename T43>
12984 class ValueArray43 {
12985  public:
12986   ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12987       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12988       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12989       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12990       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12991       T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12992       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12993       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12994       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12995       v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12996       v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
12997       v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
12998 
12999   template <typename T>
13000   operator ParamGenerator<T>() const {
13001     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13002         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13003         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13004         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13005         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13006         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13007         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13008         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13009         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13010         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13011         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13012         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13013         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13014         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13015         static_cast<T>(v42_), static_cast<T>(v43_)};
13016     return ValuesIn(array);
13017   }
13018 
13019  private:
13020   // No implementation - assignment is unsupported.
13021   void operator=(const ValueArray43& other);
13022 
13023   const T1 v1_;
13024   const T2 v2_;
13025   const T3 v3_;
13026   const T4 v4_;
13027   const T5 v5_;
13028   const T6 v6_;
13029   const T7 v7_;
13030   const T8 v8_;
13031   const T9 v9_;
13032   const T10 v10_;
13033   const T11 v11_;
13034   const T12 v12_;
13035   const T13 v13_;
13036   const T14 v14_;
13037   const T15 v15_;
13038   const T16 v16_;
13039   const T17 v17_;
13040   const T18 v18_;
13041   const T19 v19_;
13042   const T20 v20_;
13043   const T21 v21_;
13044   const T22 v22_;
13045   const T23 v23_;
13046   const T24 v24_;
13047   const T25 v25_;
13048   const T26 v26_;
13049   const T27 v27_;
13050   const T28 v28_;
13051   const T29 v29_;
13052   const T30 v30_;
13053   const T31 v31_;
13054   const T32 v32_;
13055   const T33 v33_;
13056   const T34 v34_;
13057   const T35 v35_;
13058   const T36 v36_;
13059   const T37 v37_;
13060   const T38 v38_;
13061   const T39 v39_;
13062   const T40 v40_;
13063   const T41 v41_;
13064   const T42 v42_;
13065   const T43 v43_;
13066 };
13067 
13068 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13069     typename T6, typename T7, typename T8, typename T9, typename T10,
13070     typename T11, typename T12, typename T13, typename T14, typename T15,
13071     typename T16, typename T17, typename T18, typename T19, typename T20,
13072     typename T21, typename T22, typename T23, typename T24, typename T25,
13073     typename T26, typename T27, typename T28, typename T29, typename T30,
13074     typename T31, typename T32, typename T33, typename T34, typename T35,
13075     typename T36, typename T37, typename T38, typename T39, typename T40,
13076     typename T41, typename T42, typename T43, typename T44>
13077 class ValueArray44 {
13078  public:
13079   ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13080       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13081       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13082       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13083       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13084       T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
13085       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
13086       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
13087       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
13088       v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
13089       v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
13090       v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
13091       v43_(v43), v44_(v44) {}
13092 
13093   template <typename T>
13094   operator ParamGenerator<T>() const {
13095     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13096         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13097         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13098         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13099         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13100         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13101         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13102         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13103         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13104         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13105         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13106         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13107         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13108         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13109         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
13110     return ValuesIn(array);
13111   }
13112 
13113  private:
13114   // No implementation - assignment is unsupported.
13115   void operator=(const ValueArray44& other);
13116 
13117   const T1 v1_;
13118   const T2 v2_;
13119   const T3 v3_;
13120   const T4 v4_;
13121   const T5 v5_;
13122   const T6 v6_;
13123   const T7 v7_;
13124   const T8 v8_;
13125   const T9 v9_;
13126   const T10 v10_;
13127   const T11 v11_;
13128   const T12 v12_;
13129   const T13 v13_;
13130   const T14 v14_;
13131   const T15 v15_;
13132   const T16 v16_;
13133   const T17 v17_;
13134   const T18 v18_;
13135   const T19 v19_;
13136   const T20 v20_;
13137   const T21 v21_;
13138   const T22 v22_;
13139   const T23 v23_;
13140   const T24 v24_;
13141   const T25 v25_;
13142   const T26 v26_;
13143   const T27 v27_;
13144   const T28 v28_;
13145   const T29 v29_;
13146   const T30 v30_;
13147   const T31 v31_;
13148   const T32 v32_;
13149   const T33 v33_;
13150   const T34 v34_;
13151   const T35 v35_;
13152   const T36 v36_;
13153   const T37 v37_;
13154   const T38 v38_;
13155   const T39 v39_;
13156   const T40 v40_;
13157   const T41 v41_;
13158   const T42 v42_;
13159   const T43 v43_;
13160   const T44 v44_;
13161 };
13162 
13163 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13164     typename T6, typename T7, typename T8, typename T9, typename T10,
13165     typename T11, typename T12, typename T13, typename T14, typename T15,
13166     typename T16, typename T17, typename T18, typename T19, typename T20,
13167     typename T21, typename T22, typename T23, typename T24, typename T25,
13168     typename T26, typename T27, typename T28, typename T29, typename T30,
13169     typename T31, typename T32, typename T33, typename T34, typename T35,
13170     typename T36, typename T37, typename T38, typename T39, typename T40,
13171     typename T41, typename T42, typename T43, typename T44, typename T45>
13172 class ValueArray45 {
13173  public:
13174   ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13175       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13176       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13177       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13178       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13179       T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
13180       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
13181       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
13182       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
13183       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
13184       v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
13185       v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
13186       v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
13187 
13188   template <typename T>
13189   operator ParamGenerator<T>() const {
13190     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13191         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13192         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13193         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13194         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13195         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13196         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13197         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13198         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13199         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13200         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13201         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13202         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13203         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13204         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13205         static_cast<T>(v45_)};
13206     return ValuesIn(array);
13207   }
13208 
13209  private:
13210   // No implementation - assignment is unsupported.
13211   void operator=(const ValueArray45& other);
13212 
13213   const T1 v1_;
13214   const T2 v2_;
13215   const T3 v3_;
13216   const T4 v4_;
13217   const T5 v5_;
13218   const T6 v6_;
13219   const T7 v7_;
13220   const T8 v8_;
13221   const T9 v9_;
13222   const T10 v10_;
13223   const T11 v11_;
13224   const T12 v12_;
13225   const T13 v13_;
13226   const T14 v14_;
13227   const T15 v15_;
13228   const T16 v16_;
13229   const T17 v17_;
13230   const T18 v18_;
13231   const T19 v19_;
13232   const T20 v20_;
13233   const T21 v21_;
13234   const T22 v22_;
13235   const T23 v23_;
13236   const T24 v24_;
13237   const T25 v25_;
13238   const T26 v26_;
13239   const T27 v27_;
13240   const T28 v28_;
13241   const T29 v29_;
13242   const T30 v30_;
13243   const T31 v31_;
13244   const T32 v32_;
13245   const T33 v33_;
13246   const T34 v34_;
13247   const T35 v35_;
13248   const T36 v36_;
13249   const T37 v37_;
13250   const T38 v38_;
13251   const T39 v39_;
13252   const T40 v40_;
13253   const T41 v41_;
13254   const T42 v42_;
13255   const T43 v43_;
13256   const T44 v44_;
13257   const T45 v45_;
13258 };
13259 
13260 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13261     typename T6, typename T7, typename T8, typename T9, typename T10,
13262     typename T11, typename T12, typename T13, typename T14, typename T15,
13263     typename T16, typename T17, typename T18, typename T19, typename T20,
13264     typename T21, typename T22, typename T23, typename T24, typename T25,
13265     typename T26, typename T27, typename T28, typename T29, typename T30,
13266     typename T31, typename T32, typename T33, typename T34, typename T35,
13267     typename T36, typename T37, typename T38, typename T39, typename T40,
13268     typename T41, typename T42, typename T43, typename T44, typename T45,
13269     typename T46>
13270 class ValueArray46 {
13271  public:
13272   ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13273       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13274       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13275       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13276       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13277       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
13278       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13279       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13280       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13281       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13282       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13283       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13284       v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
13285 
13286   template <typename T>
13287   operator ParamGenerator<T>() const {
13288     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13289         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13290         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13291         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13292         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13293         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13294         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13295         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13296         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13297         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13298         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13299         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13300         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13301         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13302         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13303         static_cast<T>(v45_), static_cast<T>(v46_)};
13304     return ValuesIn(array);
13305   }
13306 
13307  private:
13308   // No implementation - assignment is unsupported.
13309   void operator=(const ValueArray46& other);
13310 
13311   const T1 v1_;
13312   const T2 v2_;
13313   const T3 v3_;
13314   const T4 v4_;
13315   const T5 v5_;
13316   const T6 v6_;
13317   const T7 v7_;
13318   const T8 v8_;
13319   const T9 v9_;
13320   const T10 v10_;
13321   const T11 v11_;
13322   const T12 v12_;
13323   const T13 v13_;
13324   const T14 v14_;
13325   const T15 v15_;
13326   const T16 v16_;
13327   const T17 v17_;
13328   const T18 v18_;
13329   const T19 v19_;
13330   const T20 v20_;
13331   const T21 v21_;
13332   const T22 v22_;
13333   const T23 v23_;
13334   const T24 v24_;
13335   const T25 v25_;
13336   const T26 v26_;
13337   const T27 v27_;
13338   const T28 v28_;
13339   const T29 v29_;
13340   const T30 v30_;
13341   const T31 v31_;
13342   const T32 v32_;
13343   const T33 v33_;
13344   const T34 v34_;
13345   const T35 v35_;
13346   const T36 v36_;
13347   const T37 v37_;
13348   const T38 v38_;
13349   const T39 v39_;
13350   const T40 v40_;
13351   const T41 v41_;
13352   const T42 v42_;
13353   const T43 v43_;
13354   const T44 v44_;
13355   const T45 v45_;
13356   const T46 v46_;
13357 };
13358 
13359 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13360     typename T6, typename T7, typename T8, typename T9, typename T10,
13361     typename T11, typename T12, typename T13, typename T14, typename T15,
13362     typename T16, typename T17, typename T18, typename T19, typename T20,
13363     typename T21, typename T22, typename T23, typename T24, typename T25,
13364     typename T26, typename T27, typename T28, typename T29, typename T30,
13365     typename T31, typename T32, typename T33, typename T34, typename T35,
13366     typename T36, typename T37, typename T38, typename T39, typename T40,
13367     typename T41, typename T42, typename T43, typename T44, typename T45,
13368     typename T46, typename T47>
13369 class ValueArray47 {
13370  public:
13371   ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13372       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13373       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13374       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13375       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13376       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
13377       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13378       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13379       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13380       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13381       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13382       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13383       v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
13384       v47_(v47) {}
13385 
13386   template <typename T>
13387   operator ParamGenerator<T>() const {
13388     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13389         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13390         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13391         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13392         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13393         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13394         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13395         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13396         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13397         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13398         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13399         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13400         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13401         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13402         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13403         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
13404     return ValuesIn(array);
13405   }
13406 
13407  private:
13408   // No implementation - assignment is unsupported.
13409   void operator=(const ValueArray47& other);
13410 
13411   const T1 v1_;
13412   const T2 v2_;
13413   const T3 v3_;
13414   const T4 v4_;
13415   const T5 v5_;
13416   const T6 v6_;
13417   const T7 v7_;
13418   const T8 v8_;
13419   const T9 v9_;
13420   const T10 v10_;
13421   const T11 v11_;
13422   const T12 v12_;
13423   const T13 v13_;
13424   const T14 v14_;
13425   const T15 v15_;
13426   const T16 v16_;
13427   const T17 v17_;
13428   const T18 v18_;
13429   const T19 v19_;
13430   const T20 v20_;
13431   const T21 v21_;
13432   const T22 v22_;
13433   const T23 v23_;
13434   const T24 v24_;
13435   const T25 v25_;
13436   const T26 v26_;
13437   const T27 v27_;
13438   const T28 v28_;
13439   const T29 v29_;
13440   const T30 v30_;
13441   const T31 v31_;
13442   const T32 v32_;
13443   const T33 v33_;
13444   const T34 v34_;
13445   const T35 v35_;
13446   const T36 v36_;
13447   const T37 v37_;
13448   const T38 v38_;
13449   const T39 v39_;
13450   const T40 v40_;
13451   const T41 v41_;
13452   const T42 v42_;
13453   const T43 v43_;
13454   const T44 v44_;
13455   const T45 v45_;
13456   const T46 v46_;
13457   const T47 v47_;
13458 };
13459 
13460 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13461     typename T6, typename T7, typename T8, typename T9, typename T10,
13462     typename T11, typename T12, typename T13, typename T14, typename T15,
13463     typename T16, typename T17, typename T18, typename T19, typename T20,
13464     typename T21, typename T22, typename T23, typename T24, typename T25,
13465     typename T26, typename T27, typename T28, typename T29, typename T30,
13466     typename T31, typename T32, typename T33, typename T34, typename T35,
13467     typename T36, typename T37, typename T38, typename T39, typename T40,
13468     typename T41, typename T42, typename T43, typename T44, typename T45,
13469     typename T46, typename T47, typename T48>
13470 class ValueArray48 {
13471  public:
13472   ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13473       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13474       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13475       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13476       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13477       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
13478       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13479       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13480       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13481       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
13482       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
13483       v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
13484       v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
13485       v46_(v46), v47_(v47), v48_(v48) {}
13486 
13487   template <typename T>
13488   operator ParamGenerator<T>() const {
13489     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13490         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13491         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13492         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13493         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13494         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13495         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13496         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13497         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13498         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13499         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13500         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13501         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13502         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13503         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13504         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13505         static_cast<T>(v48_)};
13506     return ValuesIn(array);
13507   }
13508 
13509  private:
13510   // No implementation - assignment is unsupported.
13511   void operator=(const ValueArray48& other);
13512 
13513   const T1 v1_;
13514   const T2 v2_;
13515   const T3 v3_;
13516   const T4 v4_;
13517   const T5 v5_;
13518   const T6 v6_;
13519   const T7 v7_;
13520   const T8 v8_;
13521   const T9 v9_;
13522   const T10 v10_;
13523   const T11 v11_;
13524   const T12 v12_;
13525   const T13 v13_;
13526   const T14 v14_;
13527   const T15 v15_;
13528   const T16 v16_;
13529   const T17 v17_;
13530   const T18 v18_;
13531   const T19 v19_;
13532   const T20 v20_;
13533   const T21 v21_;
13534   const T22 v22_;
13535   const T23 v23_;
13536   const T24 v24_;
13537   const T25 v25_;
13538   const T26 v26_;
13539   const T27 v27_;
13540   const T28 v28_;
13541   const T29 v29_;
13542   const T30 v30_;
13543   const T31 v31_;
13544   const T32 v32_;
13545   const T33 v33_;
13546   const T34 v34_;
13547   const T35 v35_;
13548   const T36 v36_;
13549   const T37 v37_;
13550   const T38 v38_;
13551   const T39 v39_;
13552   const T40 v40_;
13553   const T41 v41_;
13554   const T42 v42_;
13555   const T43 v43_;
13556   const T44 v44_;
13557   const T45 v45_;
13558   const T46 v46_;
13559   const T47 v47_;
13560   const T48 v48_;
13561 };
13562 
13563 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13564     typename T6, typename T7, typename T8, typename T9, typename T10,
13565     typename T11, typename T12, typename T13, typename T14, typename T15,
13566     typename T16, typename T17, typename T18, typename T19, typename T20,
13567     typename T21, typename T22, typename T23, typename T24, typename T25,
13568     typename T26, typename T27, typename T28, typename T29, typename T30,
13569     typename T31, typename T32, typename T33, typename T34, typename T35,
13570     typename T36, typename T37, typename T38, typename T39, typename T40,
13571     typename T41, typename T42, typename T43, typename T44, typename T45,
13572     typename T46, typename T47, typename T48, typename T49>
13573 class ValueArray49 {
13574  public:
13575   ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13576       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13577       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13578       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13579       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13580       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
13581       T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13582       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13583       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13584       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13585       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13586       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13587       v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13588       v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
13589 
13590   template <typename T>
13591   operator ParamGenerator<T>() const {
13592     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13593         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13594         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13595         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13596         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13597         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13598         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13599         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13600         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13601         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13602         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13603         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13604         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13605         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13606         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13607         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13608         static_cast<T>(v48_), static_cast<T>(v49_)};
13609     return ValuesIn(array);
13610   }
13611 
13612  private:
13613   // No implementation - assignment is unsupported.
13614   void operator=(const ValueArray49& other);
13615 
13616   const T1 v1_;
13617   const T2 v2_;
13618   const T3 v3_;
13619   const T4 v4_;
13620   const T5 v5_;
13621   const T6 v6_;
13622   const T7 v7_;
13623   const T8 v8_;
13624   const T9 v9_;
13625   const T10 v10_;
13626   const T11 v11_;
13627   const T12 v12_;
13628   const T13 v13_;
13629   const T14 v14_;
13630   const T15 v15_;
13631   const T16 v16_;
13632   const T17 v17_;
13633   const T18 v18_;
13634   const T19 v19_;
13635   const T20 v20_;
13636   const T21 v21_;
13637   const T22 v22_;
13638   const T23 v23_;
13639   const T24 v24_;
13640   const T25 v25_;
13641   const T26 v26_;
13642   const T27 v27_;
13643   const T28 v28_;
13644   const T29 v29_;
13645   const T30 v30_;
13646   const T31 v31_;
13647   const T32 v32_;
13648   const T33 v33_;
13649   const T34 v34_;
13650   const T35 v35_;
13651   const T36 v36_;
13652   const T37 v37_;
13653   const T38 v38_;
13654   const T39 v39_;
13655   const T40 v40_;
13656   const T41 v41_;
13657   const T42 v42_;
13658   const T43 v43_;
13659   const T44 v44_;
13660   const T45 v45_;
13661   const T46 v46_;
13662   const T47 v47_;
13663   const T48 v48_;
13664   const T49 v49_;
13665 };
13666 
13667 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13668     typename T6, typename T7, typename T8, typename T9, typename T10,
13669     typename T11, typename T12, typename T13, typename T14, typename T15,
13670     typename T16, typename T17, typename T18, typename T19, typename T20,
13671     typename T21, typename T22, typename T23, typename T24, typename T25,
13672     typename T26, typename T27, typename T28, typename T29, typename T30,
13673     typename T31, typename T32, typename T33, typename T34, typename T35,
13674     typename T36, typename T37, typename T38, typename T39, typename T40,
13675     typename T41, typename T42, typename T43, typename T44, typename T45,
13676     typename T46, typename T47, typename T48, typename T49, typename T50>
13677 class ValueArray50 {
13678  public:
13679   ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13680       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13681       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13682       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13683       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13684       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
13685       T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13686       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13687       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13688       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13689       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13690       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13691       v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13692       v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
13693 
13694   template <typename T>
13695   operator ParamGenerator<T>() const {
13696     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13697         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13698         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13699         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13700         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13701         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13702         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13703         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13704         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13705         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13706         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13707         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13708         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13709         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13710         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13711         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13712         static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
13713     return ValuesIn(array);
13714   }
13715 
13716  private:
13717   // No implementation - assignment is unsupported.
13718   void operator=(const ValueArray50& other);
13719 
13720   const T1 v1_;
13721   const T2 v2_;
13722   const T3 v3_;
13723   const T4 v4_;
13724   const T5 v5_;
13725   const T6 v6_;
13726   const T7 v7_;
13727   const T8 v8_;
13728   const T9 v9_;
13729   const T10 v10_;
13730   const T11 v11_;
13731   const T12 v12_;
13732   const T13 v13_;
13733   const T14 v14_;
13734   const T15 v15_;
13735   const T16 v16_;
13736   const T17 v17_;
13737   const T18 v18_;
13738   const T19 v19_;
13739   const T20 v20_;
13740   const T21 v21_;
13741   const T22 v22_;
13742   const T23 v23_;
13743   const T24 v24_;
13744   const T25 v25_;
13745   const T26 v26_;
13746   const T27 v27_;
13747   const T28 v28_;
13748   const T29 v29_;
13749   const T30 v30_;
13750   const T31 v31_;
13751   const T32 v32_;
13752   const T33 v33_;
13753   const T34 v34_;
13754   const T35 v35_;
13755   const T36 v36_;
13756   const T37 v37_;
13757   const T38 v38_;
13758   const T39 v39_;
13759   const T40 v40_;
13760   const T41 v41_;
13761   const T42 v42_;
13762   const T43 v43_;
13763   const T44 v44_;
13764   const T45 v45_;
13765   const T46 v46_;
13766   const T47 v47_;
13767   const T48 v48_;
13768   const T49 v49_;
13769   const T50 v50_;
13770 };
13771 
13772 # if GTEST_HAS_COMBINE
13773 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
13774 //
13775 // Generates values from the Cartesian product of values produced
13776 // by the argument generators.
13777 //
13778 template <typename T1, typename T2>
13779 class CartesianProductGenerator2
13780     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
13781  public:
13782   typedef ::std::tr1::tuple<T1, T2> ParamType;
13783 
13784   CartesianProductGenerator2(const ParamGenerator<T1>& g1,
13785       const ParamGenerator<T2>& g2)
13786       : g1_(g1), g2_(g2) {}
13787   virtual ~CartesianProductGenerator2() {}
13788 
13789   virtual ParamIteratorInterface<ParamType>* Begin() const {
13790     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
13791   }
13792   virtual ParamIteratorInterface<ParamType>* End() const {
13793     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
13794   }
13795 
13796  private:
13797   class Iterator : public ParamIteratorInterface<ParamType> {
13798    public:
13799     Iterator(const ParamGeneratorInterface<ParamType>* base,
13800       const ParamGenerator<T1>& g1,
13801       const typename ParamGenerator<T1>::iterator& current1,
13802       const ParamGenerator<T2>& g2,
13803       const typename ParamGenerator<T2>::iterator& current2)
13804         : base_(base),
13805           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13806           begin2_(g2.begin()), end2_(g2.end()), current2_(current2)    {
13807       ComputeCurrentValue();
13808     }
13809     virtual ~Iterator() {}
13810 
13811     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13812       return base_;
13813     }
13814     // Advance should not be called on beyond-of-range iterators
13815     // so no component iterators must be beyond end of range, either.
13816     virtual void Advance() {
13817       assert(!AtEnd());
13818       ++current2_;
13819       if (current2_ == end2_) {
13820         current2_ = begin2_;
13821         ++current1_;
13822       }
13823       ComputeCurrentValue();
13824     }
13825     virtual ParamIteratorInterface<ParamType>* Clone() const {
13826       return new Iterator(*this);
13827     }
13828     virtual const ParamType* Current() const { return &current_value_; }
13829     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13830       // Having the same base generator guarantees that the other
13831       // iterator is of the same type and we can downcast.
13832       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13833           << "The program attempted to compare iterators "
13834           << "from different generators." << std::endl;
13835       const Iterator* typed_other =
13836           CheckedDowncastToActualType<const Iterator>(&other);
13837       // We must report iterators equal if they both point beyond their
13838       // respective ranges. That can happen in a variety of fashions,
13839       // so we have to consult AtEnd().
13840       return (AtEnd() && typed_other->AtEnd()) ||
13841          (
13842           current1_ == typed_other->current1_ &&
13843           current2_ == typed_other->current2_);
13844     }
13845 
13846    private:
13847     Iterator(const Iterator& other)
13848         : base_(other.base_),
13849         begin1_(other.begin1_),
13850         end1_(other.end1_),
13851         current1_(other.current1_),
13852         begin2_(other.begin2_),
13853         end2_(other.end2_),
13854         current2_(other.current2_) {
13855       ComputeCurrentValue();
13856     }
13857 
13858     void ComputeCurrentValue() {
13859       if (!AtEnd())
13860         current_value_ = ParamType(*current1_, *current2_);
13861     }
13862     bool AtEnd() const {
13863       // We must report iterator past the end of the range when either of the
13864       // component iterators has reached the end of its range.
13865       return
13866           current1_ == end1_ ||
13867           current2_ == end2_;
13868     }
13869 
13870     // No implementation - assignment is unsupported.
13871     void operator=(const Iterator& other);
13872 
13873     const ParamGeneratorInterface<ParamType>* const base_;
13874     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13875     // current[i]_ is the actual traversing iterator.
13876     const typename ParamGenerator<T1>::iterator begin1_;
13877     const typename ParamGenerator<T1>::iterator end1_;
13878     typename ParamGenerator<T1>::iterator current1_;
13879     const typename ParamGenerator<T2>::iterator begin2_;
13880     const typename ParamGenerator<T2>::iterator end2_;
13881     typename ParamGenerator<T2>::iterator current2_;
13882     ParamType current_value_;
13883   };  // class CartesianProductGenerator2::Iterator
13884 
13885   // No implementation - assignment is unsupported.
13886   void operator=(const CartesianProductGenerator2& other);
13887 
13888   const ParamGenerator<T1> g1_;
13889   const ParamGenerator<T2> g2_;
13890 };  // class CartesianProductGenerator2
13891 
13892 
13893 template <typename T1, typename T2, typename T3>
13894 class CartesianProductGenerator3
13895     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
13896  public:
13897   typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
13898 
13899   CartesianProductGenerator3(const ParamGenerator<T1>& g1,
13900       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
13901       : g1_(g1), g2_(g2), g3_(g3) {}
13902   virtual ~CartesianProductGenerator3() {}
13903 
13904   virtual ParamIteratorInterface<ParamType>* Begin() const {
13905     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
13906         g3_.begin());
13907   }
13908   virtual ParamIteratorInterface<ParamType>* End() const {
13909     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
13910   }
13911 
13912  private:
13913   class Iterator : public ParamIteratorInterface<ParamType> {
13914    public:
13915     Iterator(const ParamGeneratorInterface<ParamType>* base,
13916       const ParamGenerator<T1>& g1,
13917       const typename ParamGenerator<T1>::iterator& current1,
13918       const ParamGenerator<T2>& g2,
13919       const typename ParamGenerator<T2>::iterator& current2,
13920       const ParamGenerator<T3>& g3,
13921       const typename ParamGenerator<T3>::iterator& current3)
13922         : base_(base),
13923           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13924           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
13925           begin3_(g3.begin()), end3_(g3.end()), current3_(current3)    {
13926       ComputeCurrentValue();
13927     }
13928     virtual ~Iterator() {}
13929 
13930     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13931       return base_;
13932     }
13933     // Advance should not be called on beyond-of-range iterators
13934     // so no component iterators must be beyond end of range, either.
13935     virtual void Advance() {
13936       assert(!AtEnd());
13937       ++current3_;
13938       if (current3_ == end3_) {
13939         current3_ = begin3_;
13940         ++current2_;
13941       }
13942       if (current2_ == end2_) {
13943         current2_ = begin2_;
13944         ++current1_;
13945       }
13946       ComputeCurrentValue();
13947     }
13948     virtual ParamIteratorInterface<ParamType>* Clone() const {
13949       return new Iterator(*this);
13950     }
13951     virtual const ParamType* Current() const { return &current_value_; }
13952     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13953       // Having the same base generator guarantees that the other
13954       // iterator is of the same type and we can downcast.
13955       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13956           << "The program attempted to compare iterators "
13957           << "from different generators." << std::endl;
13958       const Iterator* typed_other =
13959           CheckedDowncastToActualType<const Iterator>(&other);
13960       // We must report iterators equal if they both point beyond their
13961       // respective ranges. That can happen in a variety of fashions,
13962       // so we have to consult AtEnd().
13963       return (AtEnd() && typed_other->AtEnd()) ||
13964          (
13965           current1_ == typed_other->current1_ &&
13966           current2_ == typed_other->current2_ &&
13967           current3_ == typed_other->current3_);
13968     }
13969 
13970    private:
13971     Iterator(const Iterator& other)
13972         : base_(other.base_),
13973         begin1_(other.begin1_),
13974         end1_(other.end1_),
13975         current1_(other.current1_),
13976         begin2_(other.begin2_),
13977         end2_(other.end2_),
13978         current2_(other.current2_),
13979         begin3_(other.begin3_),
13980         end3_(other.end3_),
13981         current3_(other.current3_) {
13982       ComputeCurrentValue();
13983     }
13984 
13985     void ComputeCurrentValue() {
13986       if (!AtEnd())
13987         current_value_ = ParamType(*current1_, *current2_, *current3_);
13988     }
13989     bool AtEnd() const {
13990       // We must report iterator past the end of the range when either of the
13991       // component iterators has reached the end of its range.
13992       return
13993           current1_ == end1_ ||
13994           current2_ == end2_ ||
13995           current3_ == end3_;
13996     }
13997 
13998     // No implementation - assignment is unsupported.
13999     void operator=(const Iterator& other);
14000 
14001     const ParamGeneratorInterface<ParamType>* const base_;
14002     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14003     // current[i]_ is the actual traversing iterator.
14004     const typename ParamGenerator<T1>::iterator begin1_;
14005     const typename ParamGenerator<T1>::iterator end1_;
14006     typename ParamGenerator<T1>::iterator current1_;
14007     const typename ParamGenerator<T2>::iterator begin2_;
14008     const typename ParamGenerator<T2>::iterator end2_;
14009     typename ParamGenerator<T2>::iterator current2_;
14010     const typename ParamGenerator<T3>::iterator begin3_;
14011     const typename ParamGenerator<T3>::iterator end3_;
14012     typename ParamGenerator<T3>::iterator current3_;
14013     ParamType current_value_;
14014   };  // class CartesianProductGenerator3::Iterator
14015 
14016   // No implementation - assignment is unsupported.
14017   void operator=(const CartesianProductGenerator3& other);
14018 
14019   const ParamGenerator<T1> g1_;
14020   const ParamGenerator<T2> g2_;
14021   const ParamGenerator<T3> g3_;
14022 };  // class CartesianProductGenerator3
14023 
14024 
14025 template <typename T1, typename T2, typename T3, typename T4>
14026 class CartesianProductGenerator4
14027     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
14028  public:
14029   typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
14030 
14031   CartesianProductGenerator4(const ParamGenerator<T1>& g1,
14032       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14033       const ParamGenerator<T4>& g4)
14034       : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
14035   virtual ~CartesianProductGenerator4() {}
14036 
14037   virtual ParamIteratorInterface<ParamType>* Begin() const {
14038     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14039         g3_.begin(), g4_, g4_.begin());
14040   }
14041   virtual ParamIteratorInterface<ParamType>* End() const {
14042     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14043         g4_, g4_.end());
14044   }
14045 
14046  private:
14047   class Iterator : public ParamIteratorInterface<ParamType> {
14048    public:
14049     Iterator(const ParamGeneratorInterface<ParamType>* base,
14050       const ParamGenerator<T1>& g1,
14051       const typename ParamGenerator<T1>::iterator& current1,
14052       const ParamGenerator<T2>& g2,
14053       const typename ParamGenerator<T2>::iterator& current2,
14054       const ParamGenerator<T3>& g3,
14055       const typename ParamGenerator<T3>::iterator& current3,
14056       const ParamGenerator<T4>& g4,
14057       const typename ParamGenerator<T4>::iterator& current4)
14058         : base_(base),
14059           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14060           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14061           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14062           begin4_(g4.begin()), end4_(g4.end()), current4_(current4)    {
14063       ComputeCurrentValue();
14064     }
14065     virtual ~Iterator() {}
14066 
14067     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14068       return base_;
14069     }
14070     // Advance should not be called on beyond-of-range iterators
14071     // so no component iterators must be beyond end of range, either.
14072     virtual void Advance() {
14073       assert(!AtEnd());
14074       ++current4_;
14075       if (current4_ == end4_) {
14076         current4_ = begin4_;
14077         ++current3_;
14078       }
14079       if (current3_ == end3_) {
14080         current3_ = begin3_;
14081         ++current2_;
14082       }
14083       if (current2_ == end2_) {
14084         current2_ = begin2_;
14085         ++current1_;
14086       }
14087       ComputeCurrentValue();
14088     }
14089     virtual ParamIteratorInterface<ParamType>* Clone() const {
14090       return new Iterator(*this);
14091     }
14092     virtual const ParamType* Current() const { return &current_value_; }
14093     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14094       // Having the same base generator guarantees that the other
14095       // iterator is of the same type and we can downcast.
14096       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14097           << "The program attempted to compare iterators "
14098           << "from different generators." << std::endl;
14099       const Iterator* typed_other =
14100           CheckedDowncastToActualType<const Iterator>(&other);
14101       // We must report iterators equal if they both point beyond their
14102       // respective ranges. That can happen in a variety of fashions,
14103       // so we have to consult AtEnd().
14104       return (AtEnd() && typed_other->AtEnd()) ||
14105          (
14106           current1_ == typed_other->current1_ &&
14107           current2_ == typed_other->current2_ &&
14108           current3_ == typed_other->current3_ &&
14109           current4_ == typed_other->current4_);
14110     }
14111 
14112    private:
14113     Iterator(const Iterator& other)
14114         : base_(other.base_),
14115         begin1_(other.begin1_),
14116         end1_(other.end1_),
14117         current1_(other.current1_),
14118         begin2_(other.begin2_),
14119         end2_(other.end2_),
14120         current2_(other.current2_),
14121         begin3_(other.begin3_),
14122         end3_(other.end3_),
14123         current3_(other.current3_),
14124         begin4_(other.begin4_),
14125         end4_(other.end4_),
14126         current4_(other.current4_) {
14127       ComputeCurrentValue();
14128     }
14129 
14130     void ComputeCurrentValue() {
14131       if (!AtEnd())
14132         current_value_ = ParamType(*current1_, *current2_, *current3_,
14133             *current4_);
14134     }
14135     bool AtEnd() const {
14136       // We must report iterator past the end of the range when either of the
14137       // component iterators has reached the end of its range.
14138       return
14139           current1_ == end1_ ||
14140           current2_ == end2_ ||
14141           current3_ == end3_ ||
14142           current4_ == end4_;
14143     }
14144 
14145     // No implementation - assignment is unsupported.
14146     void operator=(const Iterator& other);
14147 
14148     const ParamGeneratorInterface<ParamType>* const base_;
14149     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14150     // current[i]_ is the actual traversing iterator.
14151     const typename ParamGenerator<T1>::iterator begin1_;
14152     const typename ParamGenerator<T1>::iterator end1_;
14153     typename ParamGenerator<T1>::iterator current1_;
14154     const typename ParamGenerator<T2>::iterator begin2_;
14155     const typename ParamGenerator<T2>::iterator end2_;
14156     typename ParamGenerator<T2>::iterator current2_;
14157     const typename ParamGenerator<T3>::iterator begin3_;
14158     const typename ParamGenerator<T3>::iterator end3_;
14159     typename ParamGenerator<T3>::iterator current3_;
14160     const typename ParamGenerator<T4>::iterator begin4_;
14161     const typename ParamGenerator<T4>::iterator end4_;
14162     typename ParamGenerator<T4>::iterator current4_;
14163     ParamType current_value_;
14164   };  // class CartesianProductGenerator4::Iterator
14165 
14166   // No implementation - assignment is unsupported.
14167   void operator=(const CartesianProductGenerator4& other);
14168 
14169   const ParamGenerator<T1> g1_;
14170   const ParamGenerator<T2> g2_;
14171   const ParamGenerator<T3> g3_;
14172   const ParamGenerator<T4> g4_;
14173 };  // class CartesianProductGenerator4
14174 
14175 
14176 template <typename T1, typename T2, typename T3, typename T4, typename T5>
14177 class CartesianProductGenerator5
14178     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
14179  public:
14180   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
14181 
14182   CartesianProductGenerator5(const ParamGenerator<T1>& g1,
14183       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14184       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
14185       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
14186   virtual ~CartesianProductGenerator5() {}
14187 
14188   virtual ParamIteratorInterface<ParamType>* Begin() const {
14189     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14190         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
14191   }
14192   virtual ParamIteratorInterface<ParamType>* End() const {
14193     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14194         g4_, g4_.end(), g5_, g5_.end());
14195   }
14196 
14197  private:
14198   class Iterator : public ParamIteratorInterface<ParamType> {
14199    public:
14200     Iterator(const ParamGeneratorInterface<ParamType>* base,
14201       const ParamGenerator<T1>& g1,
14202       const typename ParamGenerator<T1>::iterator& current1,
14203       const ParamGenerator<T2>& g2,
14204       const typename ParamGenerator<T2>::iterator& current2,
14205       const ParamGenerator<T3>& g3,
14206       const typename ParamGenerator<T3>::iterator& current3,
14207       const ParamGenerator<T4>& g4,
14208       const typename ParamGenerator<T4>::iterator& current4,
14209       const ParamGenerator<T5>& g5,
14210       const typename ParamGenerator<T5>::iterator& current5)
14211         : base_(base),
14212           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14213           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14214           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14215           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14216           begin5_(g5.begin()), end5_(g5.end()), current5_(current5)    {
14217       ComputeCurrentValue();
14218     }
14219     virtual ~Iterator() {}
14220 
14221     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14222       return base_;
14223     }
14224     // Advance should not be called on beyond-of-range iterators
14225     // so no component iterators must be beyond end of range, either.
14226     virtual void Advance() {
14227       assert(!AtEnd());
14228       ++current5_;
14229       if (current5_ == end5_) {
14230         current5_ = begin5_;
14231         ++current4_;
14232       }
14233       if (current4_ == end4_) {
14234         current4_ = begin4_;
14235         ++current3_;
14236       }
14237       if (current3_ == end3_) {
14238         current3_ = begin3_;
14239         ++current2_;
14240       }
14241       if (current2_ == end2_) {
14242         current2_ = begin2_;
14243         ++current1_;
14244       }
14245       ComputeCurrentValue();
14246     }
14247     virtual ParamIteratorInterface<ParamType>* Clone() const {
14248       return new Iterator(*this);
14249     }
14250     virtual const ParamType* Current() const { return &current_value_; }
14251     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14252       // Having the same base generator guarantees that the other
14253       // iterator is of the same type and we can downcast.
14254       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14255           << "The program attempted to compare iterators "
14256           << "from different generators." << std::endl;
14257       const Iterator* typed_other =
14258           CheckedDowncastToActualType<const Iterator>(&other);
14259       // We must report iterators equal if they both point beyond their
14260       // respective ranges. That can happen in a variety of fashions,
14261       // so we have to consult AtEnd().
14262       return (AtEnd() && typed_other->AtEnd()) ||
14263          (
14264           current1_ == typed_other->current1_ &&
14265           current2_ == typed_other->current2_ &&
14266           current3_ == typed_other->current3_ &&
14267           current4_ == typed_other->current4_ &&
14268           current5_ == typed_other->current5_);
14269     }
14270 
14271    private:
14272     Iterator(const Iterator& other)
14273         : base_(other.base_),
14274         begin1_(other.begin1_),
14275         end1_(other.end1_),
14276         current1_(other.current1_),
14277         begin2_(other.begin2_),
14278         end2_(other.end2_),
14279         current2_(other.current2_),
14280         begin3_(other.begin3_),
14281         end3_(other.end3_),
14282         current3_(other.current3_),
14283         begin4_(other.begin4_),
14284         end4_(other.end4_),
14285         current4_(other.current4_),
14286         begin5_(other.begin5_),
14287         end5_(other.end5_),
14288         current5_(other.current5_) {
14289       ComputeCurrentValue();
14290     }
14291 
14292     void ComputeCurrentValue() {
14293       if (!AtEnd())
14294         current_value_ = ParamType(*current1_, *current2_, *current3_,
14295             *current4_, *current5_);
14296     }
14297     bool AtEnd() const {
14298       // We must report iterator past the end of the range when either of the
14299       // component iterators has reached the end of its range.
14300       return
14301           current1_ == end1_ ||
14302           current2_ == end2_ ||
14303           current3_ == end3_ ||
14304           current4_ == end4_ ||
14305           current5_ == end5_;
14306     }
14307 
14308     // No implementation - assignment is unsupported.
14309     void operator=(const Iterator& other);
14310 
14311     const ParamGeneratorInterface<ParamType>* const base_;
14312     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14313     // current[i]_ is the actual traversing iterator.
14314     const typename ParamGenerator<T1>::iterator begin1_;
14315     const typename ParamGenerator<T1>::iterator end1_;
14316     typename ParamGenerator<T1>::iterator current1_;
14317     const typename ParamGenerator<T2>::iterator begin2_;
14318     const typename ParamGenerator<T2>::iterator end2_;
14319     typename ParamGenerator<T2>::iterator current2_;
14320     const typename ParamGenerator<T3>::iterator begin3_;
14321     const typename ParamGenerator<T3>::iterator end3_;
14322     typename ParamGenerator<T3>::iterator current3_;
14323     const typename ParamGenerator<T4>::iterator begin4_;
14324     const typename ParamGenerator<T4>::iterator end4_;
14325     typename ParamGenerator<T4>::iterator current4_;
14326     const typename ParamGenerator<T5>::iterator begin5_;
14327     const typename ParamGenerator<T5>::iterator end5_;
14328     typename ParamGenerator<T5>::iterator current5_;
14329     ParamType current_value_;
14330   };  // class CartesianProductGenerator5::Iterator
14331 
14332   // No implementation - assignment is unsupported.
14333   void operator=(const CartesianProductGenerator5& other);
14334 
14335   const ParamGenerator<T1> g1_;
14336   const ParamGenerator<T2> g2_;
14337   const ParamGenerator<T3> g3_;
14338   const ParamGenerator<T4> g4_;
14339   const ParamGenerator<T5> g5_;
14340 };  // class CartesianProductGenerator5
14341 
14342 
14343 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14344     typename T6>
14345 class CartesianProductGenerator6
14346     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
14347         T6> > {
14348  public:
14349   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
14350 
14351   CartesianProductGenerator6(const ParamGenerator<T1>& g1,
14352       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14353       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14354       const ParamGenerator<T6>& g6)
14355       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
14356   virtual ~CartesianProductGenerator6() {}
14357 
14358   virtual ParamIteratorInterface<ParamType>* Begin() const {
14359     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14360         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
14361   }
14362   virtual ParamIteratorInterface<ParamType>* End() const {
14363     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14364         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
14365   }
14366 
14367  private:
14368   class Iterator : public ParamIteratorInterface<ParamType> {
14369    public:
14370     Iterator(const ParamGeneratorInterface<ParamType>* base,
14371       const ParamGenerator<T1>& g1,
14372       const typename ParamGenerator<T1>::iterator& current1,
14373       const ParamGenerator<T2>& g2,
14374       const typename ParamGenerator<T2>::iterator& current2,
14375       const ParamGenerator<T3>& g3,
14376       const typename ParamGenerator<T3>::iterator& current3,
14377       const ParamGenerator<T4>& g4,
14378       const typename ParamGenerator<T4>::iterator& current4,
14379       const ParamGenerator<T5>& g5,
14380       const typename ParamGenerator<T5>::iterator& current5,
14381       const ParamGenerator<T6>& g6,
14382       const typename ParamGenerator<T6>::iterator& current6)
14383         : base_(base),
14384           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14385           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14386           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14387           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14388           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14389           begin6_(g6.begin()), end6_(g6.end()), current6_(current6)    {
14390       ComputeCurrentValue();
14391     }
14392     virtual ~Iterator() {}
14393 
14394     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14395       return base_;
14396     }
14397     // Advance should not be called on beyond-of-range iterators
14398     // so no component iterators must be beyond end of range, either.
14399     virtual void Advance() {
14400       assert(!AtEnd());
14401       ++current6_;
14402       if (current6_ == end6_) {
14403         current6_ = begin6_;
14404         ++current5_;
14405       }
14406       if (current5_ == end5_) {
14407         current5_ = begin5_;
14408         ++current4_;
14409       }
14410       if (current4_ == end4_) {
14411         current4_ = begin4_;
14412         ++current3_;
14413       }
14414       if (current3_ == end3_) {
14415         current3_ = begin3_;
14416         ++current2_;
14417       }
14418       if (current2_ == end2_) {
14419         current2_ = begin2_;
14420         ++current1_;
14421       }
14422       ComputeCurrentValue();
14423     }
14424     virtual ParamIteratorInterface<ParamType>* Clone() const {
14425       return new Iterator(*this);
14426     }
14427     virtual const ParamType* Current() const { return &current_value_; }
14428     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14429       // Having the same base generator guarantees that the other
14430       // iterator is of the same type and we can downcast.
14431       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14432           << "The program attempted to compare iterators "
14433           << "from different generators." << std::endl;
14434       const Iterator* typed_other =
14435           CheckedDowncastToActualType<const Iterator>(&other);
14436       // We must report iterators equal if they both point beyond their
14437       // respective ranges. That can happen in a variety of fashions,
14438       // so we have to consult AtEnd().
14439       return (AtEnd() && typed_other->AtEnd()) ||
14440          (
14441           current1_ == typed_other->current1_ &&
14442           current2_ == typed_other->current2_ &&
14443           current3_ == typed_other->current3_ &&
14444           current4_ == typed_other->current4_ &&
14445           current5_ == typed_other->current5_ &&
14446           current6_ == typed_other->current6_);
14447     }
14448 
14449    private:
14450     Iterator(const Iterator& other)
14451         : base_(other.base_),
14452         begin1_(other.begin1_),
14453         end1_(other.end1_),
14454         current1_(other.current1_),
14455         begin2_(other.begin2_),
14456         end2_(other.end2_),
14457         current2_(other.current2_),
14458         begin3_(other.begin3_),
14459         end3_(other.end3_),
14460         current3_(other.current3_),
14461         begin4_(other.begin4_),
14462         end4_(other.end4_),
14463         current4_(other.current4_),
14464         begin5_(other.begin5_),
14465         end5_(other.end5_),
14466         current5_(other.current5_),
14467         begin6_(other.begin6_),
14468         end6_(other.end6_),
14469         current6_(other.current6_) {
14470       ComputeCurrentValue();
14471     }
14472 
14473     void ComputeCurrentValue() {
14474       if (!AtEnd())
14475         current_value_ = ParamType(*current1_, *current2_, *current3_,
14476             *current4_, *current5_, *current6_);
14477     }
14478     bool AtEnd() const {
14479       // We must report iterator past the end of the range when either of the
14480       // component iterators has reached the end of its range.
14481       return
14482           current1_ == end1_ ||
14483           current2_ == end2_ ||
14484           current3_ == end3_ ||
14485           current4_ == end4_ ||
14486           current5_ == end5_ ||
14487           current6_ == end6_;
14488     }
14489 
14490     // No implementation - assignment is unsupported.
14491     void operator=(const Iterator& other);
14492 
14493     const ParamGeneratorInterface<ParamType>* const base_;
14494     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14495     // current[i]_ is the actual traversing iterator.
14496     const typename ParamGenerator<T1>::iterator begin1_;
14497     const typename ParamGenerator<T1>::iterator end1_;
14498     typename ParamGenerator<T1>::iterator current1_;
14499     const typename ParamGenerator<T2>::iterator begin2_;
14500     const typename ParamGenerator<T2>::iterator end2_;
14501     typename ParamGenerator<T2>::iterator current2_;
14502     const typename ParamGenerator<T3>::iterator begin3_;
14503     const typename ParamGenerator<T3>::iterator end3_;
14504     typename ParamGenerator<T3>::iterator current3_;
14505     const typename ParamGenerator<T4>::iterator begin4_;
14506     const typename ParamGenerator<T4>::iterator end4_;
14507     typename ParamGenerator<T4>::iterator current4_;
14508     const typename ParamGenerator<T5>::iterator begin5_;
14509     const typename ParamGenerator<T5>::iterator end5_;
14510     typename ParamGenerator<T5>::iterator current5_;
14511     const typename ParamGenerator<T6>::iterator begin6_;
14512     const typename ParamGenerator<T6>::iterator end6_;
14513     typename ParamGenerator<T6>::iterator current6_;
14514     ParamType current_value_;
14515   };  // class CartesianProductGenerator6::Iterator
14516 
14517   // No implementation - assignment is unsupported.
14518   void operator=(const CartesianProductGenerator6& other);
14519 
14520   const ParamGenerator<T1> g1_;
14521   const ParamGenerator<T2> g2_;
14522   const ParamGenerator<T3> g3_;
14523   const ParamGenerator<T4> g4_;
14524   const ParamGenerator<T5> g5_;
14525   const ParamGenerator<T6> g6_;
14526 };  // class CartesianProductGenerator6
14527 
14528 
14529 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14530     typename T6, typename T7>
14531 class CartesianProductGenerator7
14532     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14533         T7> > {
14534  public:
14535   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
14536 
14537   CartesianProductGenerator7(const ParamGenerator<T1>& g1,
14538       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14539       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14540       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
14541       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
14542   virtual ~CartesianProductGenerator7() {}
14543 
14544   virtual ParamIteratorInterface<ParamType>* Begin() const {
14545     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14546         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14547         g7_.begin());
14548   }
14549   virtual ParamIteratorInterface<ParamType>* End() const {
14550     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14551         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
14552   }
14553 
14554  private:
14555   class Iterator : public ParamIteratorInterface<ParamType> {
14556    public:
14557     Iterator(const ParamGeneratorInterface<ParamType>* base,
14558       const ParamGenerator<T1>& g1,
14559       const typename ParamGenerator<T1>::iterator& current1,
14560       const ParamGenerator<T2>& g2,
14561       const typename ParamGenerator<T2>::iterator& current2,
14562       const ParamGenerator<T3>& g3,
14563       const typename ParamGenerator<T3>::iterator& current3,
14564       const ParamGenerator<T4>& g4,
14565       const typename ParamGenerator<T4>::iterator& current4,
14566       const ParamGenerator<T5>& g5,
14567       const typename ParamGenerator<T5>::iterator& current5,
14568       const ParamGenerator<T6>& g6,
14569       const typename ParamGenerator<T6>::iterator& current6,
14570       const ParamGenerator<T7>& g7,
14571       const typename ParamGenerator<T7>::iterator& current7)
14572         : base_(base),
14573           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14574           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14575           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14576           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14577           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14578           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14579           begin7_(g7.begin()), end7_(g7.end()), current7_(current7)    {
14580       ComputeCurrentValue();
14581     }
14582     virtual ~Iterator() {}
14583 
14584     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14585       return base_;
14586     }
14587     // Advance should not be called on beyond-of-range iterators
14588     // so no component iterators must be beyond end of range, either.
14589     virtual void Advance() {
14590       assert(!AtEnd());
14591       ++current7_;
14592       if (current7_ == end7_) {
14593         current7_ = begin7_;
14594         ++current6_;
14595       }
14596       if (current6_ == end6_) {
14597         current6_ = begin6_;
14598         ++current5_;
14599       }
14600       if (current5_ == end5_) {
14601         current5_ = begin5_;
14602         ++current4_;
14603       }
14604       if (current4_ == end4_) {
14605         current4_ = begin4_;
14606         ++current3_;
14607       }
14608       if (current3_ == end3_) {
14609         current3_ = begin3_;
14610         ++current2_;
14611       }
14612       if (current2_ == end2_) {
14613         current2_ = begin2_;
14614         ++current1_;
14615       }
14616       ComputeCurrentValue();
14617     }
14618     virtual ParamIteratorInterface<ParamType>* Clone() const {
14619       return new Iterator(*this);
14620     }
14621     virtual const ParamType* Current() const { return &current_value_; }
14622     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14623       // Having the same base generator guarantees that the other
14624       // iterator is of the same type and we can downcast.
14625       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14626           << "The program attempted to compare iterators "
14627           << "from different generators." << std::endl;
14628       const Iterator* typed_other =
14629           CheckedDowncastToActualType<const Iterator>(&other);
14630       // We must report iterators equal if they both point beyond their
14631       // respective ranges. That can happen in a variety of fashions,
14632       // so we have to consult AtEnd().
14633       return (AtEnd() && typed_other->AtEnd()) ||
14634          (
14635           current1_ == typed_other->current1_ &&
14636           current2_ == typed_other->current2_ &&
14637           current3_ == typed_other->current3_ &&
14638           current4_ == typed_other->current4_ &&
14639           current5_ == typed_other->current5_ &&
14640           current6_ == typed_other->current6_ &&
14641           current7_ == typed_other->current7_);
14642     }
14643 
14644    private:
14645     Iterator(const Iterator& other)
14646         : base_(other.base_),
14647         begin1_(other.begin1_),
14648         end1_(other.end1_),
14649         current1_(other.current1_),
14650         begin2_(other.begin2_),
14651         end2_(other.end2_),
14652         current2_(other.current2_),
14653         begin3_(other.begin3_),
14654         end3_(other.end3_),
14655         current3_(other.current3_),
14656         begin4_(other.begin4_),
14657         end4_(other.end4_),
14658         current4_(other.current4_),
14659         begin5_(other.begin5_),
14660         end5_(other.end5_),
14661         current5_(other.current5_),
14662         begin6_(other.begin6_),
14663         end6_(other.end6_),
14664         current6_(other.current6_),
14665         begin7_(other.begin7_),
14666         end7_(other.end7_),
14667         current7_(other.current7_) {
14668       ComputeCurrentValue();
14669     }
14670 
14671     void ComputeCurrentValue() {
14672       if (!AtEnd())
14673         current_value_ = ParamType(*current1_, *current2_, *current3_,
14674             *current4_, *current5_, *current6_, *current7_);
14675     }
14676     bool AtEnd() const {
14677       // We must report iterator past the end of the range when either of the
14678       // component iterators has reached the end of its range.
14679       return
14680           current1_ == end1_ ||
14681           current2_ == end2_ ||
14682           current3_ == end3_ ||
14683           current4_ == end4_ ||
14684           current5_ == end5_ ||
14685           current6_ == end6_ ||
14686           current7_ == end7_;
14687     }
14688 
14689     // No implementation - assignment is unsupported.
14690     void operator=(const Iterator& other);
14691 
14692     const ParamGeneratorInterface<ParamType>* const base_;
14693     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14694     // current[i]_ is the actual traversing iterator.
14695     const typename ParamGenerator<T1>::iterator begin1_;
14696     const typename ParamGenerator<T1>::iterator end1_;
14697     typename ParamGenerator<T1>::iterator current1_;
14698     const typename ParamGenerator<T2>::iterator begin2_;
14699     const typename ParamGenerator<T2>::iterator end2_;
14700     typename ParamGenerator<T2>::iterator current2_;
14701     const typename ParamGenerator<T3>::iterator begin3_;
14702     const typename ParamGenerator<T3>::iterator end3_;
14703     typename ParamGenerator<T3>::iterator current3_;
14704     const typename ParamGenerator<T4>::iterator begin4_;
14705     const typename ParamGenerator<T4>::iterator end4_;
14706     typename ParamGenerator<T4>::iterator current4_;
14707     const typename ParamGenerator<T5>::iterator begin5_;
14708     const typename ParamGenerator<T5>::iterator end5_;
14709     typename ParamGenerator<T5>::iterator current5_;
14710     const typename ParamGenerator<T6>::iterator begin6_;
14711     const typename ParamGenerator<T6>::iterator end6_;
14712     typename ParamGenerator<T6>::iterator current6_;
14713     const typename ParamGenerator<T7>::iterator begin7_;
14714     const typename ParamGenerator<T7>::iterator end7_;
14715     typename ParamGenerator<T7>::iterator current7_;
14716     ParamType current_value_;
14717   };  // class CartesianProductGenerator7::Iterator
14718 
14719   // No implementation - assignment is unsupported.
14720   void operator=(const CartesianProductGenerator7& other);
14721 
14722   const ParamGenerator<T1> g1_;
14723   const ParamGenerator<T2> g2_;
14724   const ParamGenerator<T3> g3_;
14725   const ParamGenerator<T4> g4_;
14726   const ParamGenerator<T5> g5_;
14727   const ParamGenerator<T6> g6_;
14728   const ParamGenerator<T7> g7_;
14729 };  // class CartesianProductGenerator7
14730 
14731 
14732 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14733     typename T6, typename T7, typename T8>
14734 class CartesianProductGenerator8
14735     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14736         T7, T8> > {
14737  public:
14738   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
14739 
14740   CartesianProductGenerator8(const ParamGenerator<T1>& g1,
14741       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14742       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14743       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14744       const ParamGenerator<T8>& g8)
14745       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
14746           g8_(g8) {}
14747   virtual ~CartesianProductGenerator8() {}
14748 
14749   virtual ParamIteratorInterface<ParamType>* Begin() const {
14750     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14751         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14752         g7_.begin(), g8_, g8_.begin());
14753   }
14754   virtual ParamIteratorInterface<ParamType>* End() const {
14755     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14756         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14757         g8_.end());
14758   }
14759 
14760  private:
14761   class Iterator : public ParamIteratorInterface<ParamType> {
14762    public:
14763     Iterator(const ParamGeneratorInterface<ParamType>* base,
14764       const ParamGenerator<T1>& g1,
14765       const typename ParamGenerator<T1>::iterator& current1,
14766       const ParamGenerator<T2>& g2,
14767       const typename ParamGenerator<T2>::iterator& current2,
14768       const ParamGenerator<T3>& g3,
14769       const typename ParamGenerator<T3>::iterator& current3,
14770       const ParamGenerator<T4>& g4,
14771       const typename ParamGenerator<T4>::iterator& current4,
14772       const ParamGenerator<T5>& g5,
14773       const typename ParamGenerator<T5>::iterator& current5,
14774       const ParamGenerator<T6>& g6,
14775       const typename ParamGenerator<T6>::iterator& current6,
14776       const ParamGenerator<T7>& g7,
14777       const typename ParamGenerator<T7>::iterator& current7,
14778       const ParamGenerator<T8>& g8,
14779       const typename ParamGenerator<T8>::iterator& current8)
14780         : base_(base),
14781           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14782           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14783           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14784           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14785           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14786           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14787           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
14788           begin8_(g8.begin()), end8_(g8.end()), current8_(current8)    {
14789       ComputeCurrentValue();
14790     }
14791     virtual ~Iterator() {}
14792 
14793     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14794       return base_;
14795     }
14796     // Advance should not be called on beyond-of-range iterators
14797     // so no component iterators must be beyond end of range, either.
14798     virtual void Advance() {
14799       assert(!AtEnd());
14800       ++current8_;
14801       if (current8_ == end8_) {
14802         current8_ = begin8_;
14803         ++current7_;
14804       }
14805       if (current7_ == end7_) {
14806         current7_ = begin7_;
14807         ++current6_;
14808       }
14809       if (current6_ == end6_) {
14810         current6_ = begin6_;
14811         ++current5_;
14812       }
14813       if (current5_ == end5_) {
14814         current5_ = begin5_;
14815         ++current4_;
14816       }
14817       if (current4_ == end4_) {
14818         current4_ = begin4_;
14819         ++current3_;
14820       }
14821       if (current3_ == end3_) {
14822         current3_ = begin3_;
14823         ++current2_;
14824       }
14825       if (current2_ == end2_) {
14826         current2_ = begin2_;
14827         ++current1_;
14828       }
14829       ComputeCurrentValue();
14830     }
14831     virtual ParamIteratorInterface<ParamType>* Clone() const {
14832       return new Iterator(*this);
14833     }
14834     virtual const ParamType* Current() const { return &current_value_; }
14835     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14836       // Having the same base generator guarantees that the other
14837       // iterator is of the same type and we can downcast.
14838       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14839           << "The program attempted to compare iterators "
14840           << "from different generators." << std::endl;
14841       const Iterator* typed_other =
14842           CheckedDowncastToActualType<const Iterator>(&other);
14843       // We must report iterators equal if they both point beyond their
14844       // respective ranges. That can happen in a variety of fashions,
14845       // so we have to consult AtEnd().
14846       return (AtEnd() && typed_other->AtEnd()) ||
14847          (
14848           current1_ == typed_other->current1_ &&
14849           current2_ == typed_other->current2_ &&
14850           current3_ == typed_other->current3_ &&
14851           current4_ == typed_other->current4_ &&
14852           current5_ == typed_other->current5_ &&
14853           current6_ == typed_other->current6_ &&
14854           current7_ == typed_other->current7_ &&
14855           current8_ == typed_other->current8_);
14856     }
14857 
14858    private:
14859     Iterator(const Iterator& other)
14860         : base_(other.base_),
14861         begin1_(other.begin1_),
14862         end1_(other.end1_),
14863         current1_(other.current1_),
14864         begin2_(other.begin2_),
14865         end2_(other.end2_),
14866         current2_(other.current2_),
14867         begin3_(other.begin3_),
14868         end3_(other.end3_),
14869         current3_(other.current3_),
14870         begin4_(other.begin4_),
14871         end4_(other.end4_),
14872         current4_(other.current4_),
14873         begin5_(other.begin5_),
14874         end5_(other.end5_),
14875         current5_(other.current5_),
14876         begin6_(other.begin6_),
14877         end6_(other.end6_),
14878         current6_(other.current6_),
14879         begin7_(other.begin7_),
14880         end7_(other.end7_),
14881         current7_(other.current7_),
14882         begin8_(other.begin8_),
14883         end8_(other.end8_),
14884         current8_(other.current8_) {
14885       ComputeCurrentValue();
14886     }
14887 
14888     void ComputeCurrentValue() {
14889       if (!AtEnd())
14890         current_value_ = ParamType(*current1_, *current2_, *current3_,
14891             *current4_, *current5_, *current6_, *current7_, *current8_);
14892     }
14893     bool AtEnd() const {
14894       // We must report iterator past the end of the range when either of the
14895       // component iterators has reached the end of its range.
14896       return
14897           current1_ == end1_ ||
14898           current2_ == end2_ ||
14899           current3_ == end3_ ||
14900           current4_ == end4_ ||
14901           current5_ == end5_ ||
14902           current6_ == end6_ ||
14903           current7_ == end7_ ||
14904           current8_ == end8_;
14905     }
14906 
14907     // No implementation - assignment is unsupported.
14908     void operator=(const Iterator& other);
14909 
14910     const ParamGeneratorInterface<ParamType>* const base_;
14911     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14912     // current[i]_ is the actual traversing iterator.
14913     const typename ParamGenerator<T1>::iterator begin1_;
14914     const typename ParamGenerator<T1>::iterator end1_;
14915     typename ParamGenerator<T1>::iterator current1_;
14916     const typename ParamGenerator<T2>::iterator begin2_;
14917     const typename ParamGenerator<T2>::iterator end2_;
14918     typename ParamGenerator<T2>::iterator current2_;
14919     const typename ParamGenerator<T3>::iterator begin3_;
14920     const typename ParamGenerator<T3>::iterator end3_;
14921     typename ParamGenerator<T3>::iterator current3_;
14922     const typename ParamGenerator<T4>::iterator begin4_;
14923     const typename ParamGenerator<T4>::iterator end4_;
14924     typename ParamGenerator<T4>::iterator current4_;
14925     const typename ParamGenerator<T5>::iterator begin5_;
14926     const typename ParamGenerator<T5>::iterator end5_;
14927     typename ParamGenerator<T5>::iterator current5_;
14928     const typename ParamGenerator<T6>::iterator begin6_;
14929     const typename ParamGenerator<T6>::iterator end6_;
14930     typename ParamGenerator<T6>::iterator current6_;
14931     const typename ParamGenerator<T7>::iterator begin7_;
14932     const typename ParamGenerator<T7>::iterator end7_;
14933     typename ParamGenerator<T7>::iterator current7_;
14934     const typename ParamGenerator<T8>::iterator begin8_;
14935     const typename ParamGenerator<T8>::iterator end8_;
14936     typename ParamGenerator<T8>::iterator current8_;
14937     ParamType current_value_;
14938   };  // class CartesianProductGenerator8::Iterator
14939 
14940   // No implementation - assignment is unsupported.
14941   void operator=(const CartesianProductGenerator8& other);
14942 
14943   const ParamGenerator<T1> g1_;
14944   const ParamGenerator<T2> g2_;
14945   const ParamGenerator<T3> g3_;
14946   const ParamGenerator<T4> g4_;
14947   const ParamGenerator<T5> g5_;
14948   const ParamGenerator<T6> g6_;
14949   const ParamGenerator<T7> g7_;
14950   const ParamGenerator<T8> g8_;
14951 };  // class CartesianProductGenerator8
14952 
14953 
14954 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14955     typename T6, typename T7, typename T8, typename T9>
14956 class CartesianProductGenerator9
14957     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14958         T7, T8, T9> > {
14959  public:
14960   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
14961 
14962   CartesianProductGenerator9(const ParamGenerator<T1>& g1,
14963       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14964       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14965       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14966       const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
14967       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
14968           g9_(g9) {}
14969   virtual ~CartesianProductGenerator9() {}
14970 
14971   virtual ParamIteratorInterface<ParamType>* Begin() const {
14972     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14973         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14974         g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
14975   }
14976   virtual ParamIteratorInterface<ParamType>* End() const {
14977     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14978         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14979         g8_.end(), g9_, g9_.end());
14980   }
14981 
14982  private:
14983   class Iterator : public ParamIteratorInterface<ParamType> {
14984    public:
14985     Iterator(const ParamGeneratorInterface<ParamType>* base,
14986       const ParamGenerator<T1>& g1,
14987       const typename ParamGenerator<T1>::iterator& current1,
14988       const ParamGenerator<T2>& g2,
14989       const typename ParamGenerator<T2>::iterator& current2,
14990       const ParamGenerator<T3>& g3,
14991       const typename ParamGenerator<T3>::iterator& current3,
14992       const ParamGenerator<T4>& g4,
14993       const typename ParamGenerator<T4>::iterator& current4,
14994       const ParamGenerator<T5>& g5,
14995       const typename ParamGenerator<T5>::iterator& current5,
14996       const ParamGenerator<T6>& g6,
14997       const typename ParamGenerator<T6>::iterator& current6,
14998       const ParamGenerator<T7>& g7,
14999       const typename ParamGenerator<T7>::iterator& current7,
15000       const ParamGenerator<T8>& g8,
15001       const typename ParamGenerator<T8>::iterator& current8,
15002       const ParamGenerator<T9>& g9,
15003       const typename ParamGenerator<T9>::iterator& current9)
15004         : base_(base),
15005           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15006           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15007           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15008           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15009           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15010           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15011           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15012           begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15013           begin9_(g9.begin()), end9_(g9.end()), current9_(current9)    {
15014       ComputeCurrentValue();
15015     }
15016     virtual ~Iterator() {}
15017 
15018     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15019       return base_;
15020     }
15021     // Advance should not be called on beyond-of-range iterators
15022     // so no component iterators must be beyond end of range, either.
15023     virtual void Advance() {
15024       assert(!AtEnd());
15025       ++current9_;
15026       if (current9_ == end9_) {
15027         current9_ = begin9_;
15028         ++current8_;
15029       }
15030       if (current8_ == end8_) {
15031         current8_ = begin8_;
15032         ++current7_;
15033       }
15034       if (current7_ == end7_) {
15035         current7_ = begin7_;
15036         ++current6_;
15037       }
15038       if (current6_ == end6_) {
15039         current6_ = begin6_;
15040         ++current5_;
15041       }
15042       if (current5_ == end5_) {
15043         current5_ = begin5_;
15044         ++current4_;
15045       }
15046       if (current4_ == end4_) {
15047         current4_ = begin4_;
15048         ++current3_;
15049       }
15050       if (current3_ == end3_) {
15051         current3_ = begin3_;
15052         ++current2_;
15053       }
15054       if (current2_ == end2_) {
15055         current2_ = begin2_;
15056         ++current1_;
15057       }
15058       ComputeCurrentValue();
15059     }
15060     virtual ParamIteratorInterface<ParamType>* Clone() const {
15061       return new Iterator(*this);
15062     }
15063     virtual const ParamType* Current() const { return &current_value_; }
15064     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15065       // Having the same base generator guarantees that the other
15066       // iterator is of the same type and we can downcast.
15067       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15068           << "The program attempted to compare iterators "
15069           << "from different generators." << std::endl;
15070       const Iterator* typed_other =
15071           CheckedDowncastToActualType<const Iterator>(&other);
15072       // We must report iterators equal if they both point beyond their
15073       // respective ranges. That can happen in a variety of fashions,
15074       // so we have to consult AtEnd().
15075       return (AtEnd() && typed_other->AtEnd()) ||
15076          (
15077           current1_ == typed_other->current1_ &&
15078           current2_ == typed_other->current2_ &&
15079           current3_ == typed_other->current3_ &&
15080           current4_ == typed_other->current4_ &&
15081           current5_ == typed_other->current5_ &&
15082           current6_ == typed_other->current6_ &&
15083           current7_ == typed_other->current7_ &&
15084           current8_ == typed_other->current8_ &&
15085           current9_ == typed_other->current9_);
15086     }
15087 
15088    private:
15089     Iterator(const Iterator& other)
15090         : base_(other.base_),
15091         begin1_(other.begin1_),
15092         end1_(other.end1_),
15093         current1_(other.current1_),
15094         begin2_(other.begin2_),
15095         end2_(other.end2_),
15096         current2_(other.current2_),
15097         begin3_(other.begin3_),
15098         end3_(other.end3_),
15099         current3_(other.current3_),
15100         begin4_(other.begin4_),
15101         end4_(other.end4_),
15102         current4_(other.current4_),
15103         begin5_(other.begin5_),
15104         end5_(other.end5_),
15105         current5_(other.current5_),
15106         begin6_(other.begin6_),
15107         end6_(other.end6_),
15108         current6_(other.current6_),
15109         begin7_(other.begin7_),
15110         end7_(other.end7_),
15111         current7_(other.current7_),
15112         begin8_(other.begin8_),
15113         end8_(other.end8_),
15114         current8_(other.current8_),
15115         begin9_(other.begin9_),
15116         end9_(other.end9_),
15117         current9_(other.current9_) {
15118       ComputeCurrentValue();
15119     }
15120 
15121     void ComputeCurrentValue() {
15122       if (!AtEnd())
15123         current_value_ = ParamType(*current1_, *current2_, *current3_,
15124             *current4_, *current5_, *current6_, *current7_, *current8_,
15125             *current9_);
15126     }
15127     bool AtEnd() const {
15128       // We must report iterator past the end of the range when either of the
15129       // component iterators has reached the end of its range.
15130       return
15131           current1_ == end1_ ||
15132           current2_ == end2_ ||
15133           current3_ == end3_ ||
15134           current4_ == end4_ ||
15135           current5_ == end5_ ||
15136           current6_ == end6_ ||
15137           current7_ == end7_ ||
15138           current8_ == end8_ ||
15139           current9_ == end9_;
15140     }
15141 
15142     // No implementation - assignment is unsupported.
15143     void operator=(const Iterator& other);
15144 
15145     const ParamGeneratorInterface<ParamType>* const base_;
15146     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15147     // current[i]_ is the actual traversing iterator.
15148     const typename ParamGenerator<T1>::iterator begin1_;
15149     const typename ParamGenerator<T1>::iterator end1_;
15150     typename ParamGenerator<T1>::iterator current1_;
15151     const typename ParamGenerator<T2>::iterator begin2_;
15152     const typename ParamGenerator<T2>::iterator end2_;
15153     typename ParamGenerator<T2>::iterator current2_;
15154     const typename ParamGenerator<T3>::iterator begin3_;
15155     const typename ParamGenerator<T3>::iterator end3_;
15156     typename ParamGenerator<T3>::iterator current3_;
15157     const typename ParamGenerator<T4>::iterator begin4_;
15158     const typename ParamGenerator<T4>::iterator end4_;
15159     typename ParamGenerator<T4>::iterator current4_;
15160     const typename ParamGenerator<T5>::iterator begin5_;
15161     const typename ParamGenerator<T5>::iterator end5_;
15162     typename ParamGenerator<T5>::iterator current5_;
15163     const typename ParamGenerator<T6>::iterator begin6_;
15164     const typename ParamGenerator<T6>::iterator end6_;
15165     typename ParamGenerator<T6>::iterator current6_;
15166     const typename ParamGenerator<T7>::iterator begin7_;
15167     const typename ParamGenerator<T7>::iterator end7_;
15168     typename ParamGenerator<T7>::iterator current7_;
15169     const typename ParamGenerator<T8>::iterator begin8_;
15170     const typename ParamGenerator<T8>::iterator end8_;
15171     typename ParamGenerator<T8>::iterator current8_;
15172     const typename ParamGenerator<T9>::iterator begin9_;
15173     const typename ParamGenerator<T9>::iterator end9_;
15174     typename ParamGenerator<T9>::iterator current9_;
15175     ParamType current_value_;
15176   };  // class CartesianProductGenerator9::Iterator
15177 
15178   // No implementation - assignment is unsupported.
15179   void operator=(const CartesianProductGenerator9& other);
15180 
15181   const ParamGenerator<T1> g1_;
15182   const ParamGenerator<T2> g2_;
15183   const ParamGenerator<T3> g3_;
15184   const ParamGenerator<T4> g4_;
15185   const ParamGenerator<T5> g5_;
15186   const ParamGenerator<T6> g6_;
15187   const ParamGenerator<T7> g7_;
15188   const ParamGenerator<T8> g8_;
15189   const ParamGenerator<T9> g9_;
15190 };  // class CartesianProductGenerator9
15191 
15192 
15193 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15194     typename T6, typename T7, typename T8, typename T9, typename T10>
15195 class CartesianProductGenerator10
15196     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15197         T7, T8, T9, T10> > {
15198  public:
15199   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
15200 
15201   CartesianProductGenerator10(const ParamGenerator<T1>& g1,
15202       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15203       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15204       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
15205       const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
15206       const ParamGenerator<T10>& g10)
15207       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15208           g9_(g9), g10_(g10) {}
15209   virtual ~CartesianProductGenerator10() {}
15210 
15211   virtual ParamIteratorInterface<ParamType>* Begin() const {
15212     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15213         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
15214         g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
15215   }
15216   virtual ParamIteratorInterface<ParamType>* End() const {
15217     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15218         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
15219         g8_.end(), g9_, g9_.end(), g10_, g10_.end());
15220   }
15221 
15222  private:
15223   class Iterator : public ParamIteratorInterface<ParamType> {
15224    public:
15225     Iterator(const ParamGeneratorInterface<ParamType>* base,
15226       const ParamGenerator<T1>& g1,
15227       const typename ParamGenerator<T1>::iterator& current1,
15228       const ParamGenerator<T2>& g2,
15229       const typename ParamGenerator<T2>::iterator& current2,
15230       const ParamGenerator<T3>& g3,
15231       const typename ParamGenerator<T3>::iterator& current3,
15232       const ParamGenerator<T4>& g4,
15233       const typename ParamGenerator<T4>::iterator& current4,
15234       const ParamGenerator<T5>& g5,
15235       const typename ParamGenerator<T5>::iterator& current5,
15236       const ParamGenerator<T6>& g6,
15237       const typename ParamGenerator<T6>::iterator& current6,
15238       const ParamGenerator<T7>& g7,
15239       const typename ParamGenerator<T7>::iterator& current7,
15240       const ParamGenerator<T8>& g8,
15241       const typename ParamGenerator<T8>::iterator& current8,
15242       const ParamGenerator<T9>& g9,
15243       const typename ParamGenerator<T9>::iterator& current9,
15244       const ParamGenerator<T10>& g10,
15245       const typename ParamGenerator<T10>::iterator& current10)
15246         : base_(base),
15247           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15248           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15249           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15250           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15251           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15252           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15253           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15254           begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15255           begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
15256           begin10_(g10.begin()), end10_(g10.end()), current10_(current10)    {
15257       ComputeCurrentValue();
15258     }
15259     virtual ~Iterator() {}
15260 
15261     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15262       return base_;
15263     }
15264     // Advance should not be called on beyond-of-range iterators
15265     // so no component iterators must be beyond end of range, either.
15266     virtual void Advance() {
15267       assert(!AtEnd());
15268       ++current10_;
15269       if (current10_ == end10_) {
15270         current10_ = begin10_;
15271         ++current9_;
15272       }
15273       if (current9_ == end9_) {
15274         current9_ = begin9_;
15275         ++current8_;
15276       }
15277       if (current8_ == end8_) {
15278         current8_ = begin8_;
15279         ++current7_;
15280       }
15281       if (current7_ == end7_) {
15282         current7_ = begin7_;
15283         ++current6_;
15284       }
15285       if (current6_ == end6_) {
15286         current6_ = begin6_;
15287         ++current5_;
15288       }
15289       if (current5_ == end5_) {
15290         current5_ = begin5_;
15291         ++current4_;
15292       }
15293       if (current4_ == end4_) {
15294         current4_ = begin4_;
15295         ++current3_;
15296       }
15297       if (current3_ == end3_) {
15298         current3_ = begin3_;
15299         ++current2_;
15300       }
15301       if (current2_ == end2_) {
15302         current2_ = begin2_;
15303         ++current1_;
15304       }
15305       ComputeCurrentValue();
15306     }
15307     virtual ParamIteratorInterface<ParamType>* Clone() const {
15308       return new Iterator(*this);
15309     }
15310     virtual const ParamType* Current() const { return &current_value_; }
15311     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15312       // Having the same base generator guarantees that the other
15313       // iterator is of the same type and we can downcast.
15314       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15315           << "The program attempted to compare iterators "
15316           << "from different generators." << std::endl;
15317       const Iterator* typed_other =
15318           CheckedDowncastToActualType<const Iterator>(&other);
15319       // We must report iterators equal if they both point beyond their
15320       // respective ranges. That can happen in a variety of fashions,
15321       // so we have to consult AtEnd().
15322       return (AtEnd() && typed_other->AtEnd()) ||
15323          (
15324           current1_ == typed_other->current1_ &&
15325           current2_ == typed_other->current2_ &&
15326           current3_ == typed_other->current3_ &&
15327           current4_ == typed_other->current4_ &&
15328           current5_ == typed_other->current5_ &&
15329           current6_ == typed_other->current6_ &&
15330           current7_ == typed_other->current7_ &&
15331           current8_ == typed_other->current8_ &&
15332           current9_ == typed_other->current9_ &&
15333           current10_ == typed_other->current10_);
15334     }
15335 
15336    private:
15337     Iterator(const Iterator& other)
15338         : base_(other.base_),
15339         begin1_(other.begin1_),
15340         end1_(other.end1_),
15341         current1_(other.current1_),
15342         begin2_(other.begin2_),
15343         end2_(other.end2_),
15344         current2_(other.current2_),
15345         begin3_(other.begin3_),
15346         end3_(other.end3_),
15347         current3_(other.current3_),
15348         begin4_(other.begin4_),
15349         end4_(other.end4_),
15350         current4_(other.current4_),
15351         begin5_(other.begin5_),
15352         end5_(other.end5_),
15353         current5_(other.current5_),
15354         begin6_(other.begin6_),
15355         end6_(other.end6_),
15356         current6_(other.current6_),
15357         begin7_(other.begin7_),
15358         end7_(other.end7_),
15359         current7_(other.current7_),
15360         begin8_(other.begin8_),
15361         end8_(other.end8_),
15362         current8_(other.current8_),
15363         begin9_(other.begin9_),
15364         end9_(other.end9_),
15365         current9_(other.current9_),
15366         begin10_(other.begin10_),
15367         end10_(other.end10_),
15368         current10_(other.current10_) {
15369       ComputeCurrentValue();
15370     }
15371 
15372     void ComputeCurrentValue() {
15373       if (!AtEnd())
15374         current_value_ = ParamType(*current1_, *current2_, *current3_,
15375             *current4_, *current5_, *current6_, *current7_, *current8_,
15376             *current9_, *current10_);
15377     }
15378     bool AtEnd() const {
15379       // We must report iterator past the end of the range when either of the
15380       // component iterators has reached the end of its range.
15381       return
15382           current1_ == end1_ ||
15383           current2_ == end2_ ||
15384           current3_ == end3_ ||
15385           current4_ == end4_ ||
15386           current5_ == end5_ ||
15387           current6_ == end6_ ||
15388           current7_ == end7_ ||
15389           current8_ == end8_ ||
15390           current9_ == end9_ ||
15391           current10_ == end10_;
15392     }
15393 
15394     // No implementation - assignment is unsupported.
15395     void operator=(const Iterator& other);
15396 
15397     const ParamGeneratorInterface<ParamType>* const base_;
15398     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15399     // current[i]_ is the actual traversing iterator.
15400     const typename ParamGenerator<T1>::iterator begin1_;
15401     const typename ParamGenerator<T1>::iterator end1_;
15402     typename ParamGenerator<T1>::iterator current1_;
15403     const typename ParamGenerator<T2>::iterator begin2_;
15404     const typename ParamGenerator<T2>::iterator end2_;
15405     typename ParamGenerator<T2>::iterator current2_;
15406     const typename ParamGenerator<T3>::iterator begin3_;
15407     const typename ParamGenerator<T3>::iterator end3_;
15408     typename ParamGenerator<T3>::iterator current3_;
15409     const typename ParamGenerator<T4>::iterator begin4_;
15410     const typename ParamGenerator<T4>::iterator end4_;
15411     typename ParamGenerator<T4>::iterator current4_;
15412     const typename ParamGenerator<T5>::iterator begin5_;
15413     const typename ParamGenerator<T5>::iterator end5_;
15414     typename ParamGenerator<T5>::iterator current5_;
15415     const typename ParamGenerator<T6>::iterator begin6_;
15416     const typename ParamGenerator<T6>::iterator end6_;
15417     typename ParamGenerator<T6>::iterator current6_;
15418     const typename ParamGenerator<T7>::iterator begin7_;
15419     const typename ParamGenerator<T7>::iterator end7_;
15420     typename ParamGenerator<T7>::iterator current7_;
15421     const typename ParamGenerator<T8>::iterator begin8_;
15422     const typename ParamGenerator<T8>::iterator end8_;
15423     typename ParamGenerator<T8>::iterator current8_;
15424     const typename ParamGenerator<T9>::iterator begin9_;
15425     const typename ParamGenerator<T9>::iterator end9_;
15426     typename ParamGenerator<T9>::iterator current9_;
15427     const typename ParamGenerator<T10>::iterator begin10_;
15428     const typename ParamGenerator<T10>::iterator end10_;
15429     typename ParamGenerator<T10>::iterator current10_;
15430     ParamType current_value_;
15431   };  // class CartesianProductGenerator10::Iterator
15432 
15433   // No implementation - assignment is unsupported.
15434   void operator=(const CartesianProductGenerator10& other);
15435 
15436   const ParamGenerator<T1> g1_;
15437   const ParamGenerator<T2> g2_;
15438   const ParamGenerator<T3> g3_;
15439   const ParamGenerator<T4> g4_;
15440   const ParamGenerator<T5> g5_;
15441   const ParamGenerator<T6> g6_;
15442   const ParamGenerator<T7> g7_;
15443   const ParamGenerator<T8> g8_;
15444   const ParamGenerator<T9> g9_;
15445   const ParamGenerator<T10> g10_;
15446 };  // class CartesianProductGenerator10
15447 
15448 
15449 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15450 //
15451 // Helper classes providing Combine() with polymorphic features. They allow
15452 // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
15453 // convertible to U.
15454 //
15455 template <class Generator1, class Generator2>
15456 class CartesianProductHolder2 {
15457  public:
15458 CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
15459       : g1_(g1), g2_(g2) {}
15460   template <typename T1, typename T2>
15461   operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
15462     return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
15463         new CartesianProductGenerator2<T1, T2>(
15464         static_cast<ParamGenerator<T1> >(g1_),
15465         static_cast<ParamGenerator<T2> >(g2_)));
15466   }
15467 
15468  private:
15469   // No implementation - assignment is unsupported.
15470   void operator=(const CartesianProductHolder2& other);
15471 
15472   const Generator1 g1_;
15473   const Generator2 g2_;
15474 };  // class CartesianProductHolder2
15475 
15476 template <class Generator1, class Generator2, class Generator3>
15477 class CartesianProductHolder3 {
15478  public:
15479 CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
15480     const Generator3& g3)
15481       : g1_(g1), g2_(g2), g3_(g3) {}
15482   template <typename T1, typename T2, typename T3>
15483   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
15484     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
15485         new CartesianProductGenerator3<T1, T2, T3>(
15486         static_cast<ParamGenerator<T1> >(g1_),
15487         static_cast<ParamGenerator<T2> >(g2_),
15488         static_cast<ParamGenerator<T3> >(g3_)));
15489   }
15490 
15491  private:
15492   // No implementation - assignment is unsupported.
15493   void operator=(const CartesianProductHolder3& other);
15494 
15495   const Generator1 g1_;
15496   const Generator2 g2_;
15497   const Generator3 g3_;
15498 };  // class CartesianProductHolder3
15499 
15500 template <class Generator1, class Generator2, class Generator3,
15501     class Generator4>
15502 class CartesianProductHolder4 {
15503  public:
15504 CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
15505     const Generator3& g3, const Generator4& g4)
15506       : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
15507   template <typename T1, typename T2, typename T3, typename T4>
15508   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
15509     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
15510         new CartesianProductGenerator4<T1, T2, T3, T4>(
15511         static_cast<ParamGenerator<T1> >(g1_),
15512         static_cast<ParamGenerator<T2> >(g2_),
15513         static_cast<ParamGenerator<T3> >(g3_),
15514         static_cast<ParamGenerator<T4> >(g4_)));
15515   }
15516 
15517  private:
15518   // No implementation - assignment is unsupported.
15519   void operator=(const CartesianProductHolder4& other);
15520 
15521   const Generator1 g1_;
15522   const Generator2 g2_;
15523   const Generator3 g3_;
15524   const Generator4 g4_;
15525 };  // class CartesianProductHolder4
15526 
15527 template <class Generator1, class Generator2, class Generator3,
15528     class Generator4, class Generator5>
15529 class CartesianProductHolder5 {
15530  public:
15531 CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
15532     const Generator3& g3, const Generator4& g4, const Generator5& g5)
15533       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
15534   template <typename T1, typename T2, typename T3, typename T4, typename T5>
15535   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
15536     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
15537         new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
15538         static_cast<ParamGenerator<T1> >(g1_),
15539         static_cast<ParamGenerator<T2> >(g2_),
15540         static_cast<ParamGenerator<T3> >(g3_),
15541         static_cast<ParamGenerator<T4> >(g4_),
15542         static_cast<ParamGenerator<T5> >(g5_)));
15543   }
15544 
15545  private:
15546   // No implementation - assignment is unsupported.
15547   void operator=(const CartesianProductHolder5& other);
15548 
15549   const Generator1 g1_;
15550   const Generator2 g2_;
15551   const Generator3 g3_;
15552   const Generator4 g4_;
15553   const Generator5 g5_;
15554 };  // class CartesianProductHolder5
15555 
15556 template <class Generator1, class Generator2, class Generator3,
15557     class Generator4, class Generator5, class Generator6>
15558 class CartesianProductHolder6 {
15559  public:
15560 CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
15561     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15562     const Generator6& g6)
15563       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
15564   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15565       typename T6>
15566   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
15567     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
15568         new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
15569         static_cast<ParamGenerator<T1> >(g1_),
15570         static_cast<ParamGenerator<T2> >(g2_),
15571         static_cast<ParamGenerator<T3> >(g3_),
15572         static_cast<ParamGenerator<T4> >(g4_),
15573         static_cast<ParamGenerator<T5> >(g5_),
15574         static_cast<ParamGenerator<T6> >(g6_)));
15575   }
15576 
15577  private:
15578   // No implementation - assignment is unsupported.
15579   void operator=(const CartesianProductHolder6& other);
15580 
15581   const Generator1 g1_;
15582   const Generator2 g2_;
15583   const Generator3 g3_;
15584   const Generator4 g4_;
15585   const Generator5 g5_;
15586   const Generator6 g6_;
15587 };  // class CartesianProductHolder6
15588 
15589 template <class Generator1, class Generator2, class Generator3,
15590     class Generator4, class Generator5, class Generator6, class Generator7>
15591 class CartesianProductHolder7 {
15592  public:
15593 CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
15594     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15595     const Generator6& g6, const Generator7& g7)
15596       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
15597   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15598       typename T6, typename T7>
15599   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15600       T7> >() const {
15601     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
15602         new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
15603         static_cast<ParamGenerator<T1> >(g1_),
15604         static_cast<ParamGenerator<T2> >(g2_),
15605         static_cast<ParamGenerator<T3> >(g3_),
15606         static_cast<ParamGenerator<T4> >(g4_),
15607         static_cast<ParamGenerator<T5> >(g5_),
15608         static_cast<ParamGenerator<T6> >(g6_),
15609         static_cast<ParamGenerator<T7> >(g7_)));
15610   }
15611 
15612  private:
15613   // No implementation - assignment is unsupported.
15614   void operator=(const CartesianProductHolder7& other);
15615 
15616   const Generator1 g1_;
15617   const Generator2 g2_;
15618   const Generator3 g3_;
15619   const Generator4 g4_;
15620   const Generator5 g5_;
15621   const Generator6 g6_;
15622   const Generator7 g7_;
15623 };  // class CartesianProductHolder7
15624 
15625 template <class Generator1, class Generator2, class Generator3,
15626     class Generator4, class Generator5, class Generator6, class Generator7,
15627     class Generator8>
15628 class CartesianProductHolder8 {
15629  public:
15630 CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
15631     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15632     const Generator6& g6, const Generator7& g7, const Generator8& g8)
15633       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
15634           g8_(g8) {}
15635   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15636       typename T6, typename T7, typename T8>
15637   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
15638       T8> >() const {
15639     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
15640         new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
15641         static_cast<ParamGenerator<T1> >(g1_),
15642         static_cast<ParamGenerator<T2> >(g2_),
15643         static_cast<ParamGenerator<T3> >(g3_),
15644         static_cast<ParamGenerator<T4> >(g4_),
15645         static_cast<ParamGenerator<T5> >(g5_),
15646         static_cast<ParamGenerator<T6> >(g6_),
15647         static_cast<ParamGenerator<T7> >(g7_),
15648         static_cast<ParamGenerator<T8> >(g8_)));
15649   }
15650 
15651  private:
15652   // No implementation - assignment is unsupported.
15653   void operator=(const CartesianProductHolder8& other);
15654 
15655   const Generator1 g1_;
15656   const Generator2 g2_;
15657   const Generator3 g3_;
15658   const Generator4 g4_;
15659   const Generator5 g5_;
15660   const Generator6 g6_;
15661   const Generator7 g7_;
15662   const Generator8 g8_;
15663 };  // class CartesianProductHolder8
15664 
15665 template <class Generator1, class Generator2, class Generator3,
15666     class Generator4, class Generator5, class Generator6, class Generator7,
15667     class Generator8, class Generator9>
15668 class CartesianProductHolder9 {
15669  public:
15670 CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
15671     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15672     const Generator6& g6, const Generator7& g7, const Generator8& g8,
15673     const Generator9& g9)
15674       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15675           g9_(g9) {}
15676   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15677       typename T6, typename T7, typename T8, typename T9>
15678   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15679       T9> >() const {
15680     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15681         T9> >(
15682         new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
15683         static_cast<ParamGenerator<T1> >(g1_),
15684         static_cast<ParamGenerator<T2> >(g2_),
15685         static_cast<ParamGenerator<T3> >(g3_),
15686         static_cast<ParamGenerator<T4> >(g4_),
15687         static_cast<ParamGenerator<T5> >(g5_),
15688         static_cast<ParamGenerator<T6> >(g6_),
15689         static_cast<ParamGenerator<T7> >(g7_),
15690         static_cast<ParamGenerator<T8> >(g8_),
15691         static_cast<ParamGenerator<T9> >(g9_)));
15692   }
15693 
15694  private:
15695   // No implementation - assignment is unsupported.
15696   void operator=(const CartesianProductHolder9& other);
15697 
15698   const Generator1 g1_;
15699   const Generator2 g2_;
15700   const Generator3 g3_;
15701   const Generator4 g4_;
15702   const Generator5 g5_;
15703   const Generator6 g6_;
15704   const Generator7 g7_;
15705   const Generator8 g8_;
15706   const Generator9 g9_;
15707 };  // class CartesianProductHolder9
15708 
15709 template <class Generator1, class Generator2, class Generator3,
15710     class Generator4, class Generator5, class Generator6, class Generator7,
15711     class Generator8, class Generator9, class Generator10>
15712 class CartesianProductHolder10 {
15713  public:
15714 CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
15715     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15716     const Generator6& g6, const Generator7& g7, const Generator8& g8,
15717     const Generator9& g9, const Generator10& g10)
15718       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15719           g9_(g9), g10_(g10) {}
15720   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15721       typename T6, typename T7, typename T8, typename T9, typename T10>
15722   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15723       T9, T10> >() const {
15724     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15725         T9, T10> >(
15726         new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
15727             T10>(
15728         static_cast<ParamGenerator<T1> >(g1_),
15729         static_cast<ParamGenerator<T2> >(g2_),
15730         static_cast<ParamGenerator<T3> >(g3_),
15731         static_cast<ParamGenerator<T4> >(g4_),
15732         static_cast<ParamGenerator<T5> >(g5_),
15733         static_cast<ParamGenerator<T6> >(g6_),
15734         static_cast<ParamGenerator<T7> >(g7_),
15735         static_cast<ParamGenerator<T8> >(g8_),
15736         static_cast<ParamGenerator<T9> >(g9_),
15737         static_cast<ParamGenerator<T10> >(g10_)));
15738   }
15739 
15740  private:
15741   // No implementation - assignment is unsupported.
15742   void operator=(const CartesianProductHolder10& other);
15743 
15744   const Generator1 g1_;
15745   const Generator2 g2_;
15746   const Generator3 g3_;
15747   const Generator4 g4_;
15748   const Generator5 g5_;
15749   const Generator6 g6_;
15750   const Generator7 g7_;
15751   const Generator8 g8_;
15752   const Generator9 g9_;
15753   const Generator10 g10_;
15754 };  // class CartesianProductHolder10
15755 
15756 # endif  // GTEST_HAS_COMBINE
15757 
15758 }  // namespace internal
15759 }  // namespace testing
15760 
15761 #endif  //  GTEST_HAS_PARAM_TEST
15762 
15763 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
15764 
15765 #if GTEST_HAS_PARAM_TEST
15766 
15767 namespace testing {
15768 
15769 // Functions producing parameter generators.
15770 //
15771 // Google Test uses these generators to produce parameters for value-
15772 // parameterized tests. When a parameterized test case is instantiated
15773 // with a particular generator, Google Test creates and runs tests
15774 // for each element in the sequence produced by the generator.
15775 //
15776 // In the following sample, tests from test case FooTest are instantiated
15777 // each three times with parameter values 3, 5, and 8:
15778 //
15779 // class FooTest : public TestWithParam<int> { ... };
15780 //
15781 // TEST_P(FooTest, TestThis) {
15782 // }
15783 // TEST_P(FooTest, TestThat) {
15784 // }
15785 // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
15786 //
15787 
15788 // Range() returns generators providing sequences of values in a range.
15789 //
15790 // Synopsis:
15791 // Range(start, end)
15792 //   - returns a generator producing a sequence of values {start, start+1,
15793 //     start+2, ..., }.
15794 // Range(start, end, step)
15795 //   - returns a generator producing a sequence of values {start, start+step,
15796 //     start+step+step, ..., }.
15797 // Notes:
15798 //   * The generated sequences never include end. For example, Range(1, 5)
15799 //     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
15800 //     returns a generator producing {1, 3, 5, 7}.
15801 //   * start and end must have the same type. That type may be any integral or
15802 //     floating-point type or a user defined type satisfying these conditions:
15803 //     * It must be assignable (have operator=() defined).
15804 //     * It must have operator+() (operator+(int-compatible type) for
15805 //       two-operand version).
15806 //     * It must have operator<() defined.
15807 //     Elements in the resulting sequences will also have that type.
15808 //   * Condition start < end must be satisfied in order for resulting sequences
15809 //     to contain any elements.
15810 //
15811 template <typename T, typename IncrementT>
15812 internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
15813   return internal::ParamGenerator<T>(
15814       new internal::RangeGenerator<T, IncrementT>(start, end, step));
15815 }
15816 
15817 template <typename T>
15818 internal::ParamGenerator<T> Range(T start, T end) {
15819   return Range(start, end, 1);
15820 }
15821 
15822 // ValuesIn() function allows generation of tests with parameters coming from
15823 // a container.
15824 //
15825 // Synopsis:
15826 // ValuesIn(const T (&array)[N])
15827 //   - returns a generator producing sequences with elements from
15828 //     a C-style array.
15829 // ValuesIn(const Container& container)
15830 //   - returns a generator producing sequences with elements from
15831 //     an STL-style container.
15832 // ValuesIn(Iterator begin, Iterator end)
15833 //   - returns a generator producing sequences with elements from
15834 //     a range [begin, end) defined by a pair of STL-style iterators. These
15835 //     iterators can also be plain C pointers.
15836 //
15837 // Please note that ValuesIn copies the values from the containers
15838 // passed in and keeps them to generate tests in RUN_ALL_TESTS().
15839 //
15840 // Examples:
15841 //
15842 // This instantiates tests from test case StringTest
15843 // each with C-string values of "foo", "bar", and "baz":
15844 //
15845 // const char* strings[] = {"foo", "bar", "baz"};
15846 // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
15847 //
15848 // This instantiates tests from test case StlStringTest
15849 // each with STL strings with values "a" and "b":
15850 //
15851 // ::std::vector< ::std::string> GetParameterStrings() {
15852 //   ::std::vector< ::std::string> v;
15853 //   v.push_back("a");
15854 //   v.push_back("b");
15855 //   return v;
15856 // }
15857 //
15858 // INSTANTIATE_TEST_CASE_P(CharSequence,
15859 //                         StlStringTest,
15860 //                         ValuesIn(GetParameterStrings()));
15861 //
15862 //
15863 // This will also instantiate tests from CharTest
15864 // each with parameter values 'a' and 'b':
15865 //
15866 // ::std::list<char> GetParameterChars() {
15867 //   ::std::list<char> list;
15868 //   list.push_back('a');
15869 //   list.push_back('b');
15870 //   return list;
15871 // }
15872 // ::std::list<char> l = GetParameterChars();
15873 // INSTANTIATE_TEST_CASE_P(CharSequence2,
15874 //                         CharTest,
15875 //                         ValuesIn(l.begin(), l.end()));
15876 //
15877 template <typename ForwardIterator>
15878 internal::ParamGenerator<
15879   typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
15880 ValuesIn(ForwardIterator begin, ForwardIterator end) {
15881   typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
15882       ::value_type ParamType;
15883   return internal::ParamGenerator<ParamType>(
15884       new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
15885 }
15886 
15887 template <typename T, size_t N>
15888 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
15889   return ValuesIn(array, array + N);
15890 }
15891 
15892 template <class Container>
15893 internal::ParamGenerator<typename Container::value_type> ValuesIn(
15894     const Container& container) {
15895   return ValuesIn(container.begin(), container.end());
15896 }
15897 
15898 // Values() allows generating tests from explicitly specified list of
15899 // parameters.
15900 //
15901 // Synopsis:
15902 // Values(T v1, T v2, ..., T vN)
15903 //   - returns a generator producing sequences with elements v1, v2, ..., vN.
15904 //
15905 // For example, this instantiates tests from test case BarTest each
15906 // with values "one", "two", and "three":
15907 //
15908 // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
15909 //
15910 // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
15911 // The exact type of values will depend on the type of parameter in BazTest.
15912 //
15913 // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
15914 //
15915 // Currently, Values() supports from 1 to 50 parameters.
15916 //
15917 template <typename T1>
15918 internal::ValueArray1<T1> Values(T1 v1) {
15919   return internal::ValueArray1<T1>(v1);
15920 }
15921 
15922 template <typename T1, typename T2>
15923 internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
15924   return internal::ValueArray2<T1, T2>(v1, v2);
15925 }
15926 
15927 template <typename T1, typename T2, typename T3>
15928 internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
15929   return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
15930 }
15931 
15932 template <typename T1, typename T2, typename T3, typename T4>
15933 internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
15934   return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
15935 }
15936 
15937 template <typename T1, typename T2, typename T3, typename T4, typename T5>
15938 internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
15939     T5 v5) {
15940   return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
15941 }
15942 
15943 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15944     typename T6>
15945 internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
15946     T4 v4, T5 v5, T6 v6) {
15947   return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
15948 }
15949 
15950 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15951     typename T6, typename T7>
15952 internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
15953     T4 v4, T5 v5, T6 v6, T7 v7) {
15954   return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
15955       v6, v7);
15956 }
15957 
15958 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15959     typename T6, typename T7, typename T8>
15960 internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
15961     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
15962   return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
15963       v5, v6, v7, v8);
15964 }
15965 
15966 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15967     typename T6, typename T7, typename T8, typename T9>
15968 internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
15969     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
15970   return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
15971       v4, v5, v6, v7, v8, v9);
15972 }
15973 
15974 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15975     typename T6, typename T7, typename T8, typename T9, typename T10>
15976 internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
15977     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
15978   return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
15979       v2, v3, v4, v5, v6, v7, v8, v9, v10);
15980 }
15981 
15982 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15983     typename T6, typename T7, typename T8, typename T9, typename T10,
15984     typename T11>
15985 internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
15986     T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15987     T10 v10, T11 v11) {
15988   return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
15989       T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
15990 }
15991 
15992 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15993     typename T6, typename T7, typename T8, typename T9, typename T10,
15994     typename T11, typename T12>
15995 internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15996     T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15997     T10 v10, T11 v11, T12 v12) {
15998   return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15999       T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
16000 }
16001 
16002 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16003     typename T6, typename T7, typename T8, typename T9, typename T10,
16004     typename T11, typename T12, typename T13>
16005 internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
16006     T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16007     T10 v10, T11 v11, T12 v12, T13 v13) {
16008   return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16009       T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
16010 }
16011 
16012 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16013     typename T6, typename T7, typename T8, typename T9, typename T10,
16014     typename T11, typename T12, typename T13, typename T14>
16015 internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16016     T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16017     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
16018   return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16019       T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16020       v14);
16021 }
16022 
16023 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16024     typename T6, typename T7, typename T8, typename T9, typename T10,
16025     typename T11, typename T12, typename T13, typename T14, typename T15>
16026 internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16027     T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16028     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
16029   return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16030       T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16031       v13, v14, v15);
16032 }
16033 
16034 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16035     typename T6, typename T7, typename T8, typename T9, typename T10,
16036     typename T11, typename T12, typename T13, typename T14, typename T15,
16037     typename T16>
16038 internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16039     T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16040     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16041     T16 v16) {
16042   return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16043       T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16044       v12, v13, v14, v15, v16);
16045 }
16046 
16047 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16048     typename T6, typename T7, typename T8, typename T9, typename T10,
16049     typename T11, typename T12, typename T13, typename T14, typename T15,
16050     typename T16, typename T17>
16051 internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16052     T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16053     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16054     T16 v16, T17 v17) {
16055   return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16056       T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16057       v11, v12, v13, v14, v15, v16, v17);
16058 }
16059 
16060 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16061     typename T6, typename T7, typename T8, typename T9, typename T10,
16062     typename T11, typename T12, typename T13, typename T14, typename T15,
16063     typename T16, typename T17, typename T18>
16064 internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16065     T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16066     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16067     T16 v16, T17 v17, T18 v18) {
16068   return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16069       T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16070       v10, v11, v12, v13, v14, v15, v16, v17, v18);
16071 }
16072 
16073 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16074     typename T6, typename T7, typename T8, typename T9, typename T10,
16075     typename T11, typename T12, typename T13, typename T14, typename T15,
16076     typename T16, typename T17, typename T18, typename T19>
16077 internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16078     T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16079     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16080     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
16081   return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16082       T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
16083       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
16084 }
16085 
16086 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16087     typename T6, typename T7, typename T8, typename T9, typename T10,
16088     typename T11, typename T12, typename T13, typename T14, typename T15,
16089     typename T16, typename T17, typename T18, typename T19, typename T20>
16090 internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16091     T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16092     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16093     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
16094   return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16095       T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
16096       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
16097 }
16098 
16099 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16100     typename T6, typename T7, typename T8, typename T9, typename T10,
16101     typename T11, typename T12, typename T13, typename T14, typename T15,
16102     typename T16, typename T17, typename T18, typename T19, typename T20,
16103     typename T21>
16104 internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16105     T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16106     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16107     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
16108   return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16109       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
16110       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
16111 }
16112 
16113 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16114     typename T6, typename T7, typename T8, typename T9, typename T10,
16115     typename T11, typename T12, typename T13, typename T14, typename T15,
16116     typename T16, typename T17, typename T18, typename T19, typename T20,
16117     typename T21, typename T22>
16118 internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16119     T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
16120     T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16121     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16122     T21 v21, T22 v22) {
16123   return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16124       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
16125       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16126       v20, v21, v22);
16127 }
16128 
16129 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16130     typename T6, typename T7, typename T8, typename T9, typename T10,
16131     typename T11, typename T12, typename T13, typename T14, typename T15,
16132     typename T16, typename T17, typename T18, typename T19, typename T20,
16133     typename T21, typename T22, typename T23>
16134 internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16135     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
16136     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16137     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16138     T21 v21, T22 v22, T23 v23) {
16139   return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16140       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
16141       v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16142       v20, v21, v22, v23);
16143 }
16144 
16145 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16146     typename T6, typename T7, typename T8, typename T9, typename T10,
16147     typename T11, typename T12, typename T13, typename T14, typename T15,
16148     typename T16, typename T17, typename T18, typename T19, typename T20,
16149     typename T21, typename T22, typename T23, typename T24>
16150 internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16151     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
16152     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16153     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16154     T21 v21, T22 v22, T23 v23, T24 v24) {
16155   return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16156       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
16157       v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16158       v19, v20, v21, v22, v23, v24);
16159 }
16160 
16161 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16162     typename T6, typename T7, typename T8, typename T9, typename T10,
16163     typename T11, typename T12, typename T13, typename T14, typename T15,
16164     typename T16, typename T17, typename T18, typename T19, typename T20,
16165     typename T21, typename T22, typename T23, typename T24, typename T25>
16166 internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16167     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
16168     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16169     T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16170     T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
16171   return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16172       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
16173       v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16174       v18, v19, v20, v21, v22, v23, v24, v25);
16175 }
16176 
16177 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16178     typename T6, typename T7, typename T8, typename T9, typename T10,
16179     typename T11, typename T12, typename T13, typename T14, typename T15,
16180     typename T16, typename T17, typename T18, typename T19, typename T20,
16181     typename T21, typename T22, typename T23, typename T24, typename T25,
16182     typename T26>
16183 internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16184     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16185     T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16186     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16187     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16188     T26 v26) {
16189   return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16190       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16191       T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16192       v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
16193 }
16194 
16195 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16196     typename T6, typename T7, typename T8, typename T9, typename T10,
16197     typename T11, typename T12, typename T13, typename T14, typename T15,
16198     typename T16, typename T17, typename T18, typename T19, typename T20,
16199     typename T21, typename T22, typename T23, typename T24, typename T25,
16200     typename T26, typename T27>
16201 internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16202     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
16203     T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16204     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16205     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16206     T26 v26, T27 v27) {
16207   return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16208       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16209       T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16210       v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
16211 }
16212 
16213 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16214     typename T6, typename T7, typename T8, typename T9, typename T10,
16215     typename T11, typename T12, typename T13, typename T14, typename T15,
16216     typename T16, typename T17, typename T18, typename T19, typename T20,
16217     typename T21, typename T22, typename T23, typename T24, typename T25,
16218     typename T26, typename T27, typename T28>
16219 internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16220     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
16221     T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16222     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16223     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16224     T26 v26, T27 v27, T28 v28) {
16225   return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16226       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16227       T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16228       v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16229       v28);
16230 }
16231 
16232 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16233     typename T6, typename T7, typename T8, typename T9, typename T10,
16234     typename T11, typename T12, typename T13, typename T14, typename T15,
16235     typename T16, typename T17, typename T18, typename T19, typename T20,
16236     typename T21, typename T22, typename T23, typename T24, typename T25,
16237     typename T26, typename T27, typename T28, typename T29>
16238 internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16239     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16240     T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16241     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16242     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16243     T26 v26, T27 v27, T28 v28, T29 v29) {
16244   return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16245       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16246       T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16247       v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16248       v27, v28, v29);
16249 }
16250 
16251 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16252     typename T6, typename T7, typename T8, typename T9, typename T10,
16253     typename T11, typename T12, typename T13, typename T14, typename T15,
16254     typename T16, typename T17, typename T18, typename T19, typename T20,
16255     typename T21, typename T22, typename T23, typename T24, typename T25,
16256     typename T26, typename T27, typename T28, typename T29, typename T30>
16257 internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16258     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16259     T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16260     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16261     T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16262     T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
16263   return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16264       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16265       T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16266       v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16267       v26, v27, v28, v29, v30);
16268 }
16269 
16270 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16271     typename T6, typename T7, typename T8, typename T9, typename T10,
16272     typename T11, typename T12, typename T13, typename T14, typename T15,
16273     typename T16, typename T17, typename T18, typename T19, typename T20,
16274     typename T21, typename T22, typename T23, typename T24, typename T25,
16275     typename T26, typename T27, typename T28, typename T29, typename T30,
16276     typename T31>
16277 internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16278     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16279     T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16280     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16281     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16282     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
16283   return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16284       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16285       T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16286       v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16287       v25, v26, v27, v28, v29, v30, v31);
16288 }
16289 
16290 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16291     typename T6, typename T7, typename T8, typename T9, typename T10,
16292     typename T11, typename T12, typename T13, typename T14, typename T15,
16293     typename T16, typename T17, typename T18, typename T19, typename T20,
16294     typename T21, typename T22, typename T23, typename T24, typename T25,
16295     typename T26, typename T27, typename T28, typename T29, typename T30,
16296     typename T31, typename T32>
16297 internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16298     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16299     T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16300     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16301     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16302     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16303     T32 v32) {
16304   return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16305       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16306       T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16307       v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16308       v24, v25, v26, v27, v28, v29, v30, v31, v32);
16309 }
16310 
16311 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16312     typename T6, typename T7, typename T8, typename T9, typename T10,
16313     typename T11, typename T12, typename T13, typename T14, typename T15,
16314     typename T16, typename T17, typename T18, typename T19, typename T20,
16315     typename T21, typename T22, typename T23, typename T24, typename T25,
16316     typename T26, typename T27, typename T28, typename T29, typename T30,
16317     typename T31, typename T32, typename T33>
16318 internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16319     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16320     T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16321     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16322     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16323     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16324     T32 v32, T33 v33) {
16325   return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16326       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16327       T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
16328       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16329       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
16330 }
16331 
16332 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16333     typename T6, typename T7, typename T8, typename T9, typename T10,
16334     typename T11, typename T12, typename T13, typename T14, typename T15,
16335     typename T16, typename T17, typename T18, typename T19, typename T20,
16336     typename T21, typename T22, typename T23, typename T24, typename T25,
16337     typename T26, typename T27, typename T28, typename T29, typename T30,
16338     typename T31, typename T32, typename T33, typename T34>
16339 internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16340     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16341     T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16342     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16343     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16344     T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16345     T31 v31, T32 v32, T33 v33, T34 v34) {
16346   return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16347       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16348       T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
16349       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16350       v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
16351 }
16352 
16353 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16354     typename T6, typename T7, typename T8, typename T9, typename T10,
16355     typename T11, typename T12, typename T13, typename T14, typename T15,
16356     typename T16, typename T17, typename T18, typename T19, typename T20,
16357     typename T21, typename T22, typename T23, typename T24, typename T25,
16358     typename T26, typename T27, typename T28, typename T29, typename T30,
16359     typename T31, typename T32, typename T33, typename T34, typename T35>
16360 internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16361     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16362     T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16363     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16364     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16365     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16366     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
16367   return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16368       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16369       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
16370       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16371       v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
16372 }
16373 
16374 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16375     typename T6, typename T7, typename T8, typename T9, typename T10,
16376     typename T11, typename T12, typename T13, typename T14, typename T15,
16377     typename T16, typename T17, typename T18, typename T19, typename T20,
16378     typename T21, typename T22, typename T23, typename T24, typename T25,
16379     typename T26, typename T27, typename T28, typename T29, typename T30,
16380     typename T31, typename T32, typename T33, typename T34, typename T35,
16381     typename T36>
16382 internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16383     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16384     T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16385     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16386     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16387     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16388     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
16389   return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16390       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16391       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
16392       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16393       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16394       v34, v35, v36);
16395 }
16396 
16397 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16398     typename T6, typename T7, typename T8, typename T9, typename T10,
16399     typename T11, typename T12, typename T13, typename T14, typename T15,
16400     typename T16, typename T17, typename T18, typename T19, typename T20,
16401     typename T21, typename T22, typename T23, typename T24, typename T25,
16402     typename T26, typename T27, typename T28, typename T29, typename T30,
16403     typename T31, typename T32, typename T33, typename T34, typename T35,
16404     typename T36, typename T37>
16405 internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16406     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16407     T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
16408     T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16409     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16410     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16411     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16412     T37 v37) {
16413   return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16414       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16415       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
16416       v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16417       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16418       v34, v35, v36, v37);
16419 }
16420 
16421 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16422     typename T6, typename T7, typename T8, typename T9, typename T10,
16423     typename T11, typename T12, typename T13, typename T14, typename T15,
16424     typename T16, typename T17, typename T18, typename T19, typename T20,
16425     typename T21, typename T22, typename T23, typename T24, typename T25,
16426     typename T26, typename T27, typename T28, typename T29, typename T30,
16427     typename T31, typename T32, typename T33, typename T34, typename T35,
16428     typename T36, typename T37, typename T38>
16429 internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16430     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16431     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
16432     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16433     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16434     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16435     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16436     T37 v37, T38 v38) {
16437   return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16438       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16439       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
16440       v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16441       v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
16442       v33, v34, v35, v36, v37, v38);
16443 }
16444 
16445 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16446     typename T6, typename T7, typename T8, typename T9, typename T10,
16447     typename T11, typename T12, typename T13, typename T14, typename T15,
16448     typename T16, typename T17, typename T18, typename T19, typename T20,
16449     typename T21, typename T22, typename T23, typename T24, typename T25,
16450     typename T26, typename T27, typename T28, typename T29, typename T30,
16451     typename T31, typename T32, typename T33, typename T34, typename T35,
16452     typename T36, typename T37, typename T38, typename T39>
16453 internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16454     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16455     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
16456     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16457     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16458     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16459     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16460     T37 v37, T38 v38, T39 v39) {
16461   return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16462       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16463       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
16464       v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16465       v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
16466       v32, v33, v34, v35, v36, v37, v38, v39);
16467 }
16468 
16469 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16470     typename T6, typename T7, typename T8, typename T9, typename T10,
16471     typename T11, typename T12, typename T13, typename T14, typename T15,
16472     typename T16, typename T17, typename T18, typename T19, typename T20,
16473     typename T21, typename T22, typename T23, typename T24, typename T25,
16474     typename T26, typename T27, typename T28, typename T29, typename T30,
16475     typename T31, typename T32, typename T33, typename T34, typename T35,
16476     typename T36, typename T37, typename T38, typename T39, typename T40>
16477 internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16478     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16479     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
16480     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16481     T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16482     T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
16483     T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
16484     T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
16485   return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16486       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16487       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16488       T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16489       v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
16490       v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
16491 }
16492 
16493 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16494     typename T6, typename T7, typename T8, typename T9, typename T10,
16495     typename T11, typename T12, typename T13, typename T14, typename T15,
16496     typename T16, typename T17, typename T18, typename T19, typename T20,
16497     typename T21, typename T22, typename T23, typename T24, typename T25,
16498     typename T26, typename T27, typename T28, typename T29, typename T30,
16499     typename T31, typename T32, typename T33, typename T34, typename T35,
16500     typename T36, typename T37, typename T38, typename T39, typename T40,
16501     typename T41>
16502 internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16503     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16504     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
16505     T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16506     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16507     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16508     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16509     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
16510   return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16511       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16512       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16513       T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16514       v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
16515       v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
16516 }
16517 
16518 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16519     typename T6, typename T7, typename T8, typename T9, typename T10,
16520     typename T11, typename T12, typename T13, typename T14, typename T15,
16521     typename T16, typename T17, typename T18, typename T19, typename T20,
16522     typename T21, typename T22, typename T23, typename T24, typename T25,
16523     typename T26, typename T27, typename T28, typename T29, typename T30,
16524     typename T31, typename T32, typename T33, typename T34, typename T35,
16525     typename T36, typename T37, typename T38, typename T39, typename T40,
16526     typename T41, typename T42>
16527 internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16528     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16529     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
16530     T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16531     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16532     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16533     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16534     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16535     T42 v42) {
16536   return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16537       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16538       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16539       T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16540       v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16541       v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
16542       v42);
16543 }
16544 
16545 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16546     typename T6, typename T7, typename T8, typename T9, typename T10,
16547     typename T11, typename T12, typename T13, typename T14, typename T15,
16548     typename T16, typename T17, typename T18, typename T19, typename T20,
16549     typename T21, typename T22, typename T23, typename T24, typename T25,
16550     typename T26, typename T27, typename T28, typename T29, typename T30,
16551     typename T31, typename T32, typename T33, typename T34, typename T35,
16552     typename T36, typename T37, typename T38, typename T39, typename T40,
16553     typename T41, typename T42, typename T43>
16554 internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16555     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16556     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
16557     T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16558     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16559     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16560     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16561     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16562     T42 v42, T43 v43) {
16563   return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16564       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16565       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16566       T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16567       v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16568       v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
16569       v41, v42, v43);
16570 }
16571 
16572 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16573     typename T6, typename T7, typename T8, typename T9, typename T10,
16574     typename T11, typename T12, typename T13, typename T14, typename T15,
16575     typename T16, typename T17, typename T18, typename T19, typename T20,
16576     typename T21, typename T22, typename T23, typename T24, typename T25,
16577     typename T26, typename T27, typename T28, typename T29, typename T30,
16578     typename T31, typename T32, typename T33, typename T34, typename T35,
16579     typename T36, typename T37, typename T38, typename T39, typename T40,
16580     typename T41, typename T42, typename T43, typename T44>
16581 internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16582     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16583     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16584     T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16585     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16586     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16587     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16588     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16589     T42 v42, T43 v43, T44 v44) {
16590   return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16591       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16592       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16593       T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16594       v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16595       v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
16596       v40, v41, v42, v43, v44);
16597 }
16598 
16599 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16600     typename T6, typename T7, typename T8, typename T9, typename T10,
16601     typename T11, typename T12, typename T13, typename T14, typename T15,
16602     typename T16, typename T17, typename T18, typename T19, typename T20,
16603     typename T21, typename T22, typename T23, typename T24, typename T25,
16604     typename T26, typename T27, typename T28, typename T29, typename T30,
16605     typename T31, typename T32, typename T33, typename T34, typename T35,
16606     typename T36, typename T37, typename T38, typename T39, typename T40,
16607     typename T41, typename T42, typename T43, typename T44, typename T45>
16608 internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16609     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16610     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16611     T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16612     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16613     T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16614     T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
16615     T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
16616     T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
16617   return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16618       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16619       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16620       T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16621       v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16622       v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
16623       v39, v40, v41, v42, v43, v44, v45);
16624 }
16625 
16626 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16627     typename T6, typename T7, typename T8, typename T9, typename T10,
16628     typename T11, typename T12, typename T13, typename T14, typename T15,
16629     typename T16, typename T17, typename T18, typename T19, typename T20,
16630     typename T21, typename T22, typename T23, typename T24, typename T25,
16631     typename T26, typename T27, typename T28, typename T29, typename T30,
16632     typename T31, typename T32, typename T33, typename T34, typename T35,
16633     typename T36, typename T37, typename T38, typename T39, typename T40,
16634     typename T41, typename T42, typename T43, typename T44, typename T45,
16635     typename T46>
16636 internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16637     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16638     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16639     T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16640     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16641     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16642     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16643     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16644     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
16645   return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16646       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16647       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16648       T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16649       v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16650       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16651       v38, v39, v40, v41, v42, v43, v44, v45, v46);
16652 }
16653 
16654 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16655     typename T6, typename T7, typename T8, typename T9, typename T10,
16656     typename T11, typename T12, typename T13, typename T14, typename T15,
16657     typename T16, typename T17, typename T18, typename T19, typename T20,
16658     typename T21, typename T22, typename T23, typename T24, typename T25,
16659     typename T26, typename T27, typename T28, typename T29, typename T30,
16660     typename T31, typename T32, typename T33, typename T34, typename T35,
16661     typename T36, typename T37, typename T38, typename T39, typename T40,
16662     typename T41, typename T42, typename T43, typename T44, typename T45,
16663     typename T46, typename T47>
16664 internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16665     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16666     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16667     T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16668     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16669     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16670     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16671     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16672     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
16673   return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16674       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16675       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16676       T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
16677       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16678       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16679       v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
16680 }
16681 
16682 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16683     typename T6, typename T7, typename T8, typename T9, typename T10,
16684     typename T11, typename T12, typename T13, typename T14, typename T15,
16685     typename T16, typename T17, typename T18, typename T19, typename T20,
16686     typename T21, typename T22, typename T23, typename T24, typename T25,
16687     typename T26, typename T27, typename T28, typename T29, typename T30,
16688     typename T31, typename T32, typename T33, typename T34, typename T35,
16689     typename T36, typename T37, typename T38, typename T39, typename T40,
16690     typename T41, typename T42, typename T43, typename T44, typename T45,
16691     typename T46, typename T47, typename T48>
16692 internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16693     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16694     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16695     T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16696     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16697     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16698     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16699     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16700     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
16701     T48 v48) {
16702   return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16703       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16704       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16705       T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
16706       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16707       v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
16708       v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
16709 }
16710 
16711 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16712     typename T6, typename T7, typename T8, typename T9, typename T10,
16713     typename T11, typename T12, typename T13, typename T14, typename T15,
16714     typename T16, typename T17, typename T18, typename T19, typename T20,
16715     typename T21, typename T22, typename T23, typename T24, typename T25,
16716     typename T26, typename T27, typename T28, typename T29, typename T30,
16717     typename T31, typename T32, typename T33, typename T34, typename T35,
16718     typename T36, typename T37, typename T38, typename T39, typename T40,
16719     typename T41, typename T42, typename T43, typename T44, typename T45,
16720     typename T46, typename T47, typename T48, typename T49>
16721 internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16722     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16723     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16724     T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16725     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16726     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16727     T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16728     T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
16729     T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
16730     T47 v47, T48 v48, T49 v49) {
16731   return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16732       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16733       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16734       T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
16735       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16736       v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
16737       v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
16738 }
16739 
16740 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16741     typename T6, typename T7, typename T8, typename T9, typename T10,
16742     typename T11, typename T12, typename T13, typename T14, typename T15,
16743     typename T16, typename T17, typename T18, typename T19, typename T20,
16744     typename T21, typename T22, typename T23, typename T24, typename T25,
16745     typename T26, typename T27, typename T28, typename T29, typename T30,
16746     typename T31, typename T32, typename T33, typename T34, typename T35,
16747     typename T36, typename T37, typename T38, typename T39, typename T40,
16748     typename T41, typename T42, typename T43, typename T44, typename T45,
16749     typename T46, typename T47, typename T48, typename T49, typename T50>
16750 internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16751     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16752     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16753     T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16754     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16755     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16756     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16757     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
16758     T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
16759     T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
16760   return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16761       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16762       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16763       T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
16764       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16765       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16766       v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
16767       v48, v49, v50);
16768 }
16769 
16770 // Bool() allows generating tests with parameters in a set of (false, true).
16771 //
16772 // Synopsis:
16773 // Bool()
16774 //   - returns a generator producing sequences with elements {false, true}.
16775 //
16776 // It is useful when testing code that depends on Boolean flags. Combinations
16777 // of multiple flags can be tested when several Bool()'s are combined using
16778 // Combine() function.
16779 //
16780 // In the following example all tests in the test case FlagDependentTest
16781 // will be instantiated twice with parameters false and true.
16782 //
16783 // class FlagDependentTest : public testing::TestWithParam<bool> {
16784 //   virtual void SetUp() {
16785 //     external_flag = GetParam();
16786 //   }
16787 // }
16788 // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
16789 //
16790 inline internal::ParamGenerator<bool> Bool() {
16791   return Values(false, true);
16792 }
16793 
16794 # if GTEST_HAS_COMBINE
16795 // Combine() allows the user to combine two or more sequences to produce
16796 // values of a Cartesian product of those sequences' elements.
16797 //
16798 // Synopsis:
16799 // Combine(gen1, gen2, ..., genN)
16800 //   - returns a generator producing sequences with elements coming from
16801 //     the Cartesian product of elements from the sequences generated by
16802 //     gen1, gen2, ..., genN. The sequence elements will have a type of
16803 //     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
16804 //     of elements from sequences produces by gen1, gen2, ..., genN.
16805 //
16806 // Combine can have up to 10 arguments. This number is currently limited
16807 // by the maximum number of elements in the tuple implementation used by Google
16808 // Test.
16809 //
16810 // Example:
16811 //
16812 // This will instantiate tests in test case AnimalTest each one with
16813 // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
16814 // tuple("dog", BLACK), and tuple("dog", WHITE):
16815 //
16816 // enum Color { BLACK, GRAY, WHITE };
16817 // class AnimalTest
16818 //     : public testing::TestWithParam<tuple<const char*, Color> > {...};
16819 //
16820 // TEST_P(AnimalTest, AnimalLooksNice) {...}
16821 //
16822 // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
16823 //                         Combine(Values("cat", "dog"),
16824 //                                 Values(BLACK, WHITE)));
16825 //
16826 // This will instantiate tests in FlagDependentTest with all variations of two
16827 // Boolean flags:
16828 //
16829 // class FlagDependentTest
16830 //     : public testing::TestWithParam<tuple<bool, bool> > {
16831 //   virtual void SetUp() {
16832 //     // Assigns external_flag_1 and external_flag_2 values from the tuple.
16833 //     tie(external_flag_1, external_flag_2) = GetParam();
16834 //   }
16835 // };
16836 //
16837 // TEST_P(FlagDependentTest, TestFeature1) {
16838 //   // Test your code using external_flag_1 and external_flag_2 here.
16839 // }
16840 // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
16841 //                         Combine(Bool(), Bool()));
16842 //
16843 template <typename Generator1, typename Generator2>
16844 internal::CartesianProductHolder2<Generator1, Generator2> Combine(
16845     const Generator1& g1, const Generator2& g2) {
16846   return internal::CartesianProductHolder2<Generator1, Generator2>(
16847       g1, g2);
16848 }
16849 
16850 template <typename Generator1, typename Generator2, typename Generator3>
16851 internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
16852     const Generator1& g1, const Generator2& g2, const Generator3& g3) {
16853   return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
16854       g1, g2, g3);
16855 }
16856 
16857 template <typename Generator1, typename Generator2, typename Generator3,
16858     typename Generator4>
16859 internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16860     Generator4> Combine(
16861     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16862         const Generator4& g4) {
16863   return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16864       Generator4>(
16865       g1, g2, g3, g4);
16866 }
16867 
16868 template <typename Generator1, typename Generator2, typename Generator3,
16869     typename Generator4, typename Generator5>
16870 internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16871     Generator4, Generator5> Combine(
16872     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16873         const Generator4& g4, const Generator5& g5) {
16874   return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16875       Generator4, Generator5>(
16876       g1, g2, g3, g4, g5);
16877 }
16878 
16879 template <typename Generator1, typename Generator2, typename Generator3,
16880     typename Generator4, typename Generator5, typename Generator6>
16881 internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16882     Generator4, Generator5, Generator6> Combine(
16883     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16884         const Generator4& g4, const Generator5& g5, const Generator6& g6) {
16885   return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16886       Generator4, Generator5, Generator6>(
16887       g1, g2, g3, g4, g5, g6);
16888 }
16889 
16890 template <typename Generator1, typename Generator2, typename Generator3,
16891     typename Generator4, typename Generator5, typename Generator6,
16892     typename Generator7>
16893 internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16894     Generator4, Generator5, Generator6, Generator7> Combine(
16895     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16896         const Generator4& g4, const Generator5& g5, const Generator6& g6,
16897         const Generator7& g7) {
16898   return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16899       Generator4, Generator5, Generator6, Generator7>(
16900       g1, g2, g3, g4, g5, g6, g7);
16901 }
16902 
16903 template <typename Generator1, typename Generator2, typename Generator3,
16904     typename Generator4, typename Generator5, typename Generator6,
16905     typename Generator7, typename Generator8>
16906 internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16907     Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
16908     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16909         const Generator4& g4, const Generator5& g5, const Generator6& g6,
16910         const Generator7& g7, const Generator8& g8) {
16911   return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16912       Generator4, Generator5, Generator6, Generator7, Generator8>(
16913       g1, g2, g3, g4, g5, g6, g7, g8);
16914 }
16915 
16916 template <typename Generator1, typename Generator2, typename Generator3,
16917     typename Generator4, typename Generator5, typename Generator6,
16918     typename Generator7, typename Generator8, typename Generator9>
16919 internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16920     Generator4, Generator5, Generator6, Generator7, Generator8,
16921     Generator9> Combine(
16922     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16923         const Generator4& g4, const Generator5& g5, const Generator6& g6,
16924         const Generator7& g7, const Generator8& g8, const Generator9& g9) {
16925   return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16926       Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
16927       g1, g2, g3, g4, g5, g6, g7, g8, g9);
16928 }
16929 
16930 template <typename Generator1, typename Generator2, typename Generator3,
16931     typename Generator4, typename Generator5, typename Generator6,
16932     typename Generator7, typename Generator8, typename Generator9,
16933     typename Generator10>
16934 internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16935     Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16936     Generator10> Combine(
16937     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16938         const Generator4& g4, const Generator5& g5, const Generator6& g6,
16939         const Generator7& g7, const Generator8& g8, const Generator9& g9,
16940         const Generator10& g10) {
16941   return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16942       Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16943       Generator10>(
16944       g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
16945 }
16946 # endif  // GTEST_HAS_COMBINE
16947 
16948 
16949 
16950 # define TEST_P(test_case_name, test_name) \
16951   class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
16952       : public test_case_name { \
16953    public: \
16954     GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
16955     virtual void TestBody(); \
16956    private: \
16957     static int AddToRegistry() { \
16958       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
16959           GetTestCasePatternHolder<test_case_name>(\
16960               #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
16961                   #test_case_name, \
16962                   #test_name, \
16963                   new ::testing::internal::TestMetaFactory< \
16964                       GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
16965       return 0; \
16966     } \
16967     static int gtest_registering_dummy_; \
16968     GTEST_DISALLOW_COPY_AND_ASSIGN_(\
16969         GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
16970   }; \
16971   int GTEST_TEST_CLASS_NAME_(test_case_name, \
16972                              test_name)::gtest_registering_dummy_ = \
16973       GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
16974   void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
16975 
16976 # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
16977   ::testing::internal::ParamGenerator<test_case_name::ParamType> \
16978       gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
16979   int gtest_##prefix##test_case_name##_dummy_ = \
16980       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
16981           GetTestCasePatternHolder<test_case_name>(\
16982               #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
16983                   #prefix, \
16984                   &gtest_##prefix##test_case_name##_EvalGenerator_, \
16985                   __FILE__, __LINE__)
16986 
16987 }  // namespace testing
16988 
16989 #endif  // GTEST_HAS_PARAM_TEST
16990 
16991 #endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
16992 // Copyright 2006, Google Inc.
16993 // All rights reserved.
16994 //
16995 // Redistribution and use in source and binary forms, with or without
16996 // modification, are permitted provided that the following conditions are
16997 // met:
16998 //
16999 //     * Redistributions of source code must retain the above copyright
17000 // notice, this list of conditions and the following disclaimer.
17001 //     * Redistributions in binary form must reproduce the above
17002 // copyright notice, this list of conditions and the following disclaimer
17003 // in the documentation and/or other materials provided with the
17004 // distribution.
17005 //     * Neither the name of Google Inc. nor the names of its
17006 // contributors may be used to endorse or promote products derived from
17007 // this software without specific prior written permission.
17008 //
17009 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17010 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17011 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17012 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17013 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17014 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17015 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17016 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17017 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17018 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17019 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17020 //
17021 // Author: wan@google.com (Zhanyong Wan)
17022 //
17023 // Google C++ Testing Framework definitions useful in production code.
17024 
17025 #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17026 #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17027 
17028 // When you need to test the private or protected members of a class,
17029 // use the FRIEND_TEST macro to declare your tests as friends of the
17030 // class.  For example:
17031 //
17032 // class MyClass {
17033 //  private:
17034 //   void MyMethod();
17035 //   FRIEND_TEST(MyClassTest, MyMethod);
17036 // };
17037 //
17038 // class MyClassTest : public testing::Test {
17039 //   // ...
17040 // };
17041 //
17042 // TEST_F(MyClassTest, MyMethod) {
17043 //   // Can call MyClass::MyMethod() here.
17044 // }
17045 
17046 #define FRIEND_TEST(test_case_name, test_name)\
17047 friend class test_case_name##_##test_name##_Test
17048 
17049 #endif  // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17050 // Copyright 2008, Google Inc.
17051 // All rights reserved.
17052 //
17053 // Redistribution and use in source and binary forms, with or without
17054 // modification, are permitted provided that the following conditions are
17055 // met:
17056 //
17057 //     * Redistributions of source code must retain the above copyright
17058 // notice, this list of conditions and the following disclaimer.
17059 //     * Redistributions in binary form must reproduce the above
17060 // copyright notice, this list of conditions and the following disclaimer
17061 // in the documentation and/or other materials provided with the
17062 // distribution.
17063 //     * Neither the name of Google Inc. nor the names of its
17064 // contributors may be used to endorse or promote products derived from
17065 // this software without specific prior written permission.
17066 //
17067 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17068 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17069 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17070 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17071 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17072 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17073 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17074 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17075 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17076 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17077 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17078 //
17079 // Author: mheule@google.com (Markus Heule)
17080 //
17081 
17082 #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17083 #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17084 
17085 #include <iosfwd>
17086 #include <vector>
17087 
17088 namespace testing {
17089 
17090 // A copyable object representing the result of a test part (i.e. an
17091 // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
17092 //
17093 // Don't inherit from TestPartResult as its destructor is not virtual.
17094 class GTEST_API_ TestPartResult {
17095  public:
17096   // The possible outcomes of a test part (i.e. an assertion or an
17097   // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
17098   enum Type {
17099     kSuccess,          // Succeeded.
17100     kNonFatalFailure,  // Failed but the test can continue.
17101     kFatalFailure      // Failed and the test should be terminated.
17102   };
17103 
17104   // C'tor.  TestPartResult does NOT have a default constructor.
17105   // Always use this constructor (with parameters) to create a
17106   // TestPartResult object.
17107   TestPartResult(Type a_type,
17108                  const char* a_file_name,
17109                  int a_line_number,
17110                  const char* a_message)
17111       : type_(a_type),
17112         file_name_(a_file_name == NULL ? "" : a_file_name),
17113         line_number_(a_line_number),
17114         summary_(ExtractSummary(a_message)),
17115         message_(a_message) {
17116   }
17117 
17118   // Gets the outcome of the test part.
17119   Type type() const { return type_; }
17120 
17121   // Gets the name of the source file where the test part took place, or
17122   // NULL if it's unknown.
17123   const char* file_name() const {
17124     return file_name_.empty() ? NULL : file_name_.c_str();
17125   }
17126 
17127   // Gets the line in the source file where the test part took place,
17128   // or -1 if it's unknown.
17129   int line_number() const { return line_number_; }
17130 
17131   // Gets the summary of the failure message.
17132   const char* summary() const { return summary_.c_str(); }
17133 
17134   // Gets the message associated with the test part.
17135   const char* message() const { return message_.c_str(); }
17136 
17137   // Returns true iff the test part passed.
17138   bool passed() const { return type_ == kSuccess; }
17139 
17140   // Returns true iff the test part failed.
17141   bool failed() const { return type_ != kSuccess; }
17142 
17143   // Returns true iff the test part non-fatally failed.
17144   bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
17145 
17146   // Returns true iff the test part fatally failed.
17147   bool fatally_failed() const { return type_ == kFatalFailure; }
17148 
17149  private:
17150   Type type_;
17151 
17152   // Gets the summary of the failure message by omitting the stack
17153   // trace in it.
17154   static std::string ExtractSummary(const char* message);
17155 
17156   // The name of the source file where the test part took place, or
17157   // "" if the source file is unknown.
17158   std::string file_name_;
17159   // The line in the source file where the test part took place, or -1
17160   // if the line number is unknown.
17161   int line_number_;
17162   std::string summary_;  // The test failure summary.
17163   std::string message_;  // The test failure message.
17164 };
17165 
17166 // Prints a TestPartResult object.
17167 std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
17168 
17169 // An array of TestPartResult objects.
17170 //
17171 // Don't inherit from TestPartResultArray as its destructor is not
17172 // virtual.
17173 class GTEST_API_ TestPartResultArray {
17174  public:
17175   TestPartResultArray() {}
17176 
17177   // Appends the given TestPartResult to the array.
17178   void Append(const TestPartResult& result);
17179 
17180   // Returns the TestPartResult at the given index (0-based).
17181   const TestPartResult& GetTestPartResult(int index) const;
17182 
17183   // Returns the number of TestPartResult objects in the array.
17184   int size() const;
17185 
17186  private:
17187   std::vector<TestPartResult> array_;
17188 
17189   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
17190 };
17191 
17192 // This interface knows how to report a test part result.
17193 class TestPartResultReporterInterface {
17194  public:
17195   virtual ~TestPartResultReporterInterface() {}
17196 
17197   virtual void ReportTestPartResult(const TestPartResult& result) = 0;
17198 };
17199 
17200 namespace internal {
17201 
17202 // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
17203 // statement generates new fatal failures. To do so it registers itself as the
17204 // current test part result reporter. Besides checking if fatal failures were
17205 // reported, it only delegates the reporting to the former result reporter.
17206 // The original result reporter is restored in the destructor.
17207 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
17208 class GTEST_API_ HasNewFatalFailureHelper
17209     : public TestPartResultReporterInterface {
17210  public:
17211   HasNewFatalFailureHelper();
17212   virtual ~HasNewFatalFailureHelper();
17213   virtual void ReportTestPartResult(const TestPartResult& result);
17214   bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
17215  private:
17216   bool has_new_fatal_failure_;
17217   TestPartResultReporterInterface* original_reporter_;
17218 
17219   GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
17220 };
17221 
17222 }  // namespace internal
17223 
17224 }  // namespace testing
17225 
17226 #endif  // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17227 // Copyright 2008 Google Inc.
17228 // All Rights Reserved.
17229 //
17230 // Redistribution and use in source and binary forms, with or without
17231 // modification, are permitted provided that the following conditions are
17232 // met:
17233 //
17234 //     * Redistributions of source code must retain the above copyright
17235 // notice, this list of conditions and the following disclaimer.
17236 //     * Redistributions in binary form must reproduce the above
17237 // copyright notice, this list of conditions and the following disclaimer
17238 // in the documentation and/or other materials provided with the
17239 // distribution.
17240 //     * Neither the name of Google Inc. nor the names of its
17241 // contributors may be used to endorse or promote products derived from
17242 // this software without specific prior written permission.
17243 //
17244 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17245 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17246 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17247 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17248 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17249 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17250 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17251 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17252 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17253 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17254 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17255 //
17256 // Author: wan@google.com (Zhanyong Wan)
17257 
17258 #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17259 #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17260 
17261 // This header implements typed tests and type-parameterized tests.
17262 
17263 // Typed (aka type-driven) tests repeat the same test for types in a
17264 // list.  You must know which types you want to test with when writing
17265 // typed tests. Here's how you do it:
17266 
17267 #if 0
17268 
17269 // First, define a fixture class template.  It should be parameterized
17270 // by a type.  Remember to derive it from testing::Test.
17271 template <typename T>
17272 class FooTest : public testing::Test {
17273  public:
17274   ...
17275   typedef std::list<T> List;
17276   static T shared_;
17277   T value_;
17278 };
17279 
17280 // Next, associate a list of types with the test case, which will be
17281 // repeated for each type in the list.  The typedef is necessary for
17282 // the macro to parse correctly.
17283 typedef testing::Types<char, int, unsigned int> MyTypes;
17284 TYPED_TEST_CASE(FooTest, MyTypes);
17285 
17286 // If the type list contains only one type, you can write that type
17287 // directly without Types<...>:
17288 //   TYPED_TEST_CASE(FooTest, int);
17289 
17290 // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
17291 // tests for this test case as you want.
17292 TYPED_TEST(FooTest, DoesBlah) {
17293   // Inside a test, refer to TypeParam to get the type parameter.
17294   // Since we are inside a derived class template, C++ requires use to
17295   // visit the members of FooTest via 'this'.
17296   TypeParam n = this->value_;
17297 
17298   // To visit static members of the fixture, add the TestFixture::
17299   // prefix.
17300   n += TestFixture::shared_;
17301 
17302   // To refer to typedefs in the fixture, add the "typename
17303   // TestFixture::" prefix.
17304   typename TestFixture::List values;
17305   values.push_back(n);
17306   ...
17307 }
17308 
17309 TYPED_TEST(FooTest, HasPropertyA) { ... }
17310 
17311 #endif  // 0
17312 
17313 // Type-parameterized tests are abstract test patterns parameterized
17314 // by a type.  Compared with typed tests, type-parameterized tests
17315 // allow you to define the test pattern without knowing what the type
17316 // parameters are.  The defined pattern can be instantiated with
17317 // different types any number of times, in any number of translation
17318 // units.
17319 //
17320 // If you are designing an interface or concept, you can define a
17321 // suite of type-parameterized tests to verify properties that any
17322 // valid implementation of the interface/concept should have.  Then,
17323 // each implementation can easily instantiate the test suite to verify
17324 // that it conforms to the requirements, without having to write
17325 // similar tests repeatedly.  Here's an example:
17326 
17327 #if 0
17328 
17329 // First, define a fixture class template.  It should be parameterized
17330 // by a type.  Remember to derive it from testing::Test.
17331 template <typename T>
17332 class FooTest : public testing::Test {
17333   ...
17334 };
17335 
17336 // Next, declare that you will define a type-parameterized test case
17337 // (the _P suffix is for "parameterized" or "pattern", whichever you
17338 // prefer):
17339 TYPED_TEST_CASE_P(FooTest);
17340 
17341 // Then, use TYPED_TEST_P() to define as many type-parameterized tests
17342 // for this type-parameterized test case as you want.
17343 TYPED_TEST_P(FooTest, DoesBlah) {
17344   // Inside a test, refer to TypeParam to get the type parameter.
17345   TypeParam n = 0;
17346   ...
17347 }
17348 
17349 TYPED_TEST_P(FooTest, HasPropertyA) { ... }
17350 
17351 // Now the tricky part: you need to register all test patterns before
17352 // you can instantiate them.  The first argument of the macro is the
17353 // test case name; the rest are the names of the tests in this test
17354 // case.
17355 REGISTER_TYPED_TEST_CASE_P(FooTest,
17356                            DoesBlah, HasPropertyA);
17357 
17358 // Finally, you are free to instantiate the pattern with the types you
17359 // want.  If you put the above code in a header file, you can #include
17360 // it in multiple C++ source files and instantiate it multiple times.
17361 //
17362 // To distinguish different instances of the pattern, the first
17363 // argument to the INSTANTIATE_* macro is a prefix that will be added
17364 // to the actual test case name.  Remember to pick unique prefixes for
17365 // different instances.
17366 typedef testing::Types<char, int, unsigned int> MyTypes;
17367 INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
17368 
17369 // If the type list contains only one type, you can write that type
17370 // directly without Types<...>:
17371 //   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
17372 
17373 #endif  // 0
17374 
17375 
17376 // Implements typed tests.
17377 
17378 #if GTEST_HAS_TYPED_TEST
17379 
17380 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17381 //
17382 // Expands to the name of the typedef for the type parameters of the
17383 // given test case.
17384 # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
17385 
17386 // The 'Types' template argument below must have spaces around it
17387 // since some compilers may choke on '>>' when passing a template
17388 // instance (e.g. Types<int>)
17389 # define TYPED_TEST_CASE(CaseName, Types) \
17390   typedef ::testing::internal::TypeList< Types >::type \
17391       GTEST_TYPE_PARAMS_(CaseName)
17392 
17393 # define TYPED_TEST(CaseName, TestName) \
17394   template <typename gtest_TypeParam_> \
17395   class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
17396       : public CaseName<gtest_TypeParam_> { \
17397    private: \
17398     typedef CaseName<gtest_TypeParam_> TestFixture; \
17399     typedef gtest_TypeParam_ TypeParam; \
17400     virtual void TestBody(); \
17401   }; \
17402   bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
17403       ::testing::internal::TypeParameterizedTest< \
17404           CaseName, \
17405           ::testing::internal::TemplateSel< \
17406               GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
17407           GTEST_TYPE_PARAMS_(CaseName)>::Register(\
17408               "", #CaseName, #TestName, 0); \
17409   template <typename gtest_TypeParam_> \
17410   void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
17411 
17412 #endif  // GTEST_HAS_TYPED_TEST
17413 
17414 // Implements type-parameterized tests.
17415 
17416 #if GTEST_HAS_TYPED_TEST_P
17417 
17418 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17419 //
17420 // Expands to the namespace name that the type-parameterized tests for
17421 // the given type-parameterized test case are defined in.  The exact
17422 // name of the namespace is subject to change without notice.
17423 # define GTEST_CASE_NAMESPACE_(TestCaseName) \
17424   gtest_case_##TestCaseName##_
17425 
17426 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17427 //
17428 // Expands to the name of the variable used to remember the names of
17429 // the defined tests in the given test case.
17430 # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
17431   gtest_typed_test_case_p_state_##TestCaseName##_
17432 
17433 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
17434 //
17435 // Expands to the name of the variable used to remember the names of
17436 // the registered tests in the given test case.
17437 # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
17438   gtest_registered_test_names_##TestCaseName##_
17439 
17440 // The variables defined in the type-parameterized test macros are
17441 // static as typically these macros are used in a .h file that can be
17442 // #included in multiple translation units linked together.
17443 # define TYPED_TEST_CASE_P(CaseName) \
17444   static ::testing::internal::TypedTestCasePState \
17445       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
17446 
17447 # define TYPED_TEST_P(CaseName, TestName) \
17448   namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17449   template <typename gtest_TypeParam_> \
17450   class TestName : public CaseName<gtest_TypeParam_> { \
17451    private: \
17452     typedef CaseName<gtest_TypeParam_> TestFixture; \
17453     typedef gtest_TypeParam_ TypeParam; \
17454     virtual void TestBody(); \
17455   }; \
17456   static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
17457       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
17458           __FILE__, __LINE__, #CaseName, #TestName); \
17459   } \
17460   template <typename gtest_TypeParam_> \
17461   void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
17462 
17463 # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
17464   namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17465   typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
17466   } \
17467   static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
17468       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
17469           __FILE__, __LINE__, #__VA_ARGS__)
17470 
17471 // The 'Types' template argument below must have spaces around it
17472 // since some compilers may choke on '>>' when passing a template
17473 // instance (e.g. Types<int>)
17474 # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
17475   bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
17476       ::testing::internal::TypeParameterizedTestCase<CaseName, \
17477           GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
17478           ::testing::internal::TypeList< Types >::type>::Register(\
17479               #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
17480 
17481 #endif  // GTEST_HAS_TYPED_TEST_P
17482 
17483 #endif  // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17484 
17485 // Depending on the platform, different string classes are available.
17486 // On Linux, in addition to ::std::string, Google also makes use of
17487 // class ::string, which has the same interface as ::std::string, but
17488 // has a different implementation.
17489 //
17490 // The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
17491 // ::string is available AND is a distinct type to ::std::string, or
17492 // define it to 0 to indicate otherwise.
17493 //
17494 // If the user's ::std::string and ::string are the same class due to
17495 // aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
17496 //
17497 // If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
17498 // heuristically.
17499 
17500 namespace testing {
17501 
17502 // Declares the flags.
17503 
17504 // This flag temporary enables the disabled tests.
17505 GTEST_DECLARE_bool_(also_run_disabled_tests);
17506 
17507 // This flag brings the debugger on an assertion failure.
17508 GTEST_DECLARE_bool_(break_on_failure);
17509 
17510 // This flag controls whether Google Test catches all test-thrown exceptions
17511 // and logs them as failures.
17512 GTEST_DECLARE_bool_(catch_exceptions);
17513 
17514 // This flag enables using colors in terminal output. Available values are
17515 // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
17516 // to let Google Test decide.
17517 GTEST_DECLARE_string_(color);
17518 
17519 // This flag sets up the filter to select by name using a glob pattern
17520 // the tests to run. If the filter is not given all tests are executed.
17521 GTEST_DECLARE_string_(filter);
17522 
17523 // This flag causes the Google Test to list tests. None of the tests listed
17524 // are actually run if the flag is provided.
17525 GTEST_DECLARE_bool_(list_tests);
17526 
17527 // This flag controls whether Google Test emits a detailed XML report to a file
17528 // in addition to its normal textual output.
17529 GTEST_DECLARE_string_(output);
17530 
17531 // This flags control whether Google Test prints the elapsed time for each
17532 // test.
17533 GTEST_DECLARE_bool_(print_time);
17534 
17535 // This flag specifies the random number seed.
17536 GTEST_DECLARE_int32_(random_seed);
17537 
17538 // This flag sets how many times the tests are repeated. The default value
17539 // is 1. If the value is -1 the tests are repeating forever.
17540 GTEST_DECLARE_int32_(repeat);
17541 
17542 // This flag controls whether Google Test includes Google Test internal
17543 // stack frames in failure stack traces.
17544 GTEST_DECLARE_bool_(show_internal_stack_frames);
17545 
17546 // When this flag is specified, tests' order is randomized on every iteration.
17547 GTEST_DECLARE_bool_(shuffle);
17548 
17549 // This flag specifies the maximum number of stack frames to be
17550 // printed in a failure message.
17551 GTEST_DECLARE_int32_(stack_trace_depth);
17552 
17553 // When this flag is specified, a failed assertion will throw an
17554 // exception if exceptions are enabled, or exit the program with a
17555 // non-zero code otherwise.
17556 GTEST_DECLARE_bool_(throw_on_failure);
17557 
17558 // When this flag is set with a "host:port" string, on supported
17559 // platforms test results are streamed to the specified port on
17560 // the specified host machine.
17561 GTEST_DECLARE_string_(stream_result_to);
17562 
17563 // The upper limit for valid stack trace depths.
17564 const int kMaxStackTraceDepth = 100;
17565 
17566 namespace internal {
17567 
17568 class AssertHelper;
17569 class DefaultGlobalTestPartResultReporter;
17570 class ExecDeathTest;
17571 class NoExecDeathTest;
17572 class FinalSuccessChecker;
17573 class GTestFlagSaver;
17574 class StreamingListenerTest;
17575 class TestResultAccessor;
17576 class TestEventListenersAccessor;
17577 class TestEventRepeater;
17578 class UnitTestRecordPropertyTestHelper;
17579 class WindowsDeathTest;
17580 class UnitTestImpl* GetUnitTestImpl();
17581 void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
17582                                     const std::string& message);
17583 
17584 }  // namespace internal
17585 
17586 // The friend relationship of some of these classes is cyclic.
17587 // If we don't forward declare them the compiler might confuse the classes
17588 // in friendship clauses with same named classes on the scope.
17589 class Test;
17590 class TestCase;
17591 class TestInfo;
17592 class UnitTest;
17593 
17594 // A class for indicating whether an assertion was successful.  When
17595 // the assertion wasn't successful, the AssertionResult object
17596 // remembers a non-empty message that describes how it failed.
17597 //
17598 // To create an instance of this class, use one of the factory functions
17599 // (AssertionSuccess() and AssertionFailure()).
17600 //
17601 // This class is useful for two purposes:
17602 //   1. Defining predicate functions to be used with Boolean test assertions
17603 //      EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
17604 //   2. Defining predicate-format functions to be
17605 //      used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
17606 //
17607 // For example, if you define IsEven predicate:
17608 //
17609 //   testing::AssertionResult IsEven(int n) {
17610 //     if ((n % 2) == 0)
17611 //       return testing::AssertionSuccess();
17612 //     else
17613 //       return testing::AssertionFailure() << n << " is odd";
17614 //   }
17615 //
17616 // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
17617 // will print the message
17618 //
17619 //   Value of: IsEven(Fib(5))
17620 //     Actual: false (5 is odd)
17621 //   Expected: true
17622 //
17623 // instead of a more opaque
17624 //
17625 //   Value of: IsEven(Fib(5))
17626 //     Actual: false
17627 //   Expected: true
17628 //
17629 // in case IsEven is a simple Boolean predicate.
17630 //
17631 // If you expect your predicate to be reused and want to support informative
17632 // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
17633 // about half as often as positive ones in our tests), supply messages for
17634 // both success and failure cases:
17635 //
17636 //   testing::AssertionResult IsEven(int n) {
17637 //     if ((n % 2) == 0)
17638 //       return testing::AssertionSuccess() << n << " is even";
17639 //     else
17640 //       return testing::AssertionFailure() << n << " is odd";
17641 //   }
17642 //
17643 // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
17644 //
17645 //   Value of: IsEven(Fib(6))
17646 //     Actual: true (8 is even)
17647 //   Expected: false
17648 //
17649 // NB: Predicates that support negative Boolean assertions have reduced
17650 // performance in positive ones so be careful not to use them in tests
17651 // that have lots (tens of thousands) of positive Boolean assertions.
17652 //
17653 // To use this class with EXPECT_PRED_FORMAT assertions such as:
17654 //
17655 //   // Verifies that Foo() returns an even number.
17656 //   EXPECT_PRED_FORMAT1(IsEven, Foo());
17657 //
17658 // you need to define:
17659 //
17660 //   testing::AssertionResult IsEven(const char* expr, int n) {
17661 //     if ((n % 2) == 0)
17662 //       return testing::AssertionSuccess();
17663 //     else
17664 //       return testing::AssertionFailure()
17665 //         << "Expected: " << expr << " is even\n  Actual: it's " << n;
17666 //   }
17667 //
17668 // If Foo() returns 5, you will see the following message:
17669 //
17670 //   Expected: Foo() is even
17671 //     Actual: it's 5
17672 //
17673 class GTEST_API_ AssertionResult {
17674  public:
17675   // Copy constructor.
17676   // Used in EXPECT_TRUE/FALSE(assertion_result).
17677   AssertionResult(const AssertionResult& other);
17678   // Used in the EXPECT_TRUE/FALSE(bool_expression).
17679   explicit AssertionResult(bool success) : success_(success) {}
17680 
17681   // Returns true iff the assertion succeeded.
17682   operator bool() const { return success_; }  // NOLINT
17683 
17684   // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
17685   AssertionResult operator!() const;
17686 
17687   // Returns the text streamed into this AssertionResult. Test assertions
17688   // use it when they fail (i.e., the predicate's outcome doesn't match the
17689   // assertion's expectation). When nothing has been streamed into the
17690   // object, returns an empty string.
17691   const char* message() const {
17692     return message_.get() != NULL ?  message_->c_str() : "";
17693   }
17694   // TODO(vladl@google.com): Remove this after making sure no clients use it.
17695   // Deprecated; please use message() instead.
17696   const char* failure_message() const { return message(); }
17697 
17698   // Streams a custom failure message into this object.
17699   template <typename T> AssertionResult& operator<<(const T& value) {
17700     AppendMessage(Message() << value);
17701     return *this;
17702   }
17703 
17704   // Allows streaming basic output manipulators such as endl or flush into
17705   // this object.
17706   AssertionResult& operator<<(
17707       ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
17708     AppendMessage(Message() << basic_manipulator);
17709     return *this;
17710   }
17711 
17712  private:
17713   // Appends the contents of message to message_.
17714   void AppendMessage(const Message& a_message) {
17715     if (message_.get() == NULL)
17716       message_.reset(new ::std::string);
17717     message_->append(a_message.GetString().c_str());
17718   }
17719 
17720   // Stores result of the assertion predicate.
17721   bool success_;
17722   // Stores the message describing the condition in case the expectation
17723   // construct is not satisfied with the predicate's outcome.
17724   // Referenced via a pointer to avoid taking too much stack frame space
17725   // with test assertions.
17726   internal::scoped_ptr< ::std::string> message_;
17727 
17728   GTEST_DISALLOW_ASSIGN_(AssertionResult);
17729 };
17730 
17731 // Makes a successful assertion result.
17732 GTEST_API_ AssertionResult AssertionSuccess();
17733 
17734 // Makes a failed assertion result.
17735 GTEST_API_ AssertionResult AssertionFailure();
17736 
17737 // Makes a failed assertion result with the given failure message.
17738 // Deprecated; use AssertionFailure() << msg.
17739 GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
17740 
17741 // The abstract class that all tests inherit from.
17742 //
17743 // In Google Test, a unit test program contains one or many TestCases, and
17744 // each TestCase contains one or many Tests.
17745 //
17746 // When you define a test using the TEST macro, you don't need to
17747 // explicitly derive from Test - the TEST macro automatically does
17748 // this for you.
17749 //
17750 // The only time you derive from Test is when defining a test fixture
17751 // to be used a TEST_F.  For example:
17752 //
17753 //   class FooTest : public testing::Test {
17754 //    protected:
17755 //     virtual void SetUp() { ... }
17756 //     virtual void TearDown() { ... }
17757 //     ...
17758 //   };
17759 //
17760 //   TEST_F(FooTest, Bar) { ... }
17761 //   TEST_F(FooTest, Baz) { ... }
17762 //
17763 // Test is not copyable.
17764 class GTEST_API_ Test {
17765  public:
17766   friend class TestInfo;
17767 
17768   // Defines types for pointers to functions that set up and tear down
17769   // a test case.
17770   typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
17771   typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
17772 
17773   // The d'tor is virtual as we intend to inherit from Test.
17774   virtual ~Test();
17775 
17776   // Sets up the stuff shared by all tests in this test case.
17777   //
17778   // Google Test will call Foo::SetUpTestCase() before running the first
17779   // test in test case Foo.  Hence a sub-class can define its own
17780   // SetUpTestCase() method to shadow the one defined in the super
17781   // class.
17782   static void SetUpTestCase() {}
17783 
17784   // Tears down the stuff shared by all tests in this test case.
17785   //
17786   // Google Test will call Foo::TearDownTestCase() after running the last
17787   // test in test case Foo.  Hence a sub-class can define its own
17788   // TearDownTestCase() method to shadow the one defined in the super
17789   // class.
17790   static void TearDownTestCase() {}
17791 
17792   // Returns true iff the current test has a fatal failure.
17793   static bool HasFatalFailure();
17794 
17795   // Returns true iff the current test has a non-fatal failure.
17796   static bool HasNonfatalFailure();
17797 
17798   // Returns true iff the current test has a (either fatal or
17799   // non-fatal) failure.
17800   static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
17801 
17802   // Logs a property for the current test, test case, or for the entire
17803   // invocation of the test program when used outside of the context of a
17804   // test case.  Only the last value for a given key is remembered.  These
17805   // are public static so they can be called from utility functions that are
17806   // not members of the test fixture.  Calls to RecordProperty made during
17807   // lifespan of the test (from the moment its constructor starts to the
17808   // moment its destructor finishes) will be output in XML as attributes of
17809   // the <testcase> element.  Properties recorded from fixture's
17810   // SetUpTestCase or TearDownTestCase are logged as attributes of the
17811   // corresponding <testsuite> element.  Calls to RecordProperty made in the
17812   // global context (before or after invocation of RUN_ALL_TESTS and from
17813   // SetUp/TearDown method of Environment objects registered with Google
17814   // Test) will be output as attributes of the <testsuites> element.
17815   static void RecordProperty(const std::string& key, const std::string& value);
17816   static void RecordProperty(const std::string& key, int value);
17817 
17818  protected:
17819   // Creates a Test object.
17820   Test();
17821 
17822   // Sets up the test fixture.
17823   virtual void SetUp();
17824 
17825   // Tears down the test fixture.
17826   virtual void TearDown();
17827 
17828  private:
17829   // Returns true iff the current test has the same fixture class as
17830   // the first test in the current test case.
17831   static bool HasSameFixtureClass();
17832 
17833   // Runs the test after the test fixture has been set up.
17834   //
17835   // A sub-class must implement this to define the test logic.
17836   //
17837   // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
17838   // Instead, use the TEST or TEST_F macro.
17839   virtual void TestBody() = 0;
17840 
17841   // Sets up, executes, and tears down the test.
17842   void Run();
17843 
17844   // Deletes self.  We deliberately pick an unusual name for this
17845   // internal method to avoid clashing with names used in user TESTs.
17846   void DeleteSelf_() { delete this; }
17847 
17848   // Uses a GTestFlagSaver to save and restore all Google Test flags.
17849   const internal::GTestFlagSaver* const gtest_flag_saver_;
17850 
17851   // Often a user mis-spells SetUp() as Setup() and spends a long time
17852   // wondering why it is never called by Google Test.  The declaration of
17853   // the following method is solely for catching such an error at
17854   // compile time:
17855   //
17856   //   - The return type is deliberately chosen to be not void, so it
17857   //   will be a conflict if a user declares void Setup() in his test
17858   //   fixture.
17859   //
17860   //   - This method is private, so it will be another compiler error
17861   //   if a user calls it from his test fixture.
17862   //
17863   // DO NOT OVERRIDE THIS FUNCTION.
17864   //
17865   // If you see an error about overriding the following function or
17866   // about it being private, you have mis-spelled SetUp() as Setup().
17867   struct Setup_should_be_spelled_SetUp {};
17868   virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
17869 
17870   // We disallow copying Tests.
17871   GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
17872 };
17873 
17874 typedef internal::TimeInMillis TimeInMillis;
17875 
17876 // A copyable object representing a user specified test property which can be
17877 // output as a key/value string pair.
17878 //
17879 // Don't inherit from TestProperty as its destructor is not virtual.
17880 class TestProperty {
17881  public:
17882   // C'tor.  TestProperty does NOT have a default constructor.
17883   // Always use this constructor (with parameters) to create a
17884   // TestProperty object.
17885   TestProperty(const std::string& a_key, const std::string& a_value) :
17886     key_(a_key), value_(a_value) {
17887   }
17888 
17889   // Gets the user supplied key.
17890   const char* key() const {
17891     return key_.c_str();
17892   }
17893 
17894   // Gets the user supplied value.
17895   const char* value() const {
17896     return value_.c_str();
17897   }
17898 
17899   // Sets a new value, overriding the one supplied in the constructor.
17900   void SetValue(const std::string& new_value) {
17901     value_ = new_value;
17902   }
17903 
17904  private:
17905   // The key supplied by the user.
17906   std::string key_;
17907   // The value supplied by the user.
17908   std::string value_;
17909 };
17910 
17911 // The result of a single Test.  This includes a list of
17912 // TestPartResults, a list of TestProperties, a count of how many
17913 // death tests there are in the Test, and how much time it took to run
17914 // the Test.
17915 //
17916 // TestResult is not copyable.
17917 class GTEST_API_ TestResult {
17918  public:
17919   // Creates an empty TestResult.
17920   TestResult();
17921 
17922   // D'tor.  Do not inherit from TestResult.
17923   ~TestResult();
17924 
17925   // Gets the number of all test parts.  This is the sum of the number
17926   // of successful test parts and the number of failed test parts.
17927   int total_part_count() const;
17928 
17929   // Returns the number of the test properties.
17930   int test_property_count() const;
17931 
17932   // Returns true iff the test passed (i.e. no test part failed).
17933   bool Passed() const { return !Failed(); }
17934 
17935   // Returns true iff the test failed.
17936   bool Failed() const;
17937 
17938   // Returns true iff the test fatally failed.
17939   bool HasFatalFailure() const;
17940 
17941   // Returns true iff the test has a non-fatal failure.
17942   bool HasNonfatalFailure() const;
17943 
17944   // Returns the elapsed time, in milliseconds.
17945   TimeInMillis elapsed_time() const { return elapsed_time_; }
17946 
17947   // Returns the i-th test part result among all the results. i can range
17948   // from 0 to test_property_count() - 1. If i is not in that range, aborts
17949   // the program.
17950   const TestPartResult& GetTestPartResult(int i) const;
17951 
17952   // Returns the i-th test property. i can range from 0 to
17953   // test_property_count() - 1. If i is not in that range, aborts the
17954   // program.
17955   const TestProperty& GetTestProperty(int i) const;
17956 
17957  private:
17958   friend class TestInfo;
17959   friend class TestCase;
17960   friend class UnitTest;
17961   friend class internal::DefaultGlobalTestPartResultReporter;
17962   friend class internal::ExecDeathTest;
17963   friend class internal::TestResultAccessor;
17964   friend class internal::UnitTestImpl;
17965   friend class internal::WindowsDeathTest;
17966 
17967   // Gets the vector of TestPartResults.
17968   const std::vector<TestPartResult>& test_part_results() const {
17969     return test_part_results_;
17970   }
17971 
17972   // Gets the vector of TestProperties.
17973   const std::vector<TestProperty>& test_properties() const {
17974     return test_properties_;
17975   }
17976 
17977   // Sets the elapsed time.
17978   void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
17979 
17980   // Adds a test property to the list. The property is validated and may add
17981   // a non-fatal failure if invalid (e.g., if it conflicts with reserved
17982   // key names). If a property is already recorded for the same key, the
17983   // value will be updated, rather than storing multiple values for the same
17984   // key.  xml_element specifies the element for which the property is being
17985   // recorded and is used for validation.
17986   void RecordProperty(const std::string& xml_element,
17987                       const TestProperty& test_property);
17988 
17989   // Adds a failure if the key is a reserved attribute of Google Test
17990   // testcase tags.  Returns true if the property is valid.
17991   // TODO(russr): Validate attribute names are legal and human readable.
17992   static bool ValidateTestProperty(const std::string& xml_element,
17993                                    const TestProperty& test_property);
17994 
17995   // Adds a test part result to the list.
17996   void AddTestPartResult(const TestPartResult& test_part_result);
17997 
17998   // Returns the death test count.
17999   int death_test_count() const { return death_test_count_; }
18000 
18001   // Increments the death test count, returning the new count.
18002   int increment_death_test_count() { return ++death_test_count_; }
18003 
18004   // Clears the test part results.
18005   void ClearTestPartResults();
18006 
18007   // Clears the object.
18008   void Clear();
18009 
18010   // Protects mutable state of the property vector and of owned
18011   // properties, whose values may be updated.
18012   internal::Mutex test_properites_mutex_;
18013 
18014   // The vector of TestPartResults
18015   std::vector<TestPartResult> test_part_results_;
18016   // The vector of TestProperties
18017   std::vector<TestProperty> test_properties_;
18018   // Running count of death tests.
18019   int death_test_count_;
18020   // The elapsed time, in milliseconds.
18021   TimeInMillis elapsed_time_;
18022 
18023   // We disallow copying TestResult.
18024   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
18025 };  // class TestResult
18026 
18027 // A TestInfo object stores the following information about a test:
18028 //
18029 //   Test case name
18030 //   Test name
18031 //   Whether the test should be run
18032 //   A function pointer that creates the test object when invoked
18033 //   Test result
18034 //
18035 // The constructor of TestInfo registers itself with the UnitTest
18036 // singleton such that the RUN_ALL_TESTS() macro knows which tests to
18037 // run.
18038 class GTEST_API_ TestInfo {
18039  public:
18040   // Destructs a TestInfo object.  This function is not virtual, so
18041   // don't inherit from TestInfo.
18042   ~TestInfo();
18043 
18044   // Returns the test case name.
18045   const char* test_case_name() const { return test_case_name_.c_str(); }
18046 
18047   // Returns the test name.
18048   const char* name() const { return name_.c_str(); }
18049 
18050   // Returns the name of the parameter type, or NULL if this is not a typed
18051   // or a type-parameterized test.
18052   const char* type_param() const {
18053     if (type_param_.get() != NULL)
18054       return type_param_->c_str();
18055     return NULL;
18056   }
18057 
18058   // Returns the text representation of the value parameter, or NULL if this
18059   // is not a value-parameterized test.
18060   const char* value_param() const {
18061     if (value_param_.get() != NULL)
18062       return value_param_->c_str();
18063     return NULL;
18064   }
18065 
18066   // Returns true if this test should run, that is if the test is not
18067   // disabled (or it is disabled but the also_run_disabled_tests flag has
18068   // been specified) and its full name matches the user-specified filter.
18069   //
18070   // Google Test allows the user to filter the tests by their full names.
18071   // The full name of a test Bar in test case Foo is defined as
18072   // "Foo.Bar".  Only the tests that match the filter will run.
18073   //
18074   // A filter is a colon-separated list of glob (not regex) patterns,
18075   // optionally followed by a '-' and a colon-separated list of
18076   // negative patterns (tests to exclude).  A test is run if it
18077   // matches one of the positive patterns and does not match any of
18078   // the negative patterns.
18079   //
18080   // For example, *A*:Foo.* is a filter that matches any string that
18081   // contains the character 'A' or starts with "Foo.".
18082   bool should_run() const { return should_run_; }
18083 
18084   // Returns true iff this test will appear in the XML report.
18085   bool is_reportable() const {
18086     // For now, the XML report includes all tests matching the filter.
18087     // In the future, we may trim tests that are excluded because of
18088     // sharding.
18089     return matches_filter_;
18090   }
18091 
18092   // Returns the result of the test.
18093   const TestResult* result() const { return &result_; }
18094 
18095  private:
18096 #if GTEST_HAS_DEATH_TEST
18097   friend class internal::DefaultDeathTestFactory;
18098 #endif  // GTEST_HAS_DEATH_TEST
18099   friend class Test;
18100   friend class TestCase;
18101   friend class internal::UnitTestImpl;
18102   friend class internal::StreamingListenerTest;
18103   friend TestInfo* internal::MakeAndRegisterTestInfo(
18104       const char* test_case_name,
18105       const char* name,
18106       const char* type_param,
18107       const char* value_param,
18108       internal::TypeId fixture_class_id,
18109       Test::SetUpTestCaseFunc set_up_tc,
18110       Test::TearDownTestCaseFunc tear_down_tc,
18111       internal::TestFactoryBase* factory);
18112 
18113   // Constructs a TestInfo object. The newly constructed instance assumes
18114   // ownership of the factory object.
18115   TestInfo(const std::string& test_case_name,
18116            const std::string& name,
18117            const char* a_type_param,   // NULL if not a type-parameterized test
18118            const char* a_value_param,  // NULL if not a value-parameterized test
18119            internal::TypeId fixture_class_id,
18120            internal::TestFactoryBase* factory);
18121 
18122   // Increments the number of death tests encountered in this test so
18123   // far.
18124   int increment_death_test_count() {
18125     return result_.increment_death_test_count();
18126   }
18127 
18128   // Creates the test object, runs it, records its result, and then
18129   // deletes it.
18130   void Run();
18131 
18132   static void ClearTestResult(TestInfo* test_info) {
18133     test_info->result_.Clear();
18134   }
18135 
18136   // These fields are immutable properties of the test.
18137   const std::string test_case_name_;     // Test case name
18138   const std::string name_;               // Test name
18139   // Name of the parameter type, or NULL if this is not a typed or a
18140   // type-parameterized test.
18141   const internal::scoped_ptr<const ::std::string> type_param_;
18142   // Text representation of the value parameter, or NULL if this is not a
18143   // value-parameterized test.
18144   const internal::scoped_ptr<const ::std::string> value_param_;
18145   const internal::TypeId fixture_class_id_;   // ID of the test fixture class
18146   bool should_run_;                 // True iff this test should run
18147   bool is_disabled_;                // True iff this test is disabled
18148   bool matches_filter_;             // True if this test matches the
18149                                     // user-specified filter.
18150   internal::TestFactoryBase* const factory_;  // The factory that creates
18151                                               // the test object
18152 
18153   // This field is mutable and needs to be reset before running the
18154   // test for the second time.
18155   TestResult result_;
18156 
18157   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
18158 };
18159 
18160 // A test case, which consists of a vector of TestInfos.
18161 //
18162 // TestCase is not copyable.
18163 class GTEST_API_ TestCase {
18164  public:
18165   // Creates a TestCase with the given name.
18166   //
18167   // TestCase does NOT have a default constructor.  Always use this
18168   // constructor to create a TestCase object.
18169   //
18170   // Arguments:
18171   //
18172   //   name:         name of the test case
18173   //   a_type_param: the name of the test's type parameter, or NULL if
18174   //                 this is not a type-parameterized test.
18175   //   set_up_tc:    pointer to the function that sets up the test case
18176   //   tear_down_tc: pointer to the function that tears down the test case
18177   TestCase(const char* name, const char* a_type_param,
18178            Test::SetUpTestCaseFunc set_up_tc,
18179            Test::TearDownTestCaseFunc tear_down_tc);
18180 
18181   // Destructor of TestCase.
18182   virtual ~TestCase();
18183 
18184   // Gets the name of the TestCase.
18185   const char* name() const { return name_.c_str(); }
18186 
18187   // Returns the name of the parameter type, or NULL if this is not a
18188   // type-parameterized test case.
18189   const char* type_param() const {
18190     if (type_param_.get() != NULL)
18191       return type_param_->c_str();
18192     return NULL;
18193   }
18194 
18195   // Returns true if any test in this test case should run.
18196   bool should_run() const { return should_run_; }
18197 
18198   // Gets the number of successful tests in this test case.
18199   int successful_test_count() const;
18200 
18201   // Gets the number of failed tests in this test case.
18202   int failed_test_count() const;
18203 
18204   // Gets the number of disabled tests that will be reported in the XML report.
18205   int reportable_disabled_test_count() const;
18206 
18207   // Gets the number of disabled tests in this test case.
18208   int disabled_test_count() const;
18209 
18210   // Gets the number of tests to be printed in the XML report.
18211   int reportable_test_count() const;
18212 
18213   // Get the number of tests in this test case that should run.
18214   int test_to_run_count() const;
18215 
18216   // Gets the number of all tests in this test case.
18217   int total_test_count() const;
18218 
18219   // Returns true iff the test case passed.
18220   bool Passed() const { return !Failed(); }
18221 
18222   // Returns true iff the test case failed.
18223   bool Failed() const { return failed_test_count() > 0; }
18224 
18225   // Returns the elapsed time, in milliseconds.
18226   TimeInMillis elapsed_time() const { return elapsed_time_; }
18227 
18228   // Returns the i-th test among all the tests. i can range from 0 to
18229   // total_test_count() - 1. If i is not in that range, returns NULL.
18230   const TestInfo* GetTestInfo(int i) const;
18231 
18232   // Returns the TestResult that holds test properties recorded during
18233   // execution of SetUpTestCase and TearDownTestCase.
18234   const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
18235 
18236  private:
18237   friend class Test;
18238   friend class internal::UnitTestImpl;
18239 
18240   // Gets the (mutable) vector of TestInfos in this TestCase.
18241   std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
18242 
18243   // Gets the (immutable) vector of TestInfos in this TestCase.
18244   const std::vector<TestInfo*>& test_info_list() const {
18245     return test_info_list_;
18246   }
18247 
18248   // Returns the i-th test among all the tests. i can range from 0 to
18249   // total_test_count() - 1. If i is not in that range, returns NULL.
18250   TestInfo* GetMutableTestInfo(int i);
18251 
18252   // Sets the should_run member.
18253   void set_should_run(bool should) { should_run_ = should; }
18254 
18255   // Adds a TestInfo to this test case.  Will delete the TestInfo upon
18256   // destruction of the TestCase object.
18257   void AddTestInfo(TestInfo * test_info);
18258 
18259   // Clears the results of all tests in this test case.
18260   void ClearResult();
18261 
18262   // Clears the results of all tests in the given test case.
18263   static void ClearTestCaseResult(TestCase* test_case) {
18264     test_case->ClearResult();
18265   }
18266 
18267   // Runs every test in this TestCase.
18268   void Run();
18269 
18270   // Runs SetUpTestCase() for this TestCase.  This wrapper is needed
18271   // for catching exceptions thrown from SetUpTestCase().
18272   void RunSetUpTestCase() { (*set_up_tc_)(); }
18273 
18274   // Runs TearDownTestCase() for this TestCase.  This wrapper is
18275   // needed for catching exceptions thrown from TearDownTestCase().
18276   void RunTearDownTestCase() { (*tear_down_tc_)(); }
18277 
18278   // Returns true iff test passed.
18279   static bool TestPassed(const TestInfo* test_info) {
18280     return test_info->should_run() && test_info->result()->Passed();
18281   }
18282 
18283   // Returns true iff test failed.
18284   static bool TestFailed(const TestInfo* test_info) {
18285     return test_info->should_run() && test_info->result()->Failed();
18286   }
18287 
18288   // Returns true iff the test is disabled and will be reported in the XML
18289   // report.
18290   static bool TestReportableDisabled(const TestInfo* test_info) {
18291     return test_info->is_reportable() && test_info->is_disabled_;
18292   }
18293 
18294   // Returns true iff test is disabled.
18295   static bool TestDisabled(const TestInfo* test_info) {
18296     return test_info->is_disabled_;
18297   }
18298 
18299   // Returns true iff this test will appear in the XML report.
18300   static bool TestReportable(const TestInfo* test_info) {
18301     return test_info->is_reportable();
18302   }
18303 
18304   // Returns true if the given test should run.
18305   static bool ShouldRunTest(const TestInfo* test_info) {
18306     return test_info->should_run();
18307   }
18308 
18309   // Shuffles the tests in this test case.
18310   void ShuffleTests(internal::Random* random);
18311 
18312   // Restores the test order to before the first shuffle.
18313   void UnshuffleTests();
18314 
18315   // Name of the test case.
18316   std::string name_;
18317   // Name of the parameter type, or NULL if this is not a typed or a
18318   // type-parameterized test.
18319   const internal::scoped_ptr<const ::std::string> type_param_;
18320   // The vector of TestInfos in their original order.  It owns the
18321   // elements in the vector.
18322   std::vector<TestInfo*> test_info_list_;
18323   // Provides a level of indirection for the test list to allow easy
18324   // shuffling and restoring the test order.  The i-th element in this
18325   // vector is the index of the i-th test in the shuffled test list.
18326   std::vector<int> test_indices_;
18327   // Pointer to the function that sets up the test case.
18328   Test::SetUpTestCaseFunc set_up_tc_;
18329   // Pointer to the function that tears down the test case.
18330   Test::TearDownTestCaseFunc tear_down_tc_;
18331   // True iff any test in this test case should run.
18332   bool should_run_;
18333   // Elapsed time, in milliseconds.
18334   TimeInMillis elapsed_time_;
18335   // Holds test properties recorded during execution of SetUpTestCase and
18336   // TearDownTestCase.
18337   TestResult ad_hoc_test_result_;
18338 
18339   // We disallow copying TestCases.
18340   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
18341 };
18342 
18343 // An Environment object is capable of setting up and tearing down an
18344 // environment.  The user should subclass this to define his own
18345 // environment(s).
18346 //
18347 // An Environment object does the set-up and tear-down in virtual
18348 // methods SetUp() and TearDown() instead of the constructor and the
18349 // destructor, as:
18350 //
18351 //   1. You cannot safely throw from a destructor.  This is a problem
18352 //      as in some cases Google Test is used where exceptions are enabled, and
18353 //      we may want to implement ASSERT_* using exceptions where they are
18354 //      available.
18355 //   2. You cannot use ASSERT_* directly in a constructor or
18356 //      destructor.
18357 class Environment {
18358  public:
18359   // The d'tor is virtual as we need to subclass Environment.
18360   virtual ~Environment() {}
18361 
18362   // Override this to define how to set up the environment.
18363   virtual void SetUp() {}
18364 
18365   // Override this to define how to tear down the environment.
18366   virtual void TearDown() {}
18367  private:
18368   // If you see an error about overriding the following function or
18369   // about it being private, you have mis-spelled SetUp() as Setup().
18370   struct Setup_should_be_spelled_SetUp {};
18371   virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
18372 };
18373 
18374 // The interface for tracing execution of tests. The methods are organized in
18375 // the order the corresponding events are fired.
18376 class TestEventListener {
18377  public:
18378   virtual ~TestEventListener() {}
18379 
18380   // Fired before any test activity starts.
18381   virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
18382 
18383   // Fired before each iteration of tests starts.  There may be more than
18384   // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
18385   // index, starting from 0.
18386   virtual void OnTestIterationStart(const UnitTest& unit_test,
18387                                     int iteration) = 0;
18388 
18389   // Fired before environment set-up for each iteration of tests starts.
18390   virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
18391 
18392   // Fired after environment set-up for each iteration of tests ends.
18393   virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
18394 
18395   // Fired before the test case starts.
18396   virtual void OnTestCaseStart(const TestCase& test_case) = 0;
18397 
18398   // Fired before the test starts.
18399   virtual void OnTestStart(const TestInfo& test_info) = 0;
18400 
18401   // Fired after a failed assertion or a SUCCEED() invocation.
18402   virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
18403 
18404   // Fired after the test ends.
18405   virtual void OnTestEnd(const TestInfo& test_info) = 0;
18406 
18407   // Fired after the test case ends.
18408   virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
18409 
18410   // Fired before environment tear-down for each iteration of tests starts.
18411   virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
18412 
18413   // Fired after environment tear-down for each iteration of tests ends.
18414   virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
18415 
18416   // Fired after each iteration of tests finishes.
18417   virtual void OnTestIterationEnd(const UnitTest& unit_test,
18418                                   int iteration) = 0;
18419 
18420   // Fired after all test activities have ended.
18421   virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
18422 };
18423 
18424 // The convenience class for users who need to override just one or two
18425 // methods and are not concerned that a possible change to a signature of
18426 // the methods they override will not be caught during the build.  For
18427 // comments about each method please see the definition of TestEventListener
18428 // above.
18429 class EmptyTestEventListener : public TestEventListener {
18430  public:
18431   virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
18432   virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
18433                                     int /*iteration*/) {}
18434   virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
18435   virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
18436   virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
18437   virtual void OnTestStart(const TestInfo& /*test_info*/) {}
18438   virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
18439   virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
18440   virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
18441   virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
18442   virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
18443   virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
18444                                   int /*iteration*/) {}
18445   virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
18446 };
18447 
18448 // TestEventListeners lets users add listeners to track events in Google Test.
18449 class GTEST_API_ TestEventListeners {
18450  public:
18451   TestEventListeners();
18452   ~TestEventListeners();
18453 
18454   // Appends an event listener to the end of the list. Google Test assumes
18455   // the ownership of the listener (i.e. it will delete the listener when
18456   // the test program finishes).
18457   void Append(TestEventListener* listener);
18458 
18459   // Removes the given event listener from the list and returns it.  It then
18460   // becomes the caller's responsibility to delete the listener. Returns
18461   // NULL if the listener is not found in the list.
18462   TestEventListener* Release(TestEventListener* listener);
18463 
18464   // Returns the standard listener responsible for the default console
18465   // output.  Can be removed from the listeners list to shut down default
18466   // console output.  Note that removing this object from the listener list
18467   // with Release transfers its ownership to the caller and makes this
18468   // function return NULL the next time.
18469   TestEventListener* default_result_printer() const {
18470     return default_result_printer_;
18471   }
18472 
18473   // Returns the standard listener responsible for the default XML output
18474   // controlled by the --gtest_output=xml flag.  Can be removed from the
18475   // listeners list by users who want to shut down the default XML output
18476   // controlled by this flag and substitute it with custom one.  Note that
18477   // removing this object from the listener list with Release transfers its
18478   // ownership to the caller and makes this function return NULL the next
18479   // time.
18480   TestEventListener* default_xml_generator() const {
18481     return default_xml_generator_;
18482   }
18483 
18484  private:
18485   friend class TestCase;
18486   friend class TestInfo;
18487   friend class internal::DefaultGlobalTestPartResultReporter;
18488   friend class internal::NoExecDeathTest;
18489   friend class internal::TestEventListenersAccessor;
18490   friend class internal::UnitTestImpl;
18491 
18492   // Returns repeater that broadcasts the TestEventListener events to all
18493   // subscribers.
18494   TestEventListener* repeater();
18495 
18496   // Sets the default_result_printer attribute to the provided listener.
18497   // The listener is also added to the listener list and previous
18498   // default_result_printer is removed from it and deleted. The listener can
18499   // also be NULL in which case it will not be added to the list. Does
18500   // nothing if the previous and the current listener objects are the same.
18501   void SetDefaultResultPrinter(TestEventListener* listener);
18502 
18503   // Sets the default_xml_generator attribute to the provided listener.  The
18504   // listener is also added to the listener list and previous
18505   // default_xml_generator is removed from it and deleted. The listener can
18506   // also be NULL in which case it will not be added to the list. Does
18507   // nothing if the previous and the current listener objects are the same.
18508   void SetDefaultXmlGenerator(TestEventListener* listener);
18509 
18510   // Controls whether events will be forwarded by the repeater to the
18511   // listeners in the list.
18512   bool EventForwardingEnabled() const;
18513   void SuppressEventForwarding();
18514 
18515   // The actual list of listeners.
18516   internal::TestEventRepeater* repeater_;
18517   // Listener responsible for the standard result output.
18518   TestEventListener* default_result_printer_;
18519   // Listener responsible for the creation of the XML output file.
18520   TestEventListener* default_xml_generator_;
18521 
18522   // We disallow copying TestEventListeners.
18523   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
18524 };
18525 
18526 // A UnitTest consists of a vector of TestCases.
18527 //
18528 // This is a singleton class.  The only instance of UnitTest is
18529 // created when UnitTest::GetInstance() is first called.  This
18530 // instance is never deleted.
18531 //
18532 // UnitTest is not copyable.
18533 //
18534 // This class is thread-safe as long as the methods are called
18535 // according to their specification.
18536 class GTEST_API_ UnitTest {
18537  public:
18538   // Gets the singleton UnitTest object.  The first time this method
18539   // is called, a UnitTest object is constructed and returned.
18540   // Consecutive calls will return the same object.
18541   static UnitTest* GetInstance();
18542 
18543   // Runs all tests in this UnitTest object and prints the result.
18544   // Returns 0 if successful, or 1 otherwise.
18545   //
18546   // This method can only be called from the main thread.
18547   //
18548   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18549   int Run() GTEST_MUST_USE_RESULT_;
18550 
18551   // Returns the working directory when the first TEST() or TEST_F()
18552   // was executed.  The UnitTest object owns the string.
18553   const char* original_working_dir() const;
18554 
18555   // Returns the TestCase object for the test that's currently running,
18556   // or NULL if no test is running.
18557   const TestCase* current_test_case() const
18558       GTEST_LOCK_EXCLUDED_(mutex_);
18559 
18560   // Returns the TestInfo object for the test that's currently running,
18561   // or NULL if no test is running.
18562   const TestInfo* current_test_info() const
18563       GTEST_LOCK_EXCLUDED_(mutex_);
18564 
18565   // Returns the random seed used at the start of the current test run.
18566   int random_seed() const;
18567 
18568 #if GTEST_HAS_PARAM_TEST
18569   // Returns the ParameterizedTestCaseRegistry object used to keep track of
18570   // value-parameterized tests and instantiate and register them.
18571   //
18572   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18573   internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
18574       GTEST_LOCK_EXCLUDED_(mutex_);
18575 #endif  // GTEST_HAS_PARAM_TEST
18576 
18577   // Gets the number of successful test cases.
18578   int successful_test_case_count() const;
18579 
18580   // Gets the number of failed test cases.
18581   int failed_test_case_count() const;
18582 
18583   // Gets the number of all test cases.
18584   int total_test_case_count() const;
18585 
18586   // Gets the number of all test cases that contain at least one test
18587   // that should run.
18588   int test_case_to_run_count() const;
18589 
18590   // Gets the number of successful tests.
18591   int successful_test_count() const;
18592 
18593   // Gets the number of failed tests.
18594   int failed_test_count() const;
18595 
18596   // Gets the number of disabled tests that will be reported in the XML report.
18597   int reportable_disabled_test_count() const;
18598 
18599   // Gets the number of disabled tests.
18600   int disabled_test_count() const;
18601 
18602   // Gets the number of tests to be printed in the XML report.
18603   int reportable_test_count() const;
18604 
18605   // Gets the number of all tests.
18606   int total_test_count() const;
18607 
18608   // Gets the number of tests that should run.
18609   int test_to_run_count() const;
18610 
18611   // Gets the time of the test program start, in ms from the start of the
18612   // UNIX epoch.
18613   TimeInMillis start_timestamp() const;
18614 
18615   // Gets the elapsed time, in milliseconds.
18616   TimeInMillis elapsed_time() const;
18617 
18618   // Returns true iff the unit test passed (i.e. all test cases passed).
18619   bool Passed() const;
18620 
18621   // Returns true iff the unit test failed (i.e. some test case failed
18622   // or something outside of all tests failed).
18623   bool Failed() const;
18624 
18625   // Gets the i-th test case among all the test cases. i can range from 0 to
18626   // total_test_case_count() - 1. If i is not in that range, returns NULL.
18627   const TestCase* GetTestCase(int i) const;
18628 
18629   // Returns the TestResult containing information on test failures and
18630   // properties logged outside of individual test cases.
18631   const TestResult& ad_hoc_test_result() const;
18632 
18633   // Returns the list of event listeners that can be used to track events
18634   // inside Google Test.
18635   TestEventListeners& listeners();
18636 
18637  private:
18638   // Registers and returns a global test environment.  When a test
18639   // program is run, all global test environments will be set-up in
18640   // the order they were registered.  After all tests in the program
18641   // have finished, all global test environments will be torn-down in
18642   // the *reverse* order they were registered.
18643   //
18644   // The UnitTest object takes ownership of the given environment.
18645   //
18646   // This method can only be called from the main thread.
18647   Environment* AddEnvironment(Environment* env);
18648 
18649   // Adds a TestPartResult to the current TestResult object.  All
18650   // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
18651   // eventually call this to report their results.  The user code
18652   // should use the assertion macros instead of calling this directly.
18653   void AddTestPartResult(TestPartResult::Type result_type,
18654                          const char* file_name,
18655                          int line_number,
18656                          const std::string& message,
18657                          const std::string& os_stack_trace)
18658       GTEST_LOCK_EXCLUDED_(mutex_);
18659 
18660   // Adds a TestProperty to the current TestResult object when invoked from
18661   // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
18662   // from SetUpTestCase or TearDownTestCase, or to the global property set
18663   // when invoked elsewhere.  If the result already contains a property with
18664   // the same key, the value will be updated.
18665   void RecordProperty(const std::string& key, const std::string& value);
18666 
18667   // Gets the i-th test case among all the test cases. i can range from 0 to
18668   // total_test_case_count() - 1. If i is not in that range, returns NULL.
18669   TestCase* GetMutableTestCase(int i);
18670 
18671   // Accessors for the implementation object.
18672   internal::UnitTestImpl* impl() { return impl_; }
18673   const internal::UnitTestImpl* impl() const { return impl_; }
18674 
18675   // These classes and functions are friends as they need to access private
18676   // members of UnitTest.
18677   friend class Test;
18678   friend class internal::AssertHelper;
18679   friend class internal::ScopedTrace;
18680   friend class internal::StreamingListenerTest;
18681   friend class internal::UnitTestRecordPropertyTestHelper;
18682   friend Environment* AddGlobalTestEnvironment(Environment* env);
18683   friend internal::UnitTestImpl* internal::GetUnitTestImpl();
18684   friend void internal::ReportFailureInUnknownLocation(
18685       TestPartResult::Type result_type,
18686       const std::string& message);
18687 
18688   // Creates an empty UnitTest.
18689   UnitTest();
18690 
18691   // D'tor
18692   virtual ~UnitTest();
18693 
18694   // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
18695   // Google Test trace stack.
18696   void PushGTestTrace(const internal::TraceInfo& trace)
18697       GTEST_LOCK_EXCLUDED_(mutex_);
18698 
18699   // Pops a trace from the per-thread Google Test trace stack.
18700   void PopGTestTrace()
18701       GTEST_LOCK_EXCLUDED_(mutex_);
18702 
18703   // Protects mutable state in *impl_.  This is mutable as some const
18704   // methods need to lock it too.
18705   mutable internal::Mutex mutex_;
18706 
18707   // Opaque implementation object.  This field is never changed once
18708   // the object is constructed.  We don't mark it as const here, as
18709   // doing so will cause a warning in the constructor of UnitTest.
18710   // Mutable state in *impl_ is protected by mutex_.
18711   internal::UnitTestImpl* impl_;
18712 
18713   // We disallow copying UnitTest.
18714   GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
18715 };
18716 
18717 // A convenient wrapper for adding an environment for the test
18718 // program.
18719 //
18720 // You should call this before RUN_ALL_TESTS() is called, probably in
18721 // main().  If you use gtest_main, you need to call this before main()
18722 // starts for it to take effect.  For example, you can define a global
18723 // variable like this:
18724 //
18725 //   testing::Environment* const foo_env =
18726 //       testing::AddGlobalTestEnvironment(new FooEnvironment);
18727 //
18728 // However, we strongly recommend you to write your own main() and
18729 // call AddGlobalTestEnvironment() there, as relying on initialization
18730 // of global variables makes the code harder to read and may cause
18731 // problems when you register multiple environments from different
18732 // translation units and the environments have dependencies among them
18733 // (remember that the compiler doesn't guarantee the order in which
18734 // global variables from different translation units are initialized).
18735 inline Environment* AddGlobalTestEnvironment(Environment* env) {
18736   return UnitTest::GetInstance()->AddEnvironment(env);
18737 }
18738 
18739 // Initializes Google Test.  This must be called before calling
18740 // RUN_ALL_TESTS().  In particular, it parses a command line for the
18741 // flags that Google Test recognizes.  Whenever a Google Test flag is
18742 // seen, it is removed from argv, and *argc is decremented.
18743 //
18744 // No value is returned.  Instead, the Google Test flag variables are
18745 // updated.
18746 //
18747 // Calling the function for the second time has no user-visible effect.
18748 GTEST_API_ void InitGoogleTest(int* argc, char** argv);
18749 
18750 // This overloaded version can be used in Windows programs compiled in
18751 // UNICODE mode.
18752 GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
18753 
18754 namespace internal {
18755 
18756 // FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
18757 // value of type ToPrint that is an operand of a comparison assertion
18758 // (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in
18759 // the comparison, and is used to help determine the best way to
18760 // format the value.  In particular, when the value is a C string
18761 // (char pointer) and the other operand is an STL string object, we
18762 // want to format the C string as a string, since we know it is
18763 // compared by value with the string object.  If the value is a char
18764 // pointer but the other operand is not an STL string object, we don't
18765 // know whether the pointer is supposed to point to a NUL-terminated
18766 // string, and thus want to print it as a pointer to be safe.
18767 //
18768 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18769 
18770 // The default case.
18771 template <typename ToPrint, typename OtherOperand>
18772 class FormatForComparison {
18773  public:
18774   static ::std::string Format(const ToPrint& value) {
18775     return ::testing::PrintToString(value);
18776   }
18777 };
18778 
18779 // Array.
18780 template <typename ToPrint, size_t N, typename OtherOperand>
18781 class FormatForComparison<ToPrint[N], OtherOperand> {
18782  public:
18783   static ::std::string Format(const ToPrint* value) {
18784     return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
18785   }
18786 };
18787 
18788 // By default, print C string as pointers to be safe, as we don't know
18789 // whether they actually point to a NUL-terminated string.
18790 
18791 #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \
18792   template <typename OtherOperand>                                      \
18793   class FormatForComparison<CharType*, OtherOperand> {                  \
18794    public:                                                              \
18795     static ::std::string Format(CharType* value) {                      \
18796       return ::testing::PrintToString(static_cast<const void*>(value)); \
18797     }                                                                   \
18798   }
18799 
18800 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
18801 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
18802 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
18803 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
18804 
18805 #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
18806 
18807 // If a C string is compared with an STL string object, we know it's meant
18808 // to point to a NUL-terminated string, and thus can print it as a string.
18809 
18810 #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
18811   template <>                                                           \
18812   class FormatForComparison<CharType*, OtherStringType> {               \
18813    public:                                                              \
18814     static ::std::string Format(CharType* value) {                      \
18815       return ::testing::PrintToString(value);                           \
18816     }                                                                   \
18817   }
18818 
18819 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
18820 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
18821 
18822 #if GTEST_HAS_GLOBAL_STRING
18823 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
18824 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
18825 #endif
18826 
18827 #if GTEST_HAS_GLOBAL_WSTRING
18828 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
18829 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
18830 #endif
18831 
18832 #if GTEST_HAS_STD_WSTRING
18833 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
18834 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
18835 #endif
18836 
18837 #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
18838 
18839 // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
18840 // operand to be used in a failure message.  The type (but not value)
18841 // of the other operand may affect the format.  This allows us to
18842 // print a char* as a raw pointer when it is compared against another
18843 // char* or void*, and print it as a C string when it is compared
18844 // against an std::string object, for example.
18845 //
18846 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18847 template <typename T1, typename T2>
18848 std::string FormatForComparisonFailureMessage(
18849     const T1& value, const T2& /* other_operand */) {
18850   return FormatForComparison<T1, T2>::Format(value);
18851 }
18852 
18853 // The helper function for {ASSERT|EXPECT}_EQ.
18854 template <typename T1, typename T2>
18855 AssertionResult CmpHelperEQ(const char* expected_expression,
18856                             const char* actual_expression,
18857                             const T1& expected,
18858                             const T2& actual) {
18859 #ifdef _MSC_VER
18860 # pragma warning(push)          // Saves the current warning state.
18861 # pragma warning(disable:4389)  // Temporarily disables warning on
18862                                 // signed/unsigned mismatch.
18863 #endif
18864 
18865   if (expected == actual) {
18866     return AssertionSuccess();
18867   }
18868 
18869 #ifdef _MSC_VER
18870 # pragma warning(pop)          // Restores the warning state.
18871 #endif
18872 
18873   return EqFailure(expected_expression,
18874                    actual_expression,
18875                    FormatForComparisonFailureMessage(expected, actual),
18876                    FormatForComparisonFailureMessage(actual, expected),
18877                    false);
18878 }
18879 
18880 // With this overloaded version, we allow anonymous enums to be used
18881 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
18882 // can be implicitly cast to BiggestInt.
18883 GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
18884                                        const char* actual_expression,
18885                                        BiggestInt expected,
18886                                        BiggestInt actual);
18887 
18888 // The helper class for {ASSERT|EXPECT}_EQ.  The template argument
18889 // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
18890 // is a null pointer literal.  The following default implementation is
18891 // for lhs_is_null_literal being false.
18892 template <bool lhs_is_null_literal>
18893 class EqHelper {
18894  public:
18895   // This templatized version is for the general case.
18896   template <typename T1, typename T2>
18897   static AssertionResult Compare(const char* expected_expression,
18898                                  const char* actual_expression,
18899                                  const T1& expected,
18900                                  const T2& actual) {
18901     return CmpHelperEQ(expected_expression, actual_expression, expected,
18902                        actual);
18903   }
18904 
18905   // With this overloaded version, we allow anonymous enums to be used
18906   // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
18907   // enums can be implicitly cast to BiggestInt.
18908   //
18909   // Even though its body looks the same as the above version, we
18910   // cannot merge the two, as it will make anonymous enums unhappy.
18911   static AssertionResult Compare(const char* expected_expression,
18912                                  const char* actual_expression,
18913                                  BiggestInt expected,
18914                                  BiggestInt actual) {
18915     return CmpHelperEQ(expected_expression, actual_expression, expected,
18916                        actual);
18917   }
18918 };
18919 
18920 // This specialization is used when the first argument to ASSERT_EQ()
18921 // is a null pointer literal, like NULL, false, or 0.
18922 template <>
18923 class EqHelper<true> {
18924  public:
18925   // We define two overloaded versions of Compare().  The first
18926   // version will be picked when the second argument to ASSERT_EQ() is
18927   // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
18928   // EXPECT_EQ(false, a_bool).
18929   template <typename T1, typename T2>
18930   static AssertionResult Compare(
18931       const char* expected_expression,
18932       const char* actual_expression,
18933       const T1& expected,
18934       const T2& actual,
18935       // The following line prevents this overload from being considered if T2
18936       // is not a pointer type.  We need this because ASSERT_EQ(NULL, my_ptr)
18937       // expands to Compare("", "", NULL, my_ptr), which requires a conversion
18938       // to match the Secret* in the other overload, which would otherwise make
18939       // this template match better.
18940       typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
18941     return CmpHelperEQ(expected_expression, actual_expression, expected,
18942                        actual);
18943   }
18944 
18945   // This version will be picked when the second argument to ASSERT_EQ() is a
18946   // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
18947   template <typename T>
18948   static AssertionResult Compare(
18949       const char* expected_expression,
18950       const char* actual_expression,
18951       // We used to have a second template parameter instead of Secret*.  That
18952       // template parameter would deduce to 'long', making this a better match
18953       // than the first overload even without the first overload's EnableIf.
18954       // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
18955       // non-pointer argument" (even a deduced integral argument), so the old
18956       // implementation caused warnings in user code.
18957       Secret* /* expected (NULL) */,
18958       T* actual) {
18959     // We already know that 'expected' is a null pointer.
18960     return CmpHelperEQ(expected_expression, actual_expression,
18961                        static_cast<T*>(NULL), actual);
18962   }
18963 };
18964 
18965 // A macro for implementing the helper functions needed to implement
18966 // ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste
18967 // of similar code.
18968 //
18969 // For each templatized helper function, we also define an overloaded
18970 // version for BiggestInt in order to reduce code bloat and allow
18971 // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
18972 // with gcc 4.
18973 //
18974 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18975 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
18976 template <typename T1, typename T2>\
18977 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
18978                                    const T1& val1, const T2& val2) {\
18979   if (val1 op val2) {\
18980     return AssertionSuccess();\
18981   } else {\
18982     return AssertionFailure() \
18983         << "Expected: (" << expr1 << ") " #op " (" << expr2\
18984         << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
18985         << " vs " << FormatForComparisonFailureMessage(val2, val1);\
18986   }\
18987 }\
18988 GTEST_API_ AssertionResult CmpHelper##op_name(\
18989     const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
18990 
18991 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18992 
18993 // Implements the helper function for {ASSERT|EXPECT}_NE
18994 GTEST_IMPL_CMP_HELPER_(NE, !=);
18995 // Implements the helper function for {ASSERT|EXPECT}_LE
18996 GTEST_IMPL_CMP_HELPER_(LE, <=);
18997 // Implements the helper function for {ASSERT|EXPECT}_LT
18998 GTEST_IMPL_CMP_HELPER_(LT, <);
18999 // Implements the helper function for {ASSERT|EXPECT}_GE
19000 GTEST_IMPL_CMP_HELPER_(GE, >=);
19001 // Implements the helper function for {ASSERT|EXPECT}_GT
19002 GTEST_IMPL_CMP_HELPER_(GT, >);
19003 
19004 #undef GTEST_IMPL_CMP_HELPER_
19005 
19006 // The helper function for {ASSERT|EXPECT}_STREQ.
19007 //
19008 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19009 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19010                                           const char* actual_expression,
19011                                           const char* expected,
19012                                           const char* actual);
19013 
19014 // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
19015 //
19016 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19017 GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
19018                                               const char* actual_expression,
19019                                               const char* expected,
19020                                               const char* actual);
19021 
19022 // The helper function for {ASSERT|EXPECT}_STRNE.
19023 //
19024 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19025 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19026                                           const char* s2_expression,
19027                                           const char* s1,
19028                                           const char* s2);
19029 
19030 // The helper function for {ASSERT|EXPECT}_STRCASENE.
19031 //
19032 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19033 GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
19034                                               const char* s2_expression,
19035                                               const char* s1,
19036                                               const char* s2);
19037 
19038 
19039 // Helper function for *_STREQ on wide strings.
19040 //
19041 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19042 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19043                                           const char* actual_expression,
19044                                           const wchar_t* expected,
19045                                           const wchar_t* actual);
19046 
19047 // Helper function for *_STRNE on wide strings.
19048 //
19049 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19050 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19051                                           const char* s2_expression,
19052                                           const wchar_t* s1,
19053                                           const wchar_t* s2);
19054 
19055 }  // namespace internal
19056 
19057 // IsSubstring() and IsNotSubstring() are intended to be used as the
19058 // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
19059 // themselves.  They check whether needle is a substring of haystack
19060 // (NULL is considered a substring of itself only), and return an
19061 // appropriate error message when they fail.
19062 //
19063 // The {needle,haystack}_expr arguments are the stringified
19064 // expressions that generated the two real arguments.
19065 GTEST_API_ AssertionResult IsSubstring(
19066     const char* needle_expr, const char* haystack_expr,
19067     const char* needle, const char* haystack);
19068 GTEST_API_ AssertionResult IsSubstring(
19069     const char* needle_expr, const char* haystack_expr,
19070     const wchar_t* needle, const wchar_t* haystack);
19071 GTEST_API_ AssertionResult IsNotSubstring(
19072     const char* needle_expr, const char* haystack_expr,
19073     const char* needle, const char* haystack);
19074 GTEST_API_ AssertionResult IsNotSubstring(
19075     const char* needle_expr, const char* haystack_expr,
19076     const wchar_t* needle, const wchar_t* haystack);
19077 GTEST_API_ AssertionResult IsSubstring(
19078     const char* needle_expr, const char* haystack_expr,
19079     const ::std::string& needle, const ::std::string& haystack);
19080 GTEST_API_ AssertionResult IsNotSubstring(
19081     const char* needle_expr, const char* haystack_expr,
19082     const ::std::string& needle, const ::std::string& haystack);
19083 
19084 #if GTEST_HAS_STD_WSTRING
19085 GTEST_API_ AssertionResult IsSubstring(
19086     const char* needle_expr, const char* haystack_expr,
19087     const ::std::wstring& needle, const ::std::wstring& haystack);
19088 GTEST_API_ AssertionResult IsNotSubstring(
19089     const char* needle_expr, const char* haystack_expr,
19090     const ::std::wstring& needle, const ::std::wstring& haystack);
19091 #endif  // GTEST_HAS_STD_WSTRING
19092 
19093 namespace internal {
19094 
19095 // Helper template function for comparing floating-points.
19096 //
19097 // Template parameter:
19098 //
19099 //   RawType: the raw floating-point type (either float or double)
19100 //
19101 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19102 template <typename RawType>
19103 AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
19104                                          const char* actual_expression,
19105                                          RawType expected,
19106                                          RawType actual) {
19107   const FloatingPoint<RawType> lhs(expected), rhs(actual);
19108 
19109   if (lhs.AlmostEquals(rhs)) {
19110     return AssertionSuccess();
19111   }
19112 
19113   ::std::stringstream expected_ss;
19114   expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19115               << expected;
19116 
19117   ::std::stringstream actual_ss;
19118   actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19119             << actual;
19120 
19121   return EqFailure(expected_expression,
19122                    actual_expression,
19123                    StringStreamToString(&expected_ss),
19124                    StringStreamToString(&actual_ss),
19125                    false);
19126 }
19127 
19128 // Helper function for implementing ASSERT_NEAR.
19129 //
19130 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19131 GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
19132                                                 const char* expr2,
19133                                                 const char* abs_error_expr,
19134                                                 double val1,
19135                                                 double val2,
19136                                                 double abs_error);
19137 
19138 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19139 // A class that enables one to stream messages to assertion macros
19140 class GTEST_API_ AssertHelper {
19141  public:
19142   // Constructor.
19143   AssertHelper(TestPartResult::Type type,
19144                const char* file,
19145                int line,
19146                const char* message);
19147   ~AssertHelper();
19148 
19149   // Message assignment is a semantic trick to enable assertion
19150   // streaming; see the GTEST_MESSAGE_ macro below.
19151   void operator=(const Message& message) const;
19152 
19153  private:
19154   // We put our data in a struct so that the size of the AssertHelper class can
19155   // be as small as possible.  This is important because gcc is incapable of
19156   // re-using stack space even for temporary variables, so every EXPECT_EQ
19157   // reserves stack space for another AssertHelper.
19158   struct AssertHelperData {
19159     AssertHelperData(TestPartResult::Type t,
19160                      const char* srcfile,
19161                      int line_num,
19162                      const char* msg)
19163         : type(t), file(srcfile), line(line_num), message(msg) { }
19164 
19165     TestPartResult::Type const type;
19166     const char* const file;
19167     int const line;
19168     std::string const message;
19169 
19170    private:
19171     GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
19172   };
19173 
19174   AssertHelperData* const data_;
19175 
19176   GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
19177 };
19178 
19179 }  // namespace internal
19180 
19181 #if GTEST_HAS_PARAM_TEST
19182 // The pure interface class that all value-parameterized tests inherit from.
19183 // A value-parameterized class must inherit from both ::testing::Test and
19184 // ::testing::WithParamInterface. In most cases that just means inheriting
19185 // from ::testing::TestWithParam, but more complicated test hierarchies
19186 // may need to inherit from Test and WithParamInterface at different levels.
19187 //
19188 // This interface has support for accessing the test parameter value via
19189 // the GetParam() method.
19190 //
19191 // Use it with one of the parameter generator defining functions, like Range(),
19192 // Values(), ValuesIn(), Bool(), and Combine().
19193 //
19194 // class FooTest : public ::testing::TestWithParam<int> {
19195 //  protected:
19196 //   FooTest() {
19197 //     // Can use GetParam() here.
19198 //   }
19199 //   virtual ~FooTest() {
19200 //     // Can use GetParam() here.
19201 //   }
19202 //   virtual void SetUp() {
19203 //     // Can use GetParam() here.
19204 //   }
19205 //   virtual void TearDown {
19206 //     // Can use GetParam() here.
19207 //   }
19208 // };
19209 // TEST_P(FooTest, DoesBar) {
19210 //   // Can use GetParam() method here.
19211 //   Foo foo;
19212 //   ASSERT_TRUE(foo.DoesBar(GetParam()));
19213 // }
19214 // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
19215 
19216 template <typename T>
19217 class WithParamInterface {
19218  public:
19219   typedef T ParamType;
19220   virtual ~WithParamInterface() {}
19221 
19222   // The current parameter value. Is also available in the test fixture's
19223   // constructor. This member function is non-static, even though it only
19224   // references static data, to reduce the opportunity for incorrect uses
19225   // like writing 'WithParamInterface<bool>::GetParam()' for a test that
19226   // uses a fixture whose parameter type is int.
19227   const ParamType& GetParam() const {
19228     GTEST_CHECK_(parameter_ != NULL)
19229         << "GetParam() can only be called inside a value-parameterized test "
19230         << "-- did you intend to write TEST_P instead of TEST_F?";
19231     return *parameter_;
19232   }
19233 
19234  private:
19235   // Sets parameter value. The caller is responsible for making sure the value
19236   // remains alive and unchanged throughout the current test.
19237   static void SetParam(const ParamType* parameter) {
19238     parameter_ = parameter;
19239   }
19240 
19241   // Static value used for accessing parameter during a test lifetime.
19242   static const ParamType* parameter_;
19243 
19244   // TestClass must be a subclass of WithParamInterface<T> and Test.
19245   template <class TestClass> friend class internal::ParameterizedTestFactory;
19246 };
19247 
19248 template <typename T>
19249 const T* WithParamInterface<T>::parameter_ = NULL;
19250 
19251 // Most value-parameterized classes can ignore the existence of
19252 // WithParamInterface, and can just inherit from ::testing::TestWithParam.
19253 
19254 template <typename T>
19255 class TestWithParam : public Test, public WithParamInterface<T> {
19256 };
19257 
19258 #endif  // GTEST_HAS_PARAM_TEST
19259 
19260 // Macros for indicating success/failure in test code.
19261 
19262 // ADD_FAILURE unconditionally adds a failure to the current test.
19263 // SUCCEED generates a success - it doesn't automatically make the
19264 // current test successful, as a test is only successful when it has
19265 // no failure.
19266 //
19267 // EXPECT_* verifies that a certain condition is satisfied.  If not,
19268 // it behaves like ADD_FAILURE.  In particular:
19269 //
19270 //   EXPECT_TRUE  verifies that a Boolean condition is true.
19271 //   EXPECT_FALSE verifies that a Boolean condition is false.
19272 //
19273 // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
19274 // that they will also abort the current function on failure.  People
19275 // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
19276 // writing data-driven tests often find themselves using ADD_FAILURE
19277 // and EXPECT_* more.
19278 
19279 // Generates a nonfatal failure with a generic message.
19280 #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
19281 
19282 // Generates a nonfatal failure at the given source file location with
19283 // a generic message.
19284 #define ADD_FAILURE_AT(file, line) \
19285   GTEST_MESSAGE_AT_(file, line, "Failed", \
19286                     ::testing::TestPartResult::kNonFatalFailure)
19287 
19288 // Generates a fatal failure with a generic message.
19289 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
19290 
19291 // Define this macro to 1 to omit the definition of FAIL(), which is a
19292 // generic name and clashes with some other libraries.
19293 #if !GTEST_DONT_DEFINE_FAIL
19294 # define FAIL() GTEST_FAIL()
19295 #endif
19296 
19297 // Generates a success with a generic message.
19298 #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
19299 
19300 // Define this macro to 1 to omit the definition of SUCCEED(), which
19301 // is a generic name and clashes with some other libraries.
19302 #if !GTEST_DONT_DEFINE_SUCCEED
19303 # define SUCCEED() GTEST_SUCCEED()
19304 #endif
19305 
19306 // Macros for testing exceptions.
19307 //
19308 //    * {ASSERT|EXPECT}_THROW(statement, expected_exception):
19309 //         Tests that the statement throws the expected exception.
19310 //    * {ASSERT|EXPECT}_NO_THROW(statement):
19311 //         Tests that the statement doesn't throw any exception.
19312 //    * {ASSERT|EXPECT}_ANY_THROW(statement):
19313 //         Tests that the statement throws an exception.
19314 
19315 #define EXPECT_THROW(statement, expected_exception) \
19316   GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
19317 #define EXPECT_NO_THROW(statement) \
19318   GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19319 #define EXPECT_ANY_THROW(statement) \
19320   GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19321 #define ASSERT_THROW(statement, expected_exception) \
19322   GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
19323 #define ASSERT_NO_THROW(statement) \
19324   GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
19325 #define ASSERT_ANY_THROW(statement) \
19326   GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
19327 
19328 // Boolean assertions. Condition can be either a Boolean expression or an
19329 // AssertionResult. For more information on how to use AssertionResult with
19330 // these macros see comments on that class.
19331 #define EXPECT_TRUE(condition) \
19332   GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19333                       GTEST_NONFATAL_FAILURE_)
19334 #define EXPECT_FALSE(condition) \
19335   GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19336                       GTEST_NONFATAL_FAILURE_)
19337 #define ASSERT_TRUE(condition) \
19338   GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19339                       GTEST_FATAL_FAILURE_)
19340 #define ASSERT_FALSE(condition) \
19341   GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19342                       GTEST_FATAL_FAILURE_)
19343 
19344 // Includes the auto-generated header that implements a family of
19345 // generic predicate assertion macros.
19346 // Copyright 2006, Google Inc.
19347 // All rights reserved.
19348 //
19349 // Redistribution and use in source and binary forms, with or without
19350 // modification, are permitted provided that the following conditions are
19351 // met:
19352 //
19353 //     * Redistributions of source code must retain the above copyright
19354 // notice, this list of conditions and the following disclaimer.
19355 //     * Redistributions in binary form must reproduce the above
19356 // copyright notice, this list of conditions and the following disclaimer
19357 // in the documentation and/or other materials provided with the
19358 // distribution.
19359 //     * Neither the name of Google Inc. nor the names of its
19360 // contributors may be used to endorse or promote products derived from
19361 // this software without specific prior written permission.
19362 //
19363 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19364 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19365 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19366 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19367 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19368 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19369 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19370 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19371 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19372 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19373 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19374 
19375 // This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
19376 // 'gen_gtest_pred_impl.py 5'.  DO NOT EDIT BY HAND!
19377 //
19378 // Implements a family of generic predicate assertion macros.
19379 
19380 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19381 #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19382 
19383 // Makes sure this header is not included before gtest.h.
19384 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
19385 # error Do not include gtest_pred_impl.h directly.  Include gtest.h instead.
19386 #endif  // GTEST_INCLUDE_GTEST_GTEST_H_
19387 
19388 // This header implements a family of generic predicate assertion
19389 // macros:
19390 //
19391 //   ASSERT_PRED_FORMAT1(pred_format, v1)
19392 //   ASSERT_PRED_FORMAT2(pred_format, v1, v2)
19393 //   ...
19394 //
19395 // where pred_format is a function or functor that takes n (in the
19396 // case of ASSERT_PRED_FORMATn) values and their source expression
19397 // text, and returns a testing::AssertionResult.  See the definition
19398 // of ASSERT_EQ in gtest.h for an example.
19399 //
19400 // If you don't care about formatting, you can use the more
19401 // restrictive version:
19402 //
19403 //   ASSERT_PRED1(pred, v1)
19404 //   ASSERT_PRED2(pred, v1, v2)
19405 //   ...
19406 //
19407 // where pred is an n-ary function or functor that returns bool,
19408 // and the values v1, v2, ..., must support the << operator for
19409 // streaming to std::ostream.
19410 //
19411 // We also define the EXPECT_* variations.
19412 //
19413 // For now we only support predicates whose arity is at most 5.
19414 // Please email googletestframework@googlegroups.com if you need
19415 // support for higher arities.
19416 
19417 // GTEST_ASSERT_ is the basic statement to which all of the assertions
19418 // in this file reduce.  Don't use this in your code.
19419 
19420 #define GTEST_ASSERT_(expression, on_failure) \
19421   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
19422   if (const ::testing::AssertionResult gtest_ar = (expression)) \
19423     ; \
19424   else \
19425     on_failure(gtest_ar.failure_message())
19426 
19427 
19428 // Helper function for implementing {EXPECT|ASSERT}_PRED1.  Don't use
19429 // this in your code.
19430 template <typename Pred,
19431           typename T1>
19432 AssertionResult AssertPred1Helper(const char* pred_text,
19433                                   const char* e1,
19434                                   Pred pred,
19435                                   const T1& v1) {
19436   if (pred(v1)) return AssertionSuccess();
19437 
19438   return AssertionFailure() << pred_text << "("
19439                             << e1 << ") evaluates to false, where"
19440                             << "\n" << e1 << " evaluates to " << v1;
19441 }
19442 
19443 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
19444 // Don't use this in your code.
19445 #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
19446   GTEST_ASSERT_(pred_format(#v1, v1), \
19447                 on_failure)
19448 
19449 // Internal macro for implementing {EXPECT|ASSERT}_PRED1.  Don't use
19450 // this in your code.
19451 #define GTEST_PRED1_(pred, v1, on_failure)\
19452   GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
19453                                              #v1, \
19454                                              pred, \
19455                                              v1), on_failure)
19456 
19457 // Unary predicate assertion macros.
19458 #define EXPECT_PRED_FORMAT1(pred_format, v1) \
19459   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
19460 #define EXPECT_PRED1(pred, v1) \
19461   GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
19462 #define ASSERT_PRED_FORMAT1(pred_format, v1) \
19463   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
19464 #define ASSERT_PRED1(pred, v1) \
19465   GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
19466 
19467 
19468 
19469 // Helper function for implementing {EXPECT|ASSERT}_PRED2.  Don't use
19470 // this in your code.
19471 template <typename Pred,
19472           typename T1,
19473           typename T2>
19474 AssertionResult AssertPred2Helper(const char* pred_text,
19475                                   const char* e1,
19476                                   const char* e2,
19477                                   Pred pred,
19478                                   const T1& v1,
19479                                   const T2& v2) {
19480   if (pred(v1, v2)) return AssertionSuccess();
19481 
19482   return AssertionFailure() << pred_text << "("
19483                             << e1 << ", "
19484                             << e2 << ") evaluates to false, where"
19485                             << "\n" << e1 << " evaluates to " << v1
19486                             << "\n" << e2 << " evaluates to " << v2;
19487 }
19488 
19489 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
19490 // Don't use this in your code.
19491 #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
19492   GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
19493                 on_failure)
19494 
19495 // Internal macro for implementing {EXPECT|ASSERT}_PRED2.  Don't use
19496 // this in your code.
19497 #define GTEST_PRED2_(pred, v1, v2, on_failure)\
19498   GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
19499                                              #v1, \
19500                                              #v2, \
19501                                              pred, \
19502                                              v1, \
19503                                              v2), on_failure)
19504 
19505 // Binary predicate assertion macros.
19506 #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
19507   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
19508 #define EXPECT_PRED2(pred, v1, v2) \
19509   GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
19510 #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
19511   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
19512 #define ASSERT_PRED2(pred, v1, v2) \
19513   GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
19514 
19515 
19516 
19517 // Helper function for implementing {EXPECT|ASSERT}_PRED3.  Don't use
19518 // this in your code.
19519 template <typename Pred,
19520           typename T1,
19521           typename T2,
19522           typename T3>
19523 AssertionResult AssertPred3Helper(const char* pred_text,
19524                                   const char* e1,
19525                                   const char* e2,
19526                                   const char* e3,
19527                                   Pred pred,
19528                                   const T1& v1,
19529                                   const T2& v2,
19530                                   const T3& v3) {
19531   if (pred(v1, v2, v3)) return AssertionSuccess();
19532 
19533   return AssertionFailure() << pred_text << "("
19534                             << e1 << ", "
19535                             << e2 << ", "
19536                             << e3 << ") evaluates to false, where"
19537                             << "\n" << e1 << " evaluates to " << v1
19538                             << "\n" << e2 << " evaluates to " << v2
19539                             << "\n" << e3 << " evaluates to " << v3;
19540 }
19541 
19542 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
19543 // Don't use this in your code.
19544 #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
19545   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
19546                 on_failure)
19547 
19548 // Internal macro for implementing {EXPECT|ASSERT}_PRED3.  Don't use
19549 // this in your code.
19550 #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
19551   GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
19552                                              #v1, \
19553                                              #v2, \
19554                                              #v3, \
19555                                              pred, \
19556                                              v1, \
19557                                              v2, \
19558                                              v3), on_failure)
19559 
19560 // Ternary predicate assertion macros.
19561 #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19562   GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19563 #define EXPECT_PRED3(pred, v1, v2, v3) \
19564   GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19565 #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19566   GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
19567 #define ASSERT_PRED3(pred, v1, v2, v3) \
19568   GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
19569 
19570 
19571 
19572 // Helper function for implementing {EXPECT|ASSERT}_PRED4.  Don't use
19573 // this in your code.
19574 template <typename Pred,
19575           typename T1,
19576           typename T2,
19577           typename T3,
19578           typename T4>
19579 AssertionResult AssertPred4Helper(const char* pred_text,
19580                                   const char* e1,
19581                                   const char* e2,
19582                                   const char* e3,
19583                                   const char* e4,
19584                                   Pred pred,
19585                                   const T1& v1,
19586                                   const T2& v2,
19587                                   const T3& v3,
19588                                   const T4& v4) {
19589   if (pred(v1, v2, v3, v4)) return AssertionSuccess();
19590 
19591   return AssertionFailure() << pred_text << "("
19592                             << e1 << ", "
19593                             << e2 << ", "
19594                             << e3 << ", "
19595                             << e4 << ") evaluates to false, where"
19596                             << "\n" << e1 << " evaluates to " << v1
19597                             << "\n" << e2 << " evaluates to " << v2
19598                             << "\n" << e3 << " evaluates to " << v3
19599                             << "\n" << e4 << " evaluates to " << v4;
19600 }
19601 
19602 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
19603 // Don't use this in your code.
19604 #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
19605   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
19606                 on_failure)
19607 
19608 // Internal macro for implementing {EXPECT|ASSERT}_PRED4.  Don't use
19609 // this in your code.
19610 #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
19611   GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
19612                                              #v1, \
19613                                              #v2, \
19614                                              #v3, \
19615                                              #v4, \
19616                                              pred, \
19617                                              v1, \
19618                                              v2, \
19619                                              v3, \
19620                                              v4), on_failure)
19621 
19622 // 4-ary predicate assertion macros.
19623 #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19624   GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19625 #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
19626   GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19627 #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19628   GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19629 #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
19630   GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19631 
19632 
19633 
19634 // Helper function for implementing {EXPECT|ASSERT}_PRED5.  Don't use
19635 // this in your code.
19636 template <typename Pred,
19637           typename T1,
19638           typename T2,
19639           typename T3,
19640           typename T4,
19641           typename T5>
19642 AssertionResult AssertPred5Helper(const char* pred_text,
19643                                   const char* e1,
19644                                   const char* e2,
19645                                   const char* e3,
19646                                   const char* e4,
19647                                   const char* e5,
19648                                   Pred pred,
19649                                   const T1& v1,
19650                                   const T2& v2,
19651                                   const T3& v3,
19652                                   const T4& v4,
19653                                   const T5& v5) {
19654   if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
19655 
19656   return AssertionFailure() << pred_text << "("
19657                             << e1 << ", "
19658                             << e2 << ", "
19659                             << e3 << ", "
19660                             << e4 << ", "
19661                             << e5 << ") evaluates to false, where"
19662                             << "\n" << e1 << " evaluates to " << v1
19663                             << "\n" << e2 << " evaluates to " << v2
19664                             << "\n" << e3 << " evaluates to " << v3
19665                             << "\n" << e4 << " evaluates to " << v4
19666                             << "\n" << e5 << " evaluates to " << v5;
19667 }
19668 
19669 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
19670 // Don't use this in your code.
19671 #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
19672   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
19673                 on_failure)
19674 
19675 // Internal macro for implementing {EXPECT|ASSERT}_PRED5.  Don't use
19676 // this in your code.
19677 #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
19678   GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
19679                                              #v1, \
19680                                              #v2, \
19681                                              #v3, \
19682                                              #v4, \
19683                                              #v5, \
19684                                              pred, \
19685                                              v1, \
19686                                              v2, \
19687                                              v3, \
19688                                              v4, \
19689                                              v5), on_failure)
19690 
19691 // 5-ary predicate assertion macros.
19692 #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19693   GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19694 #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
19695   GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19696 #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19697   GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19698 #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
19699   GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19700 
19701 
19702 
19703 #endif  // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19704 
19705 // Macros for testing equalities and inequalities.
19706 //
19707 //    * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
19708 //    * {ASSERT|EXPECT}_NE(v1, v2):           Tests that v1 != v2
19709 //    * {ASSERT|EXPECT}_LT(v1, v2):           Tests that v1 < v2
19710 //    * {ASSERT|EXPECT}_LE(v1, v2):           Tests that v1 <= v2
19711 //    * {ASSERT|EXPECT}_GT(v1, v2):           Tests that v1 > v2
19712 //    * {ASSERT|EXPECT}_GE(v1, v2):           Tests that v1 >= v2
19713 //
19714 // When they are not, Google Test prints both the tested expressions and
19715 // their actual values.  The values must be compatible built-in types,
19716 // or you will get a compiler error.  By "compatible" we mean that the
19717 // values can be compared by the respective operator.
19718 //
19719 // Note:
19720 //
19721 //   1. It is possible to make a user-defined type work with
19722 //   {ASSERT|EXPECT}_??(), but that requires overloading the
19723 //   comparison operators and is thus discouraged by the Google C++
19724 //   Usage Guide.  Therefore, you are advised to use the
19725 //   {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
19726 //   equal.
19727 //
19728 //   2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
19729 //   pointers (in particular, C strings).  Therefore, if you use it
19730 //   with two C strings, you are testing how their locations in memory
19731 //   are related, not how their content is related.  To compare two C
19732 //   strings by content, use {ASSERT|EXPECT}_STR*().
19733 //
19734 //   3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
19735 //   {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
19736 //   what the actual value is when it fails, and similarly for the
19737 //   other comparisons.
19738 //
19739 //   4. Do not depend on the order in which {ASSERT|EXPECT}_??()
19740 //   evaluate their arguments, which is undefined.
19741 //
19742 //   5. These macros evaluate their arguments exactly once.
19743 //
19744 // Examples:
19745 //
19746 //   EXPECT_NE(5, Foo());
19747 //   EXPECT_EQ(NULL, a_pointer);
19748 //   ASSERT_LT(i, array_size);
19749 //   ASSERT_GT(records.size(), 0) << "There is no record left.";
19750 
19751 #define EXPECT_EQ(expected, actual) \
19752   EXPECT_PRED_FORMAT2(::testing::internal:: \
19753                       EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19754                       expected, actual)
19755 #define EXPECT_NE(expected, actual) \
19756   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
19757 #define EXPECT_LE(val1, val2) \
19758   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19759 #define EXPECT_LT(val1, val2) \
19760   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19761 #define EXPECT_GE(val1, val2) \
19762   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19763 #define EXPECT_GT(val1, val2) \
19764   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19765 
19766 #define GTEST_ASSERT_EQ(expected, actual) \
19767   ASSERT_PRED_FORMAT2(::testing::internal:: \
19768                       EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19769                       expected, actual)
19770 #define GTEST_ASSERT_NE(val1, val2) \
19771   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
19772 #define GTEST_ASSERT_LE(val1, val2) \
19773   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19774 #define GTEST_ASSERT_LT(val1, val2) \
19775   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19776 #define GTEST_ASSERT_GE(val1, val2) \
19777   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19778 #define GTEST_ASSERT_GT(val1, val2) \
19779   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19780 
19781 // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
19782 // ASSERT_XY(), which clashes with some users' own code.
19783 
19784 #if !GTEST_DONT_DEFINE_ASSERT_EQ
19785 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
19786 #endif
19787 
19788 #if !GTEST_DONT_DEFINE_ASSERT_NE
19789 # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
19790 #endif
19791 
19792 #if !GTEST_DONT_DEFINE_ASSERT_LE
19793 # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
19794 #endif
19795 
19796 #if !GTEST_DONT_DEFINE_ASSERT_LT
19797 # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
19798 #endif
19799 
19800 #if !GTEST_DONT_DEFINE_ASSERT_GE
19801 # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
19802 #endif
19803 
19804 #if !GTEST_DONT_DEFINE_ASSERT_GT
19805 # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
19806 #endif
19807 
19808 // C-string Comparisons.  All tests treat NULL and any non-NULL string
19809 // as different.  Two NULLs are equal.
19810 //
19811 //    * {ASSERT|EXPECT}_STREQ(s1, s2):     Tests that s1 == s2
19812 //    * {ASSERT|EXPECT}_STRNE(s1, s2):     Tests that s1 != s2
19813 //    * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
19814 //    * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
19815 //
19816 // For wide or narrow string objects, you can use the
19817 // {ASSERT|EXPECT}_??() macros.
19818 //
19819 // Don't depend on the order in which the arguments are evaluated,
19820 // which is undefined.
19821 //
19822 // These macros evaluate their arguments exactly once.
19823 
19824 #define EXPECT_STREQ(expected, actual) \
19825   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19826 #define EXPECT_STRNE(s1, s2) \
19827   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19828 #define EXPECT_STRCASEEQ(expected, actual) \
19829   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19830 #define EXPECT_STRCASENE(s1, s2)\
19831   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19832 
19833 #define ASSERT_STREQ(expected, actual) \
19834   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19835 #define ASSERT_STRNE(s1, s2) \
19836   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19837 #define ASSERT_STRCASEEQ(expected, actual) \
19838   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19839 #define ASSERT_STRCASENE(s1, s2)\
19840   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19841 
19842 // Macros for comparing floating-point numbers.
19843 //
19844 //    * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
19845 //         Tests that two float values are almost equal.
19846 //    * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
19847 //         Tests that two double values are almost equal.
19848 //    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
19849 //         Tests that v1 and v2 are within the given distance to each other.
19850 //
19851 // Google Test uses ULP-based comparison to automatically pick a default
19852 // error bound that is appropriate for the operands.  See the
19853 // FloatingPoint template class in gtest-internal.h if you are
19854 // interested in the implementation details.
19855 
19856 #define EXPECT_FLOAT_EQ(expected, actual)\
19857   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19858                       expected, actual)
19859 
19860 #define EXPECT_DOUBLE_EQ(expected, actual)\
19861   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19862                       expected, actual)
19863 
19864 #define ASSERT_FLOAT_EQ(expected, actual)\
19865   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19866                       expected, actual)
19867 
19868 #define ASSERT_DOUBLE_EQ(expected, actual)\
19869   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19870                       expected, actual)
19871 
19872 #define EXPECT_NEAR(val1, val2, abs_error)\
19873   EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19874                       val1, val2, abs_error)
19875 
19876 #define ASSERT_NEAR(val1, val2, abs_error)\
19877   ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19878                       val1, val2, abs_error)
19879 
19880 // These predicate format functions work on floating-point values, and
19881 // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
19882 //
19883 //   EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
19884 
19885 // Asserts that val1 is less than, or almost equal to, val2.  Fails
19886 // otherwise.  In particular, it fails if either val1 or val2 is NaN.
19887 GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
19888                                    float val1, float val2);
19889 GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
19890                                     double val1, double val2);
19891 
19892 
19893 #if GTEST_OS_WINDOWS
19894 
19895 // Macros that test for HRESULT failure and success, these are only useful
19896 // on Windows, and rely on Windows SDK macros and APIs to compile.
19897 //
19898 //    * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
19899 //
19900 // When expr unexpectedly fails or succeeds, Google Test prints the
19901 // expected result and the actual result with both a human-readable
19902 // string representation of the error, if available, as well as the
19903 // hex result code.
19904 # define EXPECT_HRESULT_SUCCEEDED(expr) \
19905     EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19906 
19907 # define ASSERT_HRESULT_SUCCEEDED(expr) \
19908     ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19909 
19910 # define EXPECT_HRESULT_FAILED(expr) \
19911     EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19912 
19913 # define ASSERT_HRESULT_FAILED(expr) \
19914     ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19915 
19916 #endif  // GTEST_OS_WINDOWS
19917 
19918 // Macros that execute statement and check that it doesn't generate new fatal
19919 // failures in the current thread.
19920 //
19921 //   * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
19922 //
19923 // Examples:
19924 //
19925 //   EXPECT_NO_FATAL_FAILURE(Process());
19926 //   ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
19927 //
19928 #define ASSERT_NO_FATAL_FAILURE(statement) \
19929     GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
19930 #define EXPECT_NO_FATAL_FAILURE(statement) \
19931     GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
19932 
19933 // Causes a trace (including the source file path, the current line
19934 // number, and the given message) to be included in every test failure
19935 // message generated by code in the current scope.  The effect is
19936 // undone when the control leaves the current scope.
19937 //
19938 // The message argument can be anything streamable to std::ostream.
19939 //
19940 // In the implementation, we include the current line number as part
19941 // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
19942 // to appear in the same block - as long as they are on different
19943 // lines.
19944 #define SCOPED_TRACE(message) \
19945   ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
19946     __FILE__, __LINE__, ::testing::Message() << (message))
19947 
19948 // Compile-time assertion for type equality.
19949 // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
19950 // the same type.  The value it returns is not interesting.
19951 //
19952 // Instead of making StaticAssertTypeEq a class template, we make it a
19953 // function template that invokes a helper class template.  This
19954 // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
19955 // defining objects of that type.
19956 //
19957 // CAVEAT:
19958 //
19959 // When used inside a method of a class template,
19960 // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
19961 // instantiated.  For example, given:
19962 //
19963 //   template <typename T> class Foo {
19964 //    public:
19965 //     void Bar() { testing::StaticAssertTypeEq<int, T>(); }
19966 //   };
19967 //
19968 // the code:
19969 //
19970 //   void Test1() { Foo<bool> foo; }
19971 //
19972 // will NOT generate a compiler error, as Foo<bool>::Bar() is never
19973 // actually instantiated.  Instead, you need:
19974 //
19975 //   void Test2() { Foo<bool> foo; foo.Bar(); }
19976 //
19977 // to cause a compiler error.
19978 template <typename T1, typename T2>
19979 bool StaticAssertTypeEq() {
19980   (void)internal::StaticAssertTypeEqHelper<T1, T2>();
19981   return true;
19982 }
19983 
19984 // Defines a test.
19985 //
19986 // The first parameter is the name of the test case, and the second
19987 // parameter is the name of the test within the test case.
19988 //
19989 // The convention is to end the test case name with "Test".  For
19990 // example, a test case for the Foo class can be named FooTest.
19991 //
19992 // The user should put his test code between braces after using this
19993 // macro.  Example:
19994 //
19995 //   TEST(FooTest, InitializesCorrectly) {
19996 //     Foo foo;
19997 //     EXPECT_TRUE(foo.StatusIsOK());
19998 //   }
19999 
20000 // Note that we call GetTestTypeId() instead of GetTypeId<
20001 // ::testing::Test>() here to get the type ID of testing::Test.  This
20002 // is to work around a suspected linker bug when using Google Test as
20003 // a framework on Mac OS X.  The bug causes GetTypeId<
20004 // ::testing::Test>() to return different values depending on whether
20005 // the call is from the Google Test framework itself or from user test
20006 // code.  GetTestTypeId() is guaranteed to always return the same
20007 // value, as it always calls GetTypeId<>() from the Google Test
20008 // framework.
20009 #define GTEST_TEST(test_case_name, test_name)\
20010   GTEST_TEST_(test_case_name, test_name, \
20011               ::testing::Test, ::testing::internal::GetTestTypeId())
20012 
20013 // Define this macro to 1 to omit the definition of TEST(), which
20014 // is a generic name and clashes with some other libraries.
20015 #if !GTEST_DONT_DEFINE_TEST
20016 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
20017 #endif
20018 
20019 // Defines a test that uses a test fixture.
20020 //
20021 // The first parameter is the name of the test fixture class, which
20022 // also doubles as the test case name.  The second parameter is the
20023 // name of the test within the test case.
20024 //
20025 // A test fixture class must be declared earlier.  The user should put
20026 // his test code between braces after using this macro.  Example:
20027 //
20028 //   class FooTest : public testing::Test {
20029 //    protected:
20030 //     virtual void SetUp() { b_.AddElement(3); }
20031 //
20032 //     Foo a_;
20033 //     Foo b_;
20034 //   };
20035 //
20036 //   TEST_F(FooTest, InitializesCorrectly) {
20037 //     EXPECT_TRUE(a_.StatusIsOK());
20038 //   }
20039 //
20040 //   TEST_F(FooTest, ReturnsElementCountCorrectly) {
20041 //     EXPECT_EQ(0, a_.size());
20042 //     EXPECT_EQ(1, b_.size());
20043 //   }
20044 
20045 #define TEST_F(test_fixture, test_name)\
20046   GTEST_TEST_(test_fixture, test_name, test_fixture, \
20047               ::testing::internal::GetTypeId<test_fixture>())
20048 
20049 }  // namespace testing
20050 
20051 // Use this function in main() to run all tests.  It returns 0 if all
20052 // tests are successful, or 1 otherwise.
20053 //
20054 // RUN_ALL_TESTS() should be invoked after the command line has been
20055 // parsed by InitGoogleTest().
20056 //
20057 // This function was formerly a macro; thus, it is in the global
20058 // namespace and has an all-caps name.
20059 int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
20060 
20061 inline int RUN_ALL_TESTS() {
20062   return ::testing::UnitTest::GetInstance()->Run();
20063 }
20064 
20065 #endif  // GTEST_INCLUDE_GTEST_GTEST_H_
20066