tizen 2.3.1 release
[external/protobuf.git] / gtest / fused-src / gtest / gtest.h
1 // Copyright 2005, Google Inc.
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
8 //     * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 //     * Redistributions in binary form must reproduce the above
11 // copyright notice, this list of conditions and the following disclaimer
12 // in the documentation and/or other materials provided with the
13 // distribution.
14 //     * Neither the name of Google Inc. nor the names of its
15 // contributors may be used to endorse or promote products derived from
16 // this software without specific prior written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // Author: wan@google.com (Zhanyong Wan)
31 //
32 // The Google C++ Testing Framework (Google Test)
33 //
34 // This header file defines the public API for Google Test.  It should be
35 // included by any test program that uses Google Test.
36 //
37 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
38 // leave some internal implementation details in this header file.
39 // They are clearly marked by comments like this:
40 //
41 //   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
42 //
43 // Such code is NOT meant to be used by a user directly, and is subject
44 // to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
45 // program!
46 //
47 // Acknowledgment: Google Test borrowed the idea of automatic test
48 // registration from Barthelemy Dagenais' (barthelemy@prologique.com)
49 // easyUnit framework.
50
51 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
52 #define GTEST_INCLUDE_GTEST_GTEST_H_
53
54 #include <limits>
55 #include <ostream>
56 #include <vector>
57
58 // Copyright 2005, Google Inc.
59 // All rights reserved.
60 //
61 // Redistribution and use in source and binary forms, with or without
62 // modification, are permitted provided that the following conditions are
63 // met:
64 //
65 //     * Redistributions of source code must retain the above copyright
66 // notice, this list of conditions and the following disclaimer.
67 //     * Redistributions in binary form must reproduce the above
68 // copyright notice, this list of conditions and the following disclaimer
69 // in the documentation and/or other materials provided with the
70 // distribution.
71 //     * Neither the name of Google Inc. nor the names of its
72 // contributors may be used to endorse or promote products derived from
73 // this software without specific prior written permission.
74 //
75 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
76 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
77 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
78 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
79 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
80 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
81 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
82 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
83 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
84 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
85 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
86 //
87 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
88 //
89 // The Google C++ Testing Framework (Google Test)
90 //
91 // This header file declares functions and macros used internally by
92 // Google Test.  They are subject to change without notice.
93
94 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
95 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
96
97 // Copyright 2005, Google Inc.
98 // All rights reserved.
99 //
100 // Redistribution and use in source and binary forms, with or without
101 // modification, are permitted provided that the following conditions are
102 // met:
103 //
104 //     * Redistributions of source code must retain the above copyright
105 // notice, this list of conditions and the following disclaimer.
106 //     * Redistributions in binary form must reproduce the above
107 // copyright notice, this list of conditions and the following disclaimer
108 // in the documentation and/or other materials provided with the
109 // distribution.
110 //     * Neither the name of Google Inc. nor the names of its
111 // contributors may be used to endorse or promote products derived from
112 // this software without specific prior written permission.
113 //
114 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
115 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
116 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
117 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
118 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
119 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
120 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
121 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
122 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
123 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
124 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
125 //
126 // Authors: wan@google.com (Zhanyong Wan)
127 //
128 // Low-level types and utilities for porting Google Test to various
129 // platforms.  They are subject to change without notice.  DO NOT USE
130 // THEM IN USER CODE.
131
132 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
133 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
134
135 // The user can define the following macros in the build script to
136 // control Google Test's behavior.  If the user doesn't define a macro
137 // in this list, Google Test will define it.
138 //
139 //   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)
140 //                              is/isn't available.
141 //   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions
142 //                              are enabled.
143 //   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string
144 //                              is/isn't available (some systems define
145 //                              ::string, which is different to std::string).
146 //   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
147 //                              is/isn't available (some systems define
148 //                              ::wstring, which is different to std::wstring).
149 //   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular
150 //                              expressions are/aren't available.
151 //   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>
152 //                              is/isn't available.
153 //   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't
154 //                              enabled.
155 //   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that
156 //                              std::wstring does/doesn't work (Google Test can
157 //                              be used where std::wstring is unavailable).
158 //   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple
159 //                              is/isn't available.
160 //   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the
161 //                              compiler supports Microsoft's "Structured
162 //                              Exception Handling".
163 //   GTEST_HAS_STREAM_REDIRECTION
164 //                            - Define it to 1/0 to indicate whether the
165 //                              platform supports I/O stream redirection using
166 //                              dup() and dup2().
167 //   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google
168 //                              Test's own tr1 tuple implementation should be
169 //                              used.  Unused when the user sets
170 //                              GTEST_HAS_TR1_TUPLE to 0.
171 //   GTEST_LANG_CXX11         - Define it to 1/0 to indicate that Google Test
172 //                              is building in C++11/C++98 mode.
173 //   GTEST_LINKED_AS_SHARED_LIBRARY
174 //                            - Define to 1 when compiling tests that use
175 //                              Google Test as a shared library (known as
176 //                              DLL on Windows).
177 //   GTEST_CREATE_SHARED_LIBRARY
178 //                            - Define to 1 when compiling Google Test itself
179 //                              as a shared library.
180
181 // This header defines the following utilities:
182 //
183 // Macros indicating the current platform (defined to 1 if compiled on
184 // the given platform; otherwise undefined):
185 //   GTEST_OS_AIX      - IBM AIX
186 //   GTEST_OS_CYGWIN   - Cygwin
187 //   GTEST_OS_HPUX     - HP-UX
188 //   GTEST_OS_LINUX    - Linux
189 //     GTEST_OS_LINUX_ANDROID - Google Android
190 //   GTEST_OS_MAC      - Mac OS X
191 //     GTEST_OS_IOS    - iOS
192 //       GTEST_OS_IOS_SIMULATOR - iOS simulator
193 //   GTEST_OS_NACL     - Google Native Client (NaCl)
194 //   GTEST_OS_OPENBSD  - OpenBSD
195 //   GTEST_OS_QNX      - QNX
196 //   GTEST_OS_SOLARIS  - Sun Solaris
197 //   GTEST_OS_SYMBIAN  - Symbian
198 //   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)
199 //     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
200 //     GTEST_OS_WINDOWS_MINGW    - MinGW
201 //     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile
202 //   GTEST_OS_ZOS      - z/OS
203 //
204 // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
205 // most stable support.  Since core members of the Google Test project
206 // don't have access to other platforms, support for them may be less
207 // stable.  If you notice any problems on your platform, please notify
208 // googletestframework@googlegroups.com (patches for fixing them are
209 // even more welcome!).
210 //
211 // Note that it is possible that none of the GTEST_OS_* macros are defined.
212 //
213 // Macros indicating available Google Test features (defined to 1 if
214 // the corresponding feature is supported; otherwise undefined):
215 //   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized
216 //                            tests)
217 //   GTEST_HAS_DEATH_TEST   - death tests
218 //   GTEST_HAS_PARAM_TEST   - value-parameterized tests
219 //   GTEST_HAS_TYPED_TEST   - typed tests
220 //   GTEST_HAS_TYPED_TEST_P - type-parameterized tests
221 //   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with
222 //                            GTEST_HAS_POSIX_RE (see above) which users can
223 //                            define themselves.
224 //   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
225 //                            the above two are mutually exclusive.
226 //   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
227 //
228 // Macros for basic C++ coding:
229 //   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
230 //   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a
231 //                              variable don't have to be used.
232 //   GTEST_DISALLOW_ASSIGN_   - disables operator=.
233 //   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
234 //   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.
235 //
236 // Synchronization:
237 //   Mutex, MutexLock, ThreadLocal, GetThreadCount()
238 //                  - synchronization primitives.
239 //   GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
240 //                         synchronization primitives have real implementations
241 //                         and Google Test is thread-safe; or 0 otherwise.
242 //
243 // Template meta programming:
244 //   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.
245 //   IteratorTraits - partial implementation of std::iterator_traits, which
246 //                    is not available in libCstd when compiled with Sun C++.
247 //
248 // Smart pointers:
249 //   scoped_ptr     - as in TR2.
250 //
251 // Regular expressions:
252 //   RE             - a simple regular expression class using the POSIX
253 //                    Extended Regular Expression syntax on UNIX-like
254 //                    platforms, or a reduced regular exception syntax on
255 //                    other platforms, including Windows.
256 //
257 // Logging:
258 //   GTEST_LOG_()   - logs messages at the specified severity level.
259 //   LogToStderr()  - directs all log messages to stderr.
260 //   FlushInfoLog() - flushes informational log messages.
261 //
262 // Stdout and stderr capturing:
263 //   CaptureStdout()     - starts capturing stdout.
264 //   GetCapturedStdout() - stops capturing stdout and returns the captured
265 //                         string.
266 //   CaptureStderr()     - starts capturing stderr.
267 //   GetCapturedStderr() - stops capturing stderr and returns the captured
268 //                         string.
269 //
270 // Integer types:
271 //   TypeWithSize   - maps an integer to a int type.
272 //   Int32, UInt32, Int64, UInt64, TimeInMillis
273 //                  - integers of known sizes.
274 //   BiggestInt     - the biggest signed integer type.
275 //
276 // Command-line utilities:
277 //   GTEST_FLAG()       - references a flag.
278 //   GTEST_DECLARE_*()  - declares a flag.
279 //   GTEST_DEFINE_*()   - defines a flag.
280 //   GetInjectableArgvs() - returns the command line as a vector of strings.
281 //
282 // Environment variable utilities:
283 //   GetEnv()             - gets the value of an environment variable.
284 //   BoolFromGTestEnv()   - parses a bool environment variable.
285 //   Int32FromGTestEnv()  - parses an Int32 environment variable.
286 //   StringFromGTestEnv() - parses a string environment variable.
287
288 #include <ctype.h>   // for isspace, etc
289 #include <stddef.h>  // for ptrdiff_t
290 #include <stdlib.h>
291 #include <stdio.h>
292 #include <string.h>
293 #ifndef _WIN32_WCE
294 # include <sys/types.h>
295 # include <sys/stat.h>
296 #endif  // !_WIN32_WCE
297
298 #if defined __APPLE__
299 # include <AvailabilityMacros.h>
300 # include <TargetConditionals.h>
301 #endif
302
303 #include <iostream>  // NOLINT
304 #include <sstream>  // NOLINT
305 #include <string>  // NOLINT
306
307 #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
308 #define GTEST_FLAG_PREFIX_ "gtest_"
309 #define GTEST_FLAG_PREFIX_DASH_ "gtest-"
310 #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
311 #define GTEST_NAME_ "Google Test"
312 #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
313
314 // Determines the version of gcc that is used to compile this.
315 #ifdef __GNUC__
316 // 40302 means version 4.3.2.
317 # define GTEST_GCC_VER_ \
318     (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
319 #endif  // __GNUC__
320
321 // Determines the platform on which Google Test is compiled.
322 #ifdef __CYGWIN__
323 # define GTEST_OS_CYGWIN 1
324 #elif defined __SYMBIAN32__
325 # define GTEST_OS_SYMBIAN 1
326 #elif defined _WIN32
327 # define GTEST_OS_WINDOWS 1
328 # ifdef _WIN32_WCE
329 #  define GTEST_OS_WINDOWS_MOBILE 1
330 # elif defined(__MINGW__) || defined(__MINGW32__)
331 #  define GTEST_OS_WINDOWS_MINGW 1
332 # else
333 #  define GTEST_OS_WINDOWS_DESKTOP 1
334 # endif  // _WIN32_WCE
335 #elif defined __APPLE__
336 # define GTEST_OS_MAC 1
337 # if TARGET_OS_IPHONE
338 #  define GTEST_OS_IOS 1
339 #  if TARGET_IPHONE_SIMULATOR
340 #   define GTEST_OS_IOS_SIMULATOR 1
341 #  endif
342 # endif
343 #elif defined __linux__
344 # define GTEST_OS_LINUX 1
345 # if defined __ANDROID__
346 #  define GTEST_OS_LINUX_ANDROID 1
347 # endif
348 #elif defined __MVS__
349 # define GTEST_OS_ZOS 1
350 #elif defined(__sun) && defined(__SVR4)
351 # define GTEST_OS_SOLARIS 1
352 #elif defined(_AIX)
353 # define GTEST_OS_AIX 1
354 #elif defined(__hpux)
355 # define GTEST_OS_HPUX 1
356 #elif defined __native_client__
357 # define GTEST_OS_NACL 1
358 #elif defined __OpenBSD__
359 # define GTEST_OS_OPENBSD 1
360 #elif defined __QNX__
361 # define GTEST_OS_QNX 1
362 #endif  // __CYGWIN__
363
364 #ifndef GTEST_LANG_CXX11
365 // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
366 // -std={c,gnu}++{0x,11} is passed.  The C++11 standard specifies a
367 // value for __cplusplus, and recent versions of clang, gcc, and
368 // probably other compilers set that too in C++11 mode.
369 # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
370 // Compiling in at least C++11 mode.
371 #  define GTEST_LANG_CXX11 1
372 # else
373 #  define GTEST_LANG_CXX11 0
374 # endif
375 #endif
376
377 // Brings in definitions for functions used in the testing::internal::posix
378 // namespace (read, write, close, chdir, isatty, stat). We do not currently
379 // use them on Windows Mobile.
380 #if !GTEST_OS_WINDOWS
381 // This assumes that non-Windows OSes provide unistd.h. For OSes where this
382 // is not the case, we need to include headers that provide the functions
383 // mentioned above.
384 # include <unistd.h>
385 # include <strings.h>
386 #elif !GTEST_OS_WINDOWS_MOBILE
387 # include <direct.h>
388 # include <io.h>
389 #endif
390
391 #if GTEST_OS_LINUX_ANDROID
392 // Used to define __ANDROID_API__ matching the target NDK API level.
393 #  include <android/api-level.h>  // NOLINT
394 #endif
395
396 // Defines this to true iff Google Test can use POSIX regular expressions.
397 #ifndef GTEST_HAS_POSIX_RE
398 # if GTEST_OS_LINUX_ANDROID
399 // On Android, <regex.h> is only available starting with Gingerbread.
400 #  define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
401 # else
402 #  define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
403 # endif
404 #endif
405
406 #if GTEST_HAS_POSIX_RE
407
408 // On some platforms, <regex.h> needs someone to define size_t, and
409 // won't compile otherwise.  We can #include it here as we already
410 // included <stdlib.h>, which is guaranteed to define size_t through
411 // <stddef.h>.
412 # include <regex.h>  // NOLINT
413
414 # define GTEST_USES_POSIX_RE 1
415
416 #elif GTEST_OS_WINDOWS
417
418 // <regex.h> is not available on Windows.  Use our own simple regex
419 // implementation instead.
420 # define GTEST_USES_SIMPLE_RE 1
421
422 #else
423
424 // <regex.h> may not be available on this platform.  Use our own
425 // simple regex implementation instead.
426 # define GTEST_USES_SIMPLE_RE 1
427
428 #endif  // GTEST_HAS_POSIX_RE
429
430 #ifndef GTEST_HAS_EXCEPTIONS
431 // The user didn't tell us whether exceptions are enabled, so we need
432 // to figure it out.
433 # if defined(_MSC_VER) || defined(__BORLANDC__)
434 // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
435 // macro to enable exceptions, so we'll do the same.
436 // Assumes that exceptions are enabled by default.
437 #  ifndef _HAS_EXCEPTIONS
438 #   define _HAS_EXCEPTIONS 1
439 #  endif  // _HAS_EXCEPTIONS
440 #  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
441 # elif defined(__GNUC__) && __EXCEPTIONS
442 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
443 #  define GTEST_HAS_EXCEPTIONS 1
444 # elif defined(__SUNPRO_CC)
445 // Sun Pro CC supports exceptions.  However, there is no compile-time way of
446 // detecting whether they are enabled or not.  Therefore, we assume that
447 // they are enabled unless the user tells us otherwise.
448 #  define GTEST_HAS_EXCEPTIONS 1
449 # elif defined(__IBMCPP__) && __EXCEPTIONS
450 // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
451 #  define GTEST_HAS_EXCEPTIONS 1
452 # elif defined(__HP_aCC)
453 // Exception handling is in effect by default in HP aCC compiler. It has to
454 // be turned of by +noeh compiler option if desired.
455 #  define GTEST_HAS_EXCEPTIONS 1
456 # else
457 // For other compilers, we assume exceptions are disabled to be
458 // conservative.
459 #  define GTEST_HAS_EXCEPTIONS 0
460 # endif  // defined(_MSC_VER) || defined(__BORLANDC__)
461 #endif  // GTEST_HAS_EXCEPTIONS
462
463 #if !defined(GTEST_HAS_STD_STRING)
464 // Even though we don't use this macro any longer, we keep it in case
465 // some clients still depend on it.
466 # define GTEST_HAS_STD_STRING 1
467 #elif !GTEST_HAS_STD_STRING
468 // The user told us that ::std::string isn't available.
469 # error "Google Test cannot be used where ::std::string isn't available."
470 #endif  // !defined(GTEST_HAS_STD_STRING)
471
472 #ifndef GTEST_HAS_GLOBAL_STRING
473 // The user didn't tell us whether ::string is available, so we need
474 // to figure it out.
475
476 # define GTEST_HAS_GLOBAL_STRING 0
477
478 #endif  // GTEST_HAS_GLOBAL_STRING
479
480 #ifndef GTEST_HAS_STD_WSTRING
481 // The user didn't tell us whether ::std::wstring is available, so we need
482 // to figure it out.
483 // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
484 //   is available.
485
486 // Cygwin 1.7 and below doesn't support ::std::wstring.
487 // Solaris' libc++ doesn't support it either.  Android has
488 // no support for it at least as recent as Froyo (2.2).
489 # define GTEST_HAS_STD_WSTRING \
490     (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
491
492 #endif  // GTEST_HAS_STD_WSTRING
493
494 #ifndef GTEST_HAS_GLOBAL_WSTRING
495 // The user didn't tell us whether ::wstring is available, so we need
496 // to figure it out.
497 # define GTEST_HAS_GLOBAL_WSTRING \
498     (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
499 #endif  // GTEST_HAS_GLOBAL_WSTRING
500
501 // Determines whether RTTI is available.
502 #ifndef GTEST_HAS_RTTI
503 // The user didn't tell us whether RTTI is enabled, so we need to
504 // figure it out.
505
506 # ifdef _MSC_VER
507
508 #  ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.
509 #   define GTEST_HAS_RTTI 1
510 #  else
511 #   define GTEST_HAS_RTTI 0
512 #  endif
513
514 // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
515 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
516
517 #  ifdef __GXX_RTTI
518 // When building against STLport with the Android NDK and with
519 // -frtti -fno-exceptions, the build fails at link time with undefined
520 // references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
521 // so disable RTTI when detected.
522 #   if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
523        !defined(__EXCEPTIONS)
524 #    define GTEST_HAS_RTTI 0
525 #   else
526 #    define GTEST_HAS_RTTI 1
527 #   endif  // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
528 #  else
529 #   define GTEST_HAS_RTTI 0
530 #  endif  // __GXX_RTTI
531
532 // Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
533 // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
534 // first version with C++ support.
535 # elif defined(__clang__)
536
537 #  define GTEST_HAS_RTTI __has_feature(cxx_rtti)
538
539 // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
540 // both the typeid and dynamic_cast features are present.
541 # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
542
543 #  ifdef __RTTI_ALL__
544 #   define GTEST_HAS_RTTI 1
545 #  else
546 #   define GTEST_HAS_RTTI 0
547 #  endif
548
549 # else
550
551 // For all other compilers, we assume RTTI is enabled.
552 #  define GTEST_HAS_RTTI 1
553
554 # endif  // _MSC_VER
555
556 #endif  // GTEST_HAS_RTTI
557
558 // It's this header's responsibility to #include <typeinfo> when RTTI
559 // is enabled.
560 #if GTEST_HAS_RTTI
561 # include <typeinfo>
562 #endif
563
564 // Determines whether Google Test can use the pthreads library.
565 #ifndef GTEST_HAS_PTHREAD
566 // The user didn't tell us explicitly, so we assume pthreads support is
567 // available on Linux and Mac.
568 //
569 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
570 // to your compiler flags.
571 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
572     || GTEST_OS_QNX)
573 #endif  // GTEST_HAS_PTHREAD
574
575 #ifdef GTEST_OS_WINDOWS_MINGW
576 // Disable pthread support for MinGW for now. To enable it, we need to:
577 // 1) Implement ThreadLocal object under MinGW. The internal pthread calls are
578 //    not available on MinGW.
579 // 2) Replace the nanosleep() with usleep() for MinGW.
580 #undef GTEST_HAS_PTHREAD
581 #define GTEST_HAS_PTHREAD 0
582 #endif
583
584 #if GTEST_HAS_PTHREAD
585 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
586 // true.
587 # include <pthread.h>  // NOLINT
588
589 // For timespec and nanosleep, used below.
590 # include <time.h>  // NOLINT
591 #endif
592
593 // Determines whether Google Test can use tr1/tuple.  You can define
594 // this macro to 0 to prevent Google Test from using tuple (any
595 // feature depending on tuple with be disabled in this mode).
596 #ifndef GTEST_HAS_TR1_TUPLE
597 # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
598 // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
599 #  define GTEST_HAS_TR1_TUPLE 0
600 # else
601 // The user didn't tell us not to do it, so we assume it's OK.
602 #  define GTEST_HAS_TR1_TUPLE 1
603 # endif
604 #endif  // GTEST_HAS_TR1_TUPLE
605
606 // Determines whether Google Test's own tr1 tuple implementation
607 // should be used.
608 #ifndef GTEST_USE_OWN_TR1_TUPLE
609 // The user didn't tell us, so we need to figure it out.
610
611 // We use our own TR1 tuple if we aren't sure the user has an
612 // implementation of it already.  At this time, libstdc++ 4.0.0+ and
613 // MSVC 2010 are the only mainstream standard libraries that come
614 // with a TR1 tuple implementation.  NVIDIA's CUDA NVCC compiler
615 // pretends to be GCC by defining __GNUC__ and friends, but cannot
616 // compile GCC's tuple implementation.  MSVC 2008 (9.0) provides TR1
617 // tuple in a 323 MB Feature Pack download, which we cannot assume the
618 // user has.  QNX's QCC compiler is a modified GCC but it doesn't
619 // support TR1 tuple.  libc++ only provides std::tuple, in C++11 mode,
620 // and it can be used with some compilers that define __GNUC__.
621 # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
622       && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600
623 #  define GTEST_ENV_HAS_TR1_TUPLE_ 1
624 # endif
625
626 // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
627 // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
628 // can build with clang but need to use gcc4.2's libstdc++).
629 # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
630 #  define GTEST_ENV_HAS_STD_TUPLE_ 1
631 # endif
632
633 # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
634 #  define GTEST_USE_OWN_TR1_TUPLE 0
635 # else
636 #  define GTEST_USE_OWN_TR1_TUPLE 1
637 # endif
638
639 #endif  // GTEST_USE_OWN_TR1_TUPLE
640
641 // To avoid conditional compilation everywhere, we make it
642 // gtest-port.h's responsibility to #include the header implementing
643 // tr1/tuple.
644 #if GTEST_HAS_TR1_TUPLE
645
646 # if GTEST_USE_OWN_TR1_TUPLE
647 // This file was GENERATED by command:
648 //     pump.py gtest-tuple.h.pump
649 // DO NOT EDIT BY HAND!!!
650
651 // Copyright 2009 Google Inc.
652 // All Rights Reserved.
653 //
654 // Redistribution and use in source and binary forms, with or without
655 // modification, are permitted provided that the following conditions are
656 // met:
657 //
658 //     * Redistributions of source code must retain the above copyright
659 // notice, this list of conditions and the following disclaimer.
660 //     * Redistributions in binary form must reproduce the above
661 // copyright notice, this list of conditions and the following disclaimer
662 // in the documentation and/or other materials provided with the
663 // distribution.
664 //     * Neither the name of Google Inc. nor the names of its
665 // contributors may be used to endorse or promote products derived from
666 // this software without specific prior written permission.
667 //
668 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
669 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
670 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
671 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
672 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
673 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
674 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
675 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
676 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
677 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
678 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
679 //
680 // Author: wan@google.com (Zhanyong Wan)
681
682 // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
683
684 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
685 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
686
687 #include <utility>  // For ::std::pair.
688
689 // The compiler used in Symbian has a bug that prevents us from declaring the
690 // tuple template as a friend (it complains that tuple is redefined).  This
691 // hack bypasses the bug by declaring the members that should otherwise be
692 // private as public.
693 // Sun Studio versions < 12 also have the above bug.
694 #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
695 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
696 #else
697 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
698     template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
699    private:
700 #endif
701
702 // GTEST_n_TUPLE_(T) is the type of an n-tuple.
703 #define GTEST_0_TUPLE_(T) tuple<>
704 #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
705     void, void, void>
706 #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
707     void, void, void>
708 #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
709     void, void, void>
710 #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
711     void, void, void>
712 #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
713     void, void, void>
714 #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
715     void, void, void>
716 #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
717     void, void, void>
718 #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
719     T##7, void, void>
720 #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
721     T##7, T##8, void>
722 #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
723     T##7, T##8, T##9>
724
725 // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
726 #define GTEST_0_TYPENAMES_(T)
727 #define GTEST_1_TYPENAMES_(T) typename T##0
728 #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
729 #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
730 #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
731     typename T##3
732 #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
733     typename T##3, typename T##4
734 #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
735     typename T##3, typename T##4, typename T##5
736 #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
737     typename T##3, typename T##4, typename T##5, typename T##6
738 #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
739     typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
740 #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
741     typename T##3, typename T##4, typename T##5, typename T##6, \
742     typename T##7, typename T##8
743 #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
744     typename T##3, typename T##4, typename T##5, typename T##6, \
745     typename T##7, typename T##8, typename T##9
746
747 // In theory, defining stuff in the ::std namespace is undefined
748 // behavior.  We can do this as we are playing the role of a standard
749 // library vendor.
750 namespace std {
751 namespace tr1 {
752
753 template <typename T0 = void, typename T1 = void, typename T2 = void,
754     typename T3 = void, typename T4 = void, typename T5 = void,
755     typename T6 = void, typename T7 = void, typename T8 = void,
756     typename T9 = void>
757 class tuple;
758
759 // Anything in namespace gtest_internal is Google Test's INTERNAL
760 // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
761 namespace gtest_internal {
762
763 // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
764 template <typename T>
765 struct ByRef { typedef const T& type; };  // NOLINT
766 template <typename T>
767 struct ByRef<T&> { typedef T& type; };  // NOLINT
768
769 // A handy wrapper for ByRef.
770 #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
771
772 // AddRef<T>::type is T if T is a reference; otherwise it's T&.  This
773 // is the same as tr1::add_reference<T>::type.
774 template <typename T>
775 struct AddRef { typedef T& type; };  // NOLINT
776 template <typename T>
777 struct AddRef<T&> { typedef T& type; };  // NOLINT
778
779 // A handy wrapper for AddRef.
780 #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
781
782 // A helper for implementing get<k>().
783 template <int k> class Get;
784
785 // A helper for implementing tuple_element<k, T>.  kIndexValid is true
786 // iff k < the number of fields in tuple type T.
787 template <bool kIndexValid, int kIndex, class Tuple>
788 struct TupleElement;
789
790 template <GTEST_10_TYPENAMES_(T)>
791 struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
792   typedef T0 type;
793 };
794
795 template <GTEST_10_TYPENAMES_(T)>
796 struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
797   typedef T1 type;
798 };
799
800 template <GTEST_10_TYPENAMES_(T)>
801 struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
802   typedef T2 type;
803 };
804
805 template <GTEST_10_TYPENAMES_(T)>
806 struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
807   typedef T3 type;
808 };
809
810 template <GTEST_10_TYPENAMES_(T)>
811 struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
812   typedef T4 type;
813 };
814
815 template <GTEST_10_TYPENAMES_(T)>
816 struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
817   typedef T5 type;
818 };
819
820 template <GTEST_10_TYPENAMES_(T)>
821 struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
822   typedef T6 type;
823 };
824
825 template <GTEST_10_TYPENAMES_(T)>
826 struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
827   typedef T7 type;
828 };
829
830 template <GTEST_10_TYPENAMES_(T)>
831 struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
832   typedef T8 type;
833 };
834
835 template <GTEST_10_TYPENAMES_(T)>
836 struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
837   typedef T9 type;
838 };
839
840 }  // namespace gtest_internal
841
842 template <>
843 class tuple<> {
844  public:
845   tuple() {}
846   tuple(const tuple& /* t */)  {}
847   tuple& operator=(const tuple& /* t */) { return *this; }
848 };
849
850 template <GTEST_1_TYPENAMES_(T)>
851 class GTEST_1_TUPLE_(T) {
852  public:
853   template <int k> friend class gtest_internal::Get;
854
855   tuple() : f0_() {}
856
857   explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
858
859   tuple(const tuple& t) : f0_(t.f0_) {}
860
861   template <GTEST_1_TYPENAMES_(U)>
862   tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
863
864   tuple& operator=(const tuple& t) { return CopyFrom(t); }
865
866   template <GTEST_1_TYPENAMES_(U)>
867   tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
868     return CopyFrom(t);
869   }
870
871   GTEST_DECLARE_TUPLE_AS_FRIEND_
872
873   template <GTEST_1_TYPENAMES_(U)>
874   tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
875     f0_ = t.f0_;
876     return *this;
877   }
878
879   T0 f0_;
880 };
881
882 template <GTEST_2_TYPENAMES_(T)>
883 class GTEST_2_TUPLE_(T) {
884  public:
885   template <int k> friend class gtest_internal::Get;
886
887   tuple() : f0_(), f1_() {}
888
889   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
890       f1_(f1) {}
891
892   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
893
894   template <GTEST_2_TYPENAMES_(U)>
895   tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
896   template <typename U0, typename U1>
897   tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
898
899   tuple& operator=(const tuple& t) { return CopyFrom(t); }
900
901   template <GTEST_2_TYPENAMES_(U)>
902   tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
903     return CopyFrom(t);
904   }
905   template <typename U0, typename U1>
906   tuple& operator=(const ::std::pair<U0, U1>& p) {
907     f0_ = p.first;
908     f1_ = p.second;
909     return *this;
910   }
911
912   GTEST_DECLARE_TUPLE_AS_FRIEND_
913
914   template <GTEST_2_TYPENAMES_(U)>
915   tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
916     f0_ = t.f0_;
917     f1_ = t.f1_;
918     return *this;
919   }
920
921   T0 f0_;
922   T1 f1_;
923 };
924
925 template <GTEST_3_TYPENAMES_(T)>
926 class GTEST_3_TUPLE_(T) {
927  public:
928   template <int k> friend class gtest_internal::Get;
929
930   tuple() : f0_(), f1_(), f2_() {}
931
932   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
933       GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
934
935   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
936
937   template <GTEST_3_TYPENAMES_(U)>
938   tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
939
940   tuple& operator=(const tuple& t) { return CopyFrom(t); }
941
942   template <GTEST_3_TYPENAMES_(U)>
943   tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
944     return CopyFrom(t);
945   }
946
947   GTEST_DECLARE_TUPLE_AS_FRIEND_
948
949   template <GTEST_3_TYPENAMES_(U)>
950   tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
951     f0_ = t.f0_;
952     f1_ = t.f1_;
953     f2_ = t.f2_;
954     return *this;
955   }
956
957   T0 f0_;
958   T1 f1_;
959   T2 f2_;
960 };
961
962 template <GTEST_4_TYPENAMES_(T)>
963 class GTEST_4_TUPLE_(T) {
964  public:
965   template <int k> friend class gtest_internal::Get;
966
967   tuple() : f0_(), f1_(), f2_(), f3_() {}
968
969   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
970       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
971       f3_(f3) {}
972
973   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
974
975   template <GTEST_4_TYPENAMES_(U)>
976   tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
977       f3_(t.f3_) {}
978
979   tuple& operator=(const tuple& t) { return CopyFrom(t); }
980
981   template <GTEST_4_TYPENAMES_(U)>
982   tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
983     return CopyFrom(t);
984   }
985
986   GTEST_DECLARE_TUPLE_AS_FRIEND_
987
988   template <GTEST_4_TYPENAMES_(U)>
989   tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
990     f0_ = t.f0_;
991     f1_ = t.f1_;
992     f2_ = t.f2_;
993     f3_ = t.f3_;
994     return *this;
995   }
996
997   T0 f0_;
998   T1 f1_;
999   T2 f2_;
1000   T3 f3_;
1001 };
1002
1003 template <GTEST_5_TYPENAMES_(T)>
1004 class GTEST_5_TUPLE_(T) {
1005  public:
1006   template <int k> friend class gtest_internal::Get;
1007
1008   tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
1009
1010   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1011       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
1012       GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
1013
1014   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1015       f4_(t.f4_) {}
1016
1017   template <GTEST_5_TYPENAMES_(U)>
1018   tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1019       f3_(t.f3_), f4_(t.f4_) {}
1020
1021   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1022
1023   template <GTEST_5_TYPENAMES_(U)>
1024   tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
1025     return CopyFrom(t);
1026   }
1027
1028   GTEST_DECLARE_TUPLE_AS_FRIEND_
1029
1030   template <GTEST_5_TYPENAMES_(U)>
1031   tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
1032     f0_ = t.f0_;
1033     f1_ = t.f1_;
1034     f2_ = t.f2_;
1035     f3_ = t.f3_;
1036     f4_ = t.f4_;
1037     return *this;
1038   }
1039
1040   T0 f0_;
1041   T1 f1_;
1042   T2 f2_;
1043   T3 f3_;
1044   T4 f4_;
1045 };
1046
1047 template <GTEST_6_TYPENAMES_(T)>
1048 class GTEST_6_TUPLE_(T) {
1049  public:
1050   template <int k> friend class gtest_internal::Get;
1051
1052   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
1053
1054   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1055       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1056       GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1057       f5_(f5) {}
1058
1059   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1060       f4_(t.f4_), f5_(t.f5_) {}
1061
1062   template <GTEST_6_TYPENAMES_(U)>
1063   tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1064       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
1065
1066   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1067
1068   template <GTEST_6_TYPENAMES_(U)>
1069   tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
1070     return CopyFrom(t);
1071   }
1072
1073   GTEST_DECLARE_TUPLE_AS_FRIEND_
1074
1075   template <GTEST_6_TYPENAMES_(U)>
1076   tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
1077     f0_ = t.f0_;
1078     f1_ = t.f1_;
1079     f2_ = t.f2_;
1080     f3_ = t.f3_;
1081     f4_ = t.f4_;
1082     f5_ = t.f5_;
1083     return *this;
1084   }
1085
1086   T0 f0_;
1087   T1 f1_;
1088   T2 f2_;
1089   T3 f3_;
1090   T4 f4_;
1091   T5 f5_;
1092 };
1093
1094 template <GTEST_7_TYPENAMES_(T)>
1095 class GTEST_7_TUPLE_(T) {
1096  public:
1097   template <int k> friend class gtest_internal::Get;
1098
1099   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
1100
1101   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1102       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1103       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
1104       f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
1105
1106   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1107       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1108
1109   template <GTEST_7_TYPENAMES_(U)>
1110   tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1111       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
1112
1113   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1114
1115   template <GTEST_7_TYPENAMES_(U)>
1116   tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
1117     return CopyFrom(t);
1118   }
1119
1120   GTEST_DECLARE_TUPLE_AS_FRIEND_
1121
1122   template <GTEST_7_TYPENAMES_(U)>
1123   tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
1124     f0_ = t.f0_;
1125     f1_ = t.f1_;
1126     f2_ = t.f2_;
1127     f3_ = t.f3_;
1128     f4_ = t.f4_;
1129     f5_ = t.f5_;
1130     f6_ = t.f6_;
1131     return *this;
1132   }
1133
1134   T0 f0_;
1135   T1 f1_;
1136   T2 f2_;
1137   T3 f3_;
1138   T4 f4_;
1139   T5 f5_;
1140   T6 f6_;
1141 };
1142
1143 template <GTEST_8_TYPENAMES_(T)>
1144 class GTEST_8_TUPLE_(T) {
1145  public:
1146   template <int k> friend class gtest_internal::Get;
1147
1148   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
1149
1150   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1151       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1152       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
1153       GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1154       f5_(f5), f6_(f6), f7_(f7) {}
1155
1156   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1157       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1158
1159   template <GTEST_8_TYPENAMES_(U)>
1160   tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1161       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
1162
1163   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1164
1165   template <GTEST_8_TYPENAMES_(U)>
1166   tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
1167     return CopyFrom(t);
1168   }
1169
1170   GTEST_DECLARE_TUPLE_AS_FRIEND_
1171
1172   template <GTEST_8_TYPENAMES_(U)>
1173   tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
1174     f0_ = t.f0_;
1175     f1_ = t.f1_;
1176     f2_ = t.f2_;
1177     f3_ = t.f3_;
1178     f4_ = t.f4_;
1179     f5_ = t.f5_;
1180     f6_ = t.f6_;
1181     f7_ = t.f7_;
1182     return *this;
1183   }
1184
1185   T0 f0_;
1186   T1 f1_;
1187   T2 f2_;
1188   T3 f3_;
1189   T4 f4_;
1190   T5 f5_;
1191   T6 f6_;
1192   T7 f7_;
1193 };
1194
1195 template <GTEST_9_TYPENAMES_(T)>
1196 class GTEST_9_TUPLE_(T) {
1197  public:
1198   template <int k> friend class gtest_internal::Get;
1199
1200   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
1201
1202   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1203       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1204       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1205       GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
1206       f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
1207
1208   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1209       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1210
1211   template <GTEST_9_TYPENAMES_(U)>
1212   tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1213       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
1214
1215   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1216
1217   template <GTEST_9_TYPENAMES_(U)>
1218   tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
1219     return CopyFrom(t);
1220   }
1221
1222   GTEST_DECLARE_TUPLE_AS_FRIEND_
1223
1224   template <GTEST_9_TYPENAMES_(U)>
1225   tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
1226     f0_ = t.f0_;
1227     f1_ = t.f1_;
1228     f2_ = t.f2_;
1229     f3_ = t.f3_;
1230     f4_ = t.f4_;
1231     f5_ = t.f5_;
1232     f6_ = t.f6_;
1233     f7_ = t.f7_;
1234     f8_ = t.f8_;
1235     return *this;
1236   }
1237
1238   T0 f0_;
1239   T1 f1_;
1240   T2 f2_;
1241   T3 f3_;
1242   T4 f4_;
1243   T5 f5_;
1244   T6 f6_;
1245   T7 f7_;
1246   T8 f8_;
1247 };
1248
1249 template <GTEST_10_TYPENAMES_(T)>
1250 class tuple {
1251  public:
1252   template <int k> friend class gtest_internal::Get;
1253
1254   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
1255       f9_() {}
1256
1257   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
1258       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
1259       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
1260       GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
1261       f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
1262
1263   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
1264       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
1265
1266   template <GTEST_10_TYPENAMES_(U)>
1267   tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
1268       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
1269       f9_(t.f9_) {}
1270
1271   tuple& operator=(const tuple& t) { return CopyFrom(t); }
1272
1273   template <GTEST_10_TYPENAMES_(U)>
1274   tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
1275     return CopyFrom(t);
1276   }
1277
1278   GTEST_DECLARE_TUPLE_AS_FRIEND_
1279
1280   template <GTEST_10_TYPENAMES_(U)>
1281   tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
1282     f0_ = t.f0_;
1283     f1_ = t.f1_;
1284     f2_ = t.f2_;
1285     f3_ = t.f3_;
1286     f4_ = t.f4_;
1287     f5_ = t.f5_;
1288     f6_ = t.f6_;
1289     f7_ = t.f7_;
1290     f8_ = t.f8_;
1291     f9_ = t.f9_;
1292     return *this;
1293   }
1294
1295   T0 f0_;
1296   T1 f1_;
1297   T2 f2_;
1298   T3 f3_;
1299   T4 f4_;
1300   T5 f5_;
1301   T6 f6_;
1302   T7 f7_;
1303   T8 f8_;
1304   T9 f9_;
1305 };
1306
1307 // 6.1.3.2 Tuple creation functions.
1308
1309 // Known limitations: we don't support passing an
1310 // std::tr1::reference_wrapper<T> to make_tuple().  And we don't
1311 // implement tie().
1312
1313 inline tuple<> make_tuple() { return tuple<>(); }
1314
1315 template <GTEST_1_TYPENAMES_(T)>
1316 inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
1317   return GTEST_1_TUPLE_(T)(f0);
1318 }
1319
1320 template <GTEST_2_TYPENAMES_(T)>
1321 inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
1322   return GTEST_2_TUPLE_(T)(f0, f1);
1323 }
1324
1325 template <GTEST_3_TYPENAMES_(T)>
1326 inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
1327   return GTEST_3_TUPLE_(T)(f0, f1, f2);
1328 }
1329
1330 template <GTEST_4_TYPENAMES_(T)>
1331 inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1332     const T3& f3) {
1333   return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
1334 }
1335
1336 template <GTEST_5_TYPENAMES_(T)>
1337 inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1338     const T3& f3, const T4& f4) {
1339   return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
1340 }
1341
1342 template <GTEST_6_TYPENAMES_(T)>
1343 inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1344     const T3& f3, const T4& f4, const T5& f5) {
1345   return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
1346 }
1347
1348 template <GTEST_7_TYPENAMES_(T)>
1349 inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1350     const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
1351   return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
1352 }
1353
1354 template <GTEST_8_TYPENAMES_(T)>
1355 inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1356     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
1357   return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
1358 }
1359
1360 template <GTEST_9_TYPENAMES_(T)>
1361 inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1362     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1363     const T8& f8) {
1364   return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
1365 }
1366
1367 template <GTEST_10_TYPENAMES_(T)>
1368 inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
1369     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
1370     const T8& f8, const T9& f9) {
1371   return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
1372 }
1373
1374 // 6.1.3.3 Tuple helper classes.
1375
1376 template <typename Tuple> struct tuple_size;
1377
1378 template <GTEST_0_TYPENAMES_(T)>
1379 struct tuple_size<GTEST_0_TUPLE_(T) > {
1380   static const int value = 0;
1381 };
1382
1383 template <GTEST_1_TYPENAMES_(T)>
1384 struct tuple_size<GTEST_1_TUPLE_(T) > {
1385   static const int value = 1;
1386 };
1387
1388 template <GTEST_2_TYPENAMES_(T)>
1389 struct tuple_size<GTEST_2_TUPLE_(T) > {
1390   static const int value = 2;
1391 };
1392
1393 template <GTEST_3_TYPENAMES_(T)>
1394 struct tuple_size<GTEST_3_TUPLE_(T) > {
1395   static const int value = 3;
1396 };
1397
1398 template <GTEST_4_TYPENAMES_(T)>
1399 struct tuple_size<GTEST_4_TUPLE_(T) > {
1400   static const int value = 4;
1401 };
1402
1403 template <GTEST_5_TYPENAMES_(T)>
1404 struct tuple_size<GTEST_5_TUPLE_(T) > {
1405   static const int value = 5;
1406 };
1407
1408 template <GTEST_6_TYPENAMES_(T)>
1409 struct tuple_size<GTEST_6_TUPLE_(T) > {
1410   static const int value = 6;
1411 };
1412
1413 template <GTEST_7_TYPENAMES_(T)>
1414 struct tuple_size<GTEST_7_TUPLE_(T) > {
1415   static const int value = 7;
1416 };
1417
1418 template <GTEST_8_TYPENAMES_(T)>
1419 struct tuple_size<GTEST_8_TUPLE_(T) > {
1420   static const int value = 8;
1421 };
1422
1423 template <GTEST_9_TYPENAMES_(T)>
1424 struct tuple_size<GTEST_9_TUPLE_(T) > {
1425   static const int value = 9;
1426 };
1427
1428 template <GTEST_10_TYPENAMES_(T)>
1429 struct tuple_size<GTEST_10_TUPLE_(T) > {
1430   static const int value = 10;
1431 };
1432
1433 template <int k, class Tuple>
1434 struct tuple_element {
1435   typedef typename gtest_internal::TupleElement<
1436       k < (tuple_size<Tuple>::value), k, Tuple>::type type;
1437 };
1438
1439 #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
1440
1441 // 6.1.3.4 Element access.
1442
1443 namespace gtest_internal {
1444
1445 template <>
1446 class Get<0> {
1447  public:
1448   template <class Tuple>
1449   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1450   Field(Tuple& t) { return t.f0_; }  // NOLINT
1451
1452   template <class Tuple>
1453   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
1454   ConstField(const Tuple& t) { return t.f0_; }
1455 };
1456
1457 template <>
1458 class Get<1> {
1459  public:
1460   template <class Tuple>
1461   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1462   Field(Tuple& t) { return t.f1_; }  // NOLINT
1463
1464   template <class Tuple>
1465   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
1466   ConstField(const Tuple& t) { return t.f1_; }
1467 };
1468
1469 template <>
1470 class Get<2> {
1471  public:
1472   template <class Tuple>
1473   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1474   Field(Tuple& t) { return t.f2_; }  // NOLINT
1475
1476   template <class Tuple>
1477   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
1478   ConstField(const Tuple& t) { return t.f2_; }
1479 };
1480
1481 template <>
1482 class Get<3> {
1483  public:
1484   template <class Tuple>
1485   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1486   Field(Tuple& t) { return t.f3_; }  // NOLINT
1487
1488   template <class Tuple>
1489   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
1490   ConstField(const Tuple& t) { return t.f3_; }
1491 };
1492
1493 template <>
1494 class Get<4> {
1495  public:
1496   template <class Tuple>
1497   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1498   Field(Tuple& t) { return t.f4_; }  // NOLINT
1499
1500   template <class Tuple>
1501   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
1502   ConstField(const Tuple& t) { return t.f4_; }
1503 };
1504
1505 template <>
1506 class Get<5> {
1507  public:
1508   template <class Tuple>
1509   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1510   Field(Tuple& t) { return t.f5_; }  // NOLINT
1511
1512   template <class Tuple>
1513   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
1514   ConstField(const Tuple& t) { return t.f5_; }
1515 };
1516
1517 template <>
1518 class Get<6> {
1519  public:
1520   template <class Tuple>
1521   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1522   Field(Tuple& t) { return t.f6_; }  // NOLINT
1523
1524   template <class Tuple>
1525   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
1526   ConstField(const Tuple& t) { return t.f6_; }
1527 };
1528
1529 template <>
1530 class Get<7> {
1531  public:
1532   template <class Tuple>
1533   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1534   Field(Tuple& t) { return t.f7_; }  // NOLINT
1535
1536   template <class Tuple>
1537   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
1538   ConstField(const Tuple& t) { return t.f7_; }
1539 };
1540
1541 template <>
1542 class Get<8> {
1543  public:
1544   template <class Tuple>
1545   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1546   Field(Tuple& t) { return t.f8_; }  // NOLINT
1547
1548   template <class Tuple>
1549   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
1550   ConstField(const Tuple& t) { return t.f8_; }
1551 };
1552
1553 template <>
1554 class Get<9> {
1555  public:
1556   template <class Tuple>
1557   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1558   Field(Tuple& t) { return t.f9_; }  // NOLINT
1559
1560   template <class Tuple>
1561   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
1562   ConstField(const Tuple& t) { return t.f9_; }
1563 };
1564
1565 }  // namespace gtest_internal
1566
1567 template <int k, GTEST_10_TYPENAMES_(T)>
1568 GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
1569 get(GTEST_10_TUPLE_(T)& t) {
1570   return gtest_internal::Get<k>::Field(t);
1571 }
1572
1573 template <int k, GTEST_10_TYPENAMES_(T)>
1574 GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))
1575 get(const GTEST_10_TUPLE_(T)& t) {
1576   return gtest_internal::Get<k>::ConstField(t);
1577 }
1578
1579 // 6.1.3.5 Relational operators
1580
1581 // We only implement == and !=, as we don't have a need for the rest yet.
1582
1583 namespace gtest_internal {
1584
1585 // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
1586 // first k fields of t1 equals the first k fields of t2.
1587 // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
1588 // k1 != k2.
1589 template <int kSize1, int kSize2>
1590 struct SameSizeTuplePrefixComparator;
1591
1592 template <>
1593 struct SameSizeTuplePrefixComparator<0, 0> {
1594   template <class Tuple1, class Tuple2>
1595   static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
1596     return true;
1597   }
1598 };
1599
1600 template <int k>
1601 struct SameSizeTuplePrefixComparator<k, k> {
1602   template <class Tuple1, class Tuple2>
1603   static bool Eq(const Tuple1& t1, const Tuple2& t2) {
1604     return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
1605         ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
1606   }
1607 };
1608
1609 }  // namespace gtest_internal
1610
1611 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1612 inline bool operator==(const GTEST_10_TUPLE_(T)& t,
1613                        const GTEST_10_TUPLE_(U)& u) {
1614   return gtest_internal::SameSizeTuplePrefixComparator<
1615       tuple_size<GTEST_10_TUPLE_(T) >::value,
1616       tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
1617 }
1618
1619 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
1620 inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
1621                        const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
1622
1623 // 6.1.4 Pairs.
1624 // Unimplemented.
1625
1626 }  // namespace tr1
1627 }  // namespace std
1628
1629 #undef GTEST_0_TUPLE_
1630 #undef GTEST_1_TUPLE_
1631 #undef GTEST_2_TUPLE_
1632 #undef GTEST_3_TUPLE_
1633 #undef GTEST_4_TUPLE_
1634 #undef GTEST_5_TUPLE_
1635 #undef GTEST_6_TUPLE_
1636 #undef GTEST_7_TUPLE_
1637 #undef GTEST_8_TUPLE_
1638 #undef GTEST_9_TUPLE_
1639 #undef GTEST_10_TUPLE_
1640
1641 #undef GTEST_0_TYPENAMES_
1642 #undef GTEST_1_TYPENAMES_
1643 #undef GTEST_2_TYPENAMES_
1644 #undef GTEST_3_TYPENAMES_
1645 #undef GTEST_4_TYPENAMES_
1646 #undef GTEST_5_TYPENAMES_
1647 #undef GTEST_6_TYPENAMES_
1648 #undef GTEST_7_TYPENAMES_
1649 #undef GTEST_8_TYPENAMES_
1650 #undef GTEST_9_TYPENAMES_
1651 #undef GTEST_10_TYPENAMES_
1652
1653 #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
1654 #undef GTEST_BY_REF_
1655 #undef GTEST_ADD_REF_
1656 #undef GTEST_TUPLE_ELEMENT_
1657
1658 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
1659 # elif GTEST_ENV_HAS_STD_TUPLE_
1660 #  include <tuple>
1661 // C++11 puts its tuple into the ::std namespace rather than
1662 // ::std::tr1.  gtest expects tuple to live in ::std::tr1, so put it there.
1663 // This causes undefined behavior, but supported compilers react in
1664 // the way we intend.
1665 namespace std {
1666 namespace tr1 {
1667 using ::std::get;
1668 using ::std::make_tuple;
1669 using ::std::tuple;
1670 using ::std::tuple_element;
1671 using ::std::tuple_size;
1672 }
1673 }
1674
1675 # elif GTEST_OS_SYMBIAN
1676
1677 // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
1678 // use STLport's tuple implementation, which unfortunately doesn't
1679 // work as the copy of STLport distributed with Symbian is incomplete.
1680 // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
1681 // use its own tuple implementation.
1682 #  ifdef BOOST_HAS_TR1_TUPLE
1683 #   undef BOOST_HAS_TR1_TUPLE
1684 #  endif  // BOOST_HAS_TR1_TUPLE
1685
1686 // This prevents <boost/tr1/detail/config.hpp>, which defines
1687 // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
1688 #  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
1689 #  include <tuple>
1690
1691 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
1692 // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does
1693 // not conform to the TR1 spec, which requires the header to be <tuple>.
1694
1695 #  if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1696 // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
1697 // which is #included by <tr1/tuple>, to not compile when RTTI is
1698 // disabled.  _TR1_FUNCTIONAL is the header guard for
1699 // <tr1/functional>.  Hence the following #define is a hack to prevent
1700 // <tr1/functional> from being included.
1701 #   define _TR1_FUNCTIONAL 1
1702 #   include <tr1/tuple>
1703 #   undef _TR1_FUNCTIONAL  // Allows the user to #include
1704                         // <tr1/functional> if he chooses to.
1705 #  else
1706 #   include <tr1/tuple>  // NOLINT
1707 #  endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
1708
1709 # else
1710 // If the compiler is not GCC 4.0+, we assume the user is using a
1711 // spec-conforming TR1 implementation.
1712 #  include <tuple>  // NOLINT
1713 # endif  // GTEST_USE_OWN_TR1_TUPLE
1714
1715 #endif  // GTEST_HAS_TR1_TUPLE
1716
1717 // Determines whether clone(2) is supported.
1718 // Usually it will only be available on Linux, excluding
1719 // Linux on the Itanium architecture.
1720 // Also see http://linux.die.net/man/2/clone.
1721 #ifndef GTEST_HAS_CLONE
1722 // The user didn't tell us, so we need to figure it out.
1723
1724 # if GTEST_OS_LINUX && !defined(__ia64__)
1725 #  if GTEST_OS_LINUX_ANDROID
1726 // On Android, clone() is only available on ARM starting with Gingerbread.
1727 #    if defined(__arm__) && __ANDROID_API__ >= 9
1728 #     define GTEST_HAS_CLONE 1
1729 #    else
1730 #     define GTEST_HAS_CLONE 0
1731 #    endif
1732 #  else
1733 #   define GTEST_HAS_CLONE 1
1734 #  endif
1735 # else
1736 #  define GTEST_HAS_CLONE 0
1737 # endif  // GTEST_OS_LINUX && !defined(__ia64__)
1738
1739 #endif  // GTEST_HAS_CLONE
1740
1741 // Determines whether to support stream redirection. This is used to test
1742 // output correctness and to implement death tests.
1743 #ifndef GTEST_HAS_STREAM_REDIRECTION
1744 // By default, we assume that stream redirection is supported on all
1745 // platforms except known mobile ones.
1746 # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
1747 #  define GTEST_HAS_STREAM_REDIRECTION 0
1748 # else
1749 #  define GTEST_HAS_STREAM_REDIRECTION 1
1750 # endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
1751 #endif  // GTEST_HAS_STREAM_REDIRECTION
1752
1753 // Determines whether to support death tests.
1754 // Google Test does not support death tests for VC 7.1 and earlier as
1755 // abort() in a VC 7.1 application compiled as GUI in debug config
1756 // pops up a dialog window that cannot be suppressed programmatically.
1757 #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
1758      (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \
1759      (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
1760      GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
1761      GTEST_OS_OPENBSD || GTEST_OS_QNX)
1762 # define GTEST_HAS_DEATH_TEST 1
1763 # include <vector>  // NOLINT
1764 #endif
1765
1766 // We don't support MSVC 7.1 with exceptions disabled now.  Therefore
1767 // all the compilers we care about are adequate for supporting
1768 // value-parameterized tests.
1769 #define GTEST_HAS_PARAM_TEST 1
1770
1771 // Determines whether to support type-driven tests.
1772
1773 // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
1774 // Sun Pro CC, IBM Visual Age, and HP aCC support.
1775 #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
1776     defined(__IBMCPP__) || defined(__HP_aCC)
1777 # define GTEST_HAS_TYPED_TEST 1
1778 # define GTEST_HAS_TYPED_TEST_P 1
1779 #endif
1780
1781 // Determines whether to support Combine(). This only makes sense when
1782 // value-parameterized tests are enabled.  The implementation doesn't
1783 // work on Sun Studio since it doesn't understand templated conversion
1784 // operators.
1785 #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
1786 # define GTEST_HAS_COMBINE 1
1787 #endif
1788
1789 // Determines whether the system compiler uses UTF-16 for encoding wide strings.
1790 #define GTEST_WIDE_STRING_USES_UTF16_ \
1791     (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
1792
1793 // Determines whether test results can be streamed to a socket.
1794 #if GTEST_OS_LINUX
1795 # define GTEST_CAN_STREAM_RESULTS_ 1
1796 #endif
1797
1798 // Defines some utility macros.
1799
1800 // The GNU compiler emits a warning if nested "if" statements are followed by
1801 // an "else" statement and braces are not used to explicitly disambiguate the
1802 // "else" binding.  This leads to problems with code like:
1803 //
1804 //   if (gate)
1805 //     ASSERT_*(condition) << "Some message";
1806 //
1807 // The "switch (0) case 0:" idiom is used to suppress this.
1808 #ifdef __INTEL_COMPILER
1809 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
1810 #else
1811 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default:  // NOLINT
1812 #endif
1813
1814 // Use this annotation at the end of a struct/class definition to
1815 // prevent the compiler from optimizing away instances that are never
1816 // used.  This is useful when all interesting logic happens inside the
1817 // c'tor and / or d'tor.  Example:
1818 //
1819 //   struct Foo {
1820 //     Foo() { ... }
1821 //   } GTEST_ATTRIBUTE_UNUSED_;
1822 //
1823 // Also use it after a variable or parameter declaration to tell the
1824 // compiler the variable/parameter does not have to be used.
1825 #if defined(__GNUC__) && !defined(COMPILER_ICC)
1826 # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
1827 #else
1828 # define GTEST_ATTRIBUTE_UNUSED_
1829 #endif
1830
1831 // A macro to disallow operator=
1832 // This should be used in the private: declarations for a class.
1833 #define GTEST_DISALLOW_ASSIGN_(type)\
1834   void operator=(type const &)
1835
1836 // A macro to disallow copy constructor and operator=
1837 // This should be used in the private: declarations for a class.
1838 #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
1839   type(type const &);\
1840   GTEST_DISALLOW_ASSIGN_(type)
1841
1842 // Tell the compiler to warn about unused return values for functions declared
1843 // with this macro.  The macro should be used on function declarations
1844 // following the argument list:
1845 //
1846 //   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
1847 #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
1848 # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
1849 #else
1850 # define GTEST_MUST_USE_RESULT_
1851 #endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
1852
1853 // Determine whether the compiler supports Microsoft's Structured Exception
1854 // Handling.  This is supported by several Windows compilers but generally
1855 // does not exist on any other system.
1856 #ifndef GTEST_HAS_SEH
1857 // The user didn't tell us, so we need to figure it out.
1858
1859 # if defined(_MSC_VER) || defined(__BORLANDC__)
1860 // These two compilers are known to support SEH.
1861 #  define GTEST_HAS_SEH 1
1862 # else
1863 // Assume no SEH.
1864 #  define GTEST_HAS_SEH 0
1865 # endif
1866
1867 #endif  // GTEST_HAS_SEH
1868
1869 #ifdef _MSC_VER
1870
1871 # if GTEST_LINKED_AS_SHARED_LIBRARY
1872 #  define GTEST_API_ __declspec(dllimport)
1873 # elif GTEST_CREATE_SHARED_LIBRARY
1874 #  define GTEST_API_ __declspec(dllexport)
1875 # endif
1876
1877 #endif  // _MSC_VER
1878
1879 #ifndef GTEST_API_
1880 # define GTEST_API_
1881 #endif
1882
1883 #ifdef __GNUC__
1884 // Ask the compiler to never inline a given function.
1885 # define GTEST_NO_INLINE_ __attribute__((noinline))
1886 #else
1887 # define GTEST_NO_INLINE_
1888 #endif
1889
1890 // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
1891 #if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
1892 # define GTEST_HAS_CXXABI_H_ 1
1893 #else
1894 # define GTEST_HAS_CXXABI_H_ 0
1895 #endif
1896
1897 namespace testing {
1898
1899 class Message;
1900
1901 namespace internal {
1902
1903 // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
1904 // expression is true. For example, you could use it to verify the
1905 // size of a static array:
1906 //
1907 //   GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
1908 //                         content_type_names_incorrect_size);
1909 //
1910 // or to make sure a struct is smaller than a certain size:
1911 //
1912 //   GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
1913 //
1914 // The second argument to the macro is the name of the variable. If
1915 // the expression is false, most compilers will issue a warning/error
1916 // containing the name of the variable.
1917
1918 template <bool>
1919 struct CompileAssert {
1920 };
1921
1922 #define GTEST_COMPILE_ASSERT_(expr, msg) \
1923   typedef ::testing::internal::CompileAssert<(bool(expr))> \
1924       msg[bool(expr) ? 1 : -1]
1925
1926 // Implementation details of GTEST_COMPILE_ASSERT_:
1927 //
1928 // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
1929 //   elements (and thus is invalid) when the expression is false.
1930 //
1931 // - The simpler definition
1932 //
1933 //    #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
1934 //
1935 //   does not work, as gcc supports variable-length arrays whose sizes
1936 //   are determined at run-time (this is gcc's extension and not part
1937 //   of the C++ standard).  As a result, gcc fails to reject the
1938 //   following code with the simple definition:
1939 //
1940 //     int foo;
1941 //     GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
1942 //                                      // not a compile-time constant.
1943 //
1944 // - By using the type CompileAssert<(bool(expr))>, we ensures that
1945 //   expr is a compile-time constant.  (Template arguments must be
1946 //   determined at compile-time.)
1947 //
1948 // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
1949 //   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written
1950 //
1951 //     CompileAssert<bool(expr)>
1952 //
1953 //   instead, these compilers will refuse to compile
1954 //
1955 //     GTEST_COMPILE_ASSERT_(5 > 0, some_message);
1956 //
1957 //   (They seem to think the ">" in "5 > 0" marks the end of the
1958 //   template argument list.)
1959 //
1960 // - The array size is (bool(expr) ? 1 : -1), instead of simply
1961 //
1962 //     ((expr) ? 1 : -1).
1963 //
1964 //   This is to avoid running into a bug in MS VC 7.1, which
1965 //   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
1966
1967 // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
1968 //
1969 // This template is declared, but intentionally undefined.
1970 template <typename T1, typename T2>
1971 struct StaticAssertTypeEqHelper;
1972
1973 template <typename T>
1974 struct StaticAssertTypeEqHelper<T, T> {};
1975
1976 #if GTEST_HAS_GLOBAL_STRING
1977 typedef ::string string;
1978 #else
1979 typedef ::std::string string;
1980 #endif  // GTEST_HAS_GLOBAL_STRING
1981
1982 #if GTEST_HAS_GLOBAL_WSTRING
1983 typedef ::wstring wstring;
1984 #elif GTEST_HAS_STD_WSTRING
1985 typedef ::std::wstring wstring;
1986 #endif  // GTEST_HAS_GLOBAL_WSTRING
1987
1988 // A helper for suppressing warnings on constant condition.  It just
1989 // returns 'condition'.
1990 GTEST_API_ bool IsTrue(bool condition);
1991
1992 // Defines scoped_ptr.
1993
1994 // This implementation of scoped_ptr is PARTIAL - it only contains
1995 // enough stuff to satisfy Google Test's need.
1996 template <typename T>
1997 class scoped_ptr {
1998  public:
1999   typedef T element_type;
2000
2001   explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
2002   ~scoped_ptr() { reset(); }
2003
2004   T& operator*() const { return *ptr_; }
2005   T* operator->() const { return ptr_; }
2006   T* get() const { return ptr_; }
2007
2008   T* release() {
2009     T* const ptr = ptr_;
2010     ptr_ = NULL;
2011     return ptr;
2012   }
2013
2014   void reset(T* p = NULL) {
2015     if (p != ptr_) {
2016       if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.
2017         delete ptr_;
2018       }
2019       ptr_ = p;
2020     }
2021   }
2022
2023  private:
2024   T* ptr_;
2025
2026   GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
2027 };
2028
2029 // Defines RE.
2030
2031 // A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended
2032 // Regular Expression syntax.
2033 class GTEST_API_ RE {
2034  public:
2035   // A copy constructor is required by the Standard to initialize object
2036   // references from r-values.
2037   RE(const RE& other) { Init(other.pattern()); }
2038
2039   // Constructs an RE from a string.
2040   RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT
2041
2042 #if GTEST_HAS_GLOBAL_STRING
2043
2044   RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT
2045
2046 #endif  // GTEST_HAS_GLOBAL_STRING
2047
2048   RE(const char* regex) { Init(regex); }  // NOLINT
2049   ~RE();
2050
2051   // Returns the string representation of the regex.
2052   const char* pattern() const { return pattern_; }
2053
2054   // FullMatch(str, re) returns true iff regular expression re matches
2055   // the entire str.
2056   // PartialMatch(str, re) returns true iff regular expression re
2057   // matches a substring of str (including str itself).
2058   //
2059   // TODO(wan@google.com): make FullMatch() and PartialMatch() work
2060   // when str contains NUL characters.
2061   static bool FullMatch(const ::std::string& str, const RE& re) {
2062     return FullMatch(str.c_str(), re);
2063   }
2064   static bool PartialMatch(const ::std::string& str, const RE& re) {
2065     return PartialMatch(str.c_str(), re);
2066   }
2067
2068 #if GTEST_HAS_GLOBAL_STRING
2069
2070   static bool FullMatch(const ::string& str, const RE& re) {
2071     return FullMatch(str.c_str(), re);
2072   }
2073   static bool PartialMatch(const ::string& str, const RE& re) {
2074     return PartialMatch(str.c_str(), re);
2075   }
2076
2077 #endif  // GTEST_HAS_GLOBAL_STRING
2078
2079   static bool FullMatch(const char* str, const RE& re);
2080   static bool PartialMatch(const char* str, const RE& re);
2081
2082  private:
2083   void Init(const char* regex);
2084
2085   // We use a const char* instead of an std::string, as Google Test used to be
2086   // used where std::string is not available.  TODO(wan@google.com): change to
2087   // std::string.
2088   const char* pattern_;
2089   bool is_valid_;
2090
2091 #if GTEST_USES_POSIX_RE
2092
2093   regex_t full_regex_;     // For FullMatch().
2094   regex_t partial_regex_;  // For PartialMatch().
2095
2096 #else  // GTEST_USES_SIMPLE_RE
2097
2098   const char* full_pattern_;  // For FullMatch();
2099
2100 #endif
2101
2102   GTEST_DISALLOW_ASSIGN_(RE);
2103 };
2104
2105 // Formats a source file path and a line number as they would appear
2106 // in an error message from the compiler used to compile this code.
2107 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
2108
2109 // Formats a file location for compiler-independent XML output.
2110 // Although this function is not platform dependent, we put it next to
2111 // FormatFileLocation in order to contrast the two functions.
2112 GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
2113                                                                int line);
2114
2115 // Defines logging utilities:
2116 //   GTEST_LOG_(severity) - logs messages at the specified severity level. The
2117 //                          message itself is streamed into the macro.
2118 //   LogToStderr()  - directs all log messages to stderr.
2119 //   FlushInfoLog() - flushes informational log messages.
2120
2121 enum GTestLogSeverity {
2122   GTEST_INFO,
2123   GTEST_WARNING,
2124   GTEST_ERROR,
2125   GTEST_FATAL
2126 };
2127
2128 // Formats log entry severity, provides a stream object for streaming the
2129 // log message, and terminates the message with a newline when going out of
2130 // scope.
2131 class GTEST_API_ GTestLog {
2132  public:
2133   GTestLog(GTestLogSeverity severity, const char* file, int line);
2134
2135   // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
2136   ~GTestLog();
2137
2138   ::std::ostream& GetStream() { return ::std::cerr; }
2139
2140  private:
2141   const GTestLogSeverity severity_;
2142
2143   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
2144 };
2145
2146 #define GTEST_LOG_(severity) \
2147     ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
2148                                   __FILE__, __LINE__).GetStream()
2149
2150 inline void LogToStderr() {}
2151 inline void FlushInfoLog() { fflush(NULL); }
2152
2153 // INTERNAL IMPLEMENTATION - DO NOT USE.
2154 //
2155 // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
2156 // is not satisfied.
2157 //  Synopsys:
2158 //    GTEST_CHECK_(boolean_condition);
2159 //     or
2160 //    GTEST_CHECK_(boolean_condition) << "Additional message";
2161 //
2162 //    This checks the condition and if the condition is not satisfied
2163 //    it prints message about the condition violation, including the
2164 //    condition itself, plus additional message streamed into it, if any,
2165 //    and then it aborts the program. It aborts the program irrespective of
2166 //    whether it is built in the debug mode or not.
2167 #define GTEST_CHECK_(condition) \
2168     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
2169     if (::testing::internal::IsTrue(condition)) \
2170       ; \
2171     else \
2172       GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
2173
2174 // An all-mode assert to verify that the given POSIX-style function
2175 // call returns 0 (indicating success).  Known limitation: this
2176 // doesn't expand to a balanced 'if' statement, so enclose the macro
2177 // in {} if you need to use it as the only statement in an 'if'
2178 // branch.
2179 #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
2180   if (const int gtest_error = (posix_call)) \
2181     GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
2182                       << gtest_error
2183
2184 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
2185 //
2186 // Use ImplicitCast_ as a safe version of static_cast for upcasting in
2187 // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
2188 // const Foo*).  When you use ImplicitCast_, the compiler checks that
2189 // the cast is safe.  Such explicit ImplicitCast_s are necessary in
2190 // surprisingly many situations where C++ demands an exact type match
2191 // instead of an argument type convertable to a target type.
2192 //
2193 // The syntax for using ImplicitCast_ is the same as for static_cast:
2194 //
2195 //   ImplicitCast_<ToType>(expr)
2196 //
2197 // ImplicitCast_ would have been part of the C++ standard library,
2198 // but the proposal was submitted too late.  It will probably make
2199 // its way into the language in the future.
2200 //
2201 // This relatively ugly name is intentional. It prevents clashes with
2202 // similar functions users may have (e.g., implicit_cast). The internal
2203 // namespace alone is not enough because the function can be found by ADL.
2204 template<typename To>
2205 inline To ImplicitCast_(To x) { return x; }
2206
2207 // When you upcast (that is, cast a pointer from type Foo to type
2208 // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
2209 // always succeed.  When you downcast (that is, cast a pointer from
2210 // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
2211 // how do you know the pointer is really of type SubclassOfFoo?  It
2212 // could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,
2213 // when you downcast, you should use this macro.  In debug mode, we
2214 // use dynamic_cast<> to double-check the downcast is legal (we die
2215 // if it's not).  In normal mode, we do the efficient static_cast<>
2216 // instead.  Thus, it's important to test in debug mode to make sure
2217 // the cast is legal!
2218 //    This is the only place in the code we should use dynamic_cast<>.
2219 // In particular, you SHOULDN'T be using dynamic_cast<> in order to
2220 // do RTTI (eg code like this:
2221 //    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
2222 //    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
2223 // You should design the code some other way not to need this.
2224 //
2225 // This relatively ugly name is intentional. It prevents clashes with
2226 // similar functions users may have (e.g., down_cast). The internal
2227 // namespace alone is not enough because the function can be found by ADL.
2228 template<typename To, typename From>  // use like this: DownCast_<T*>(foo);
2229 inline To DownCast_(From* f) {  // so we only accept pointers
2230   // Ensures that To is a sub-type of From *.  This test is here only
2231   // for compile-time type checking, and has no overhead in an
2232   // optimized build at run-time, as it will be optimized away
2233   // completely.
2234   if (false) {
2235     const To to = NULL;
2236     ::testing::internal::ImplicitCast_<From*>(to);
2237   }
2238
2239 #if GTEST_HAS_RTTI
2240   // RTTI: debug mode only!
2241   GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
2242 #endif
2243   return static_cast<To>(f);
2244 }
2245
2246 // Downcasts the pointer of type Base to Derived.
2247 // Derived must be a subclass of Base. The parameter MUST
2248 // point to a class of type Derived, not any subclass of it.
2249 // When RTTI is available, the function performs a runtime
2250 // check to enforce this.
2251 template <class Derived, class Base>
2252 Derived* CheckedDowncastToActualType(Base* base) {
2253 #if GTEST_HAS_RTTI
2254   GTEST_CHECK_(typeid(*base) == typeid(Derived));
2255   return dynamic_cast<Derived*>(base);  // NOLINT
2256 #else
2257   return static_cast<Derived*>(base);  // Poor man's downcast.
2258 #endif
2259 }
2260
2261 #if GTEST_HAS_STREAM_REDIRECTION
2262
2263 // Defines the stderr capturer:
2264 //   CaptureStdout     - starts capturing stdout.
2265 //   GetCapturedStdout - stops capturing stdout and returns the captured string.
2266 //   CaptureStderr     - starts capturing stderr.
2267 //   GetCapturedStderr - stops capturing stderr and returns the captured string.
2268 //
2269 GTEST_API_ void CaptureStdout();
2270 GTEST_API_ std::string GetCapturedStdout();
2271 GTEST_API_ void CaptureStderr();
2272 GTEST_API_ std::string GetCapturedStderr();
2273
2274 #endif  // GTEST_HAS_STREAM_REDIRECTION
2275
2276
2277 #if GTEST_HAS_DEATH_TEST
2278
2279 const ::std::vector<testing::internal::string>& GetInjectableArgvs();
2280 void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
2281                              new_argvs);
2282
2283 // A copy of all command line arguments.  Set by InitGoogleTest().
2284 extern ::std::vector<testing::internal::string> g_argvs;
2285
2286 #endif  // GTEST_HAS_DEATH_TEST
2287
2288 // Defines synchronization primitives.
2289
2290 #if GTEST_HAS_PTHREAD
2291
2292 // Sleeps for (roughly) n milli-seconds.  This function is only for
2293 // testing Google Test's own constructs.  Don't use it in user tests,
2294 // either directly or indirectly.
2295 inline void SleepMilliseconds(int n) {
2296   const timespec time = {
2297     0,                  // 0 seconds.
2298     n * 1000L * 1000L,  // And n ms.
2299   };
2300   nanosleep(&time, NULL);
2301 }
2302
2303 // Allows a controller thread to pause execution of newly created
2304 // threads until notified.  Instances of this class must be created
2305 // and destroyed in the controller thread.
2306 //
2307 // This class is only for testing Google Test's own constructs. Do not
2308 // use it in user tests, either directly or indirectly.
2309 class Notification {
2310  public:
2311   Notification() : notified_(false) {
2312     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2313   }
2314   ~Notification() {
2315     pthread_mutex_destroy(&mutex_);
2316   }
2317
2318   // Notifies all threads created with this notification to start. Must
2319   // be called from the controller thread.
2320   void Notify() {
2321     pthread_mutex_lock(&mutex_);
2322     notified_ = true;
2323     pthread_mutex_unlock(&mutex_);
2324   }
2325
2326   // Blocks until the controller thread notifies. Must be called from a test
2327   // thread.
2328   void WaitForNotification() {
2329     for (;;) {
2330       pthread_mutex_lock(&mutex_);
2331       const bool notified = notified_;
2332       pthread_mutex_unlock(&mutex_);
2333       if (notified)
2334         break;
2335       SleepMilliseconds(10);
2336     }
2337   }
2338
2339  private:
2340   pthread_mutex_t mutex_;
2341   bool notified_;
2342
2343   GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
2344 };
2345
2346 // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
2347 // Consequently, it cannot select a correct instantiation of ThreadWithParam
2348 // in order to call its Run(). Introducing ThreadWithParamBase as a
2349 // non-templated base class for ThreadWithParam allows us to bypass this
2350 // problem.
2351 class ThreadWithParamBase {
2352  public:
2353   virtual ~ThreadWithParamBase() {}
2354   virtual void Run() = 0;
2355 };
2356
2357 // pthread_create() accepts a pointer to a function type with the C linkage.
2358 // According to the Standard (7.5/1), function types with different linkages
2359 // are different even if they are otherwise identical.  Some compilers (for
2360 // example, SunStudio) treat them as different types.  Since class methods
2361 // cannot be defined with C-linkage we need to define a free C-function to
2362 // pass into pthread_create().
2363 extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
2364   static_cast<ThreadWithParamBase*>(thread)->Run();
2365   return NULL;
2366 }
2367
2368 // Helper class for testing Google Test's multi-threading constructs.
2369 // To use it, write:
2370 //
2371 //   void ThreadFunc(int param) { /* Do things with param */ }
2372 //   Notification thread_can_start;
2373 //   ...
2374 //   // The thread_can_start parameter is optional; you can supply NULL.
2375 //   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
2376 //   thread_can_start.Notify();
2377 //
2378 // These classes are only for testing Google Test's own constructs. Do
2379 // not use them in user tests, either directly or indirectly.
2380 template <typename T>
2381 class ThreadWithParam : public ThreadWithParamBase {
2382  public:
2383   typedef void (*UserThreadFunc)(T);
2384
2385   ThreadWithParam(
2386       UserThreadFunc func, T param, Notification* thread_can_start)
2387       : func_(func),
2388         param_(param),
2389         thread_can_start_(thread_can_start),
2390         finished_(false) {
2391     ThreadWithParamBase* const base = this;
2392     // The thread can be created only after all fields except thread_
2393     // have been initialized.
2394     GTEST_CHECK_POSIX_SUCCESS_(
2395         pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
2396   }
2397   ~ThreadWithParam() { Join(); }
2398
2399   void Join() {
2400     if (!finished_) {
2401       GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
2402       finished_ = true;
2403     }
2404   }
2405
2406   virtual void Run() {
2407     if (thread_can_start_ != NULL)
2408       thread_can_start_->WaitForNotification();
2409     func_(param_);
2410   }
2411
2412  private:
2413   const UserThreadFunc func_;  // User-supplied thread function.
2414   const T param_;  // User-supplied parameter to the thread function.
2415   // When non-NULL, used to block execution until the controller thread
2416   // notifies.
2417   Notification* const thread_can_start_;
2418   bool finished_;  // true iff we know that the thread function has finished.
2419   pthread_t thread_;  // The native thread object.
2420
2421   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
2422 };
2423
2424 // MutexBase and Mutex implement mutex on pthreads-based platforms. They
2425 // are used in conjunction with class MutexLock:
2426 //
2427 //   Mutex mutex;
2428 //   ...
2429 //   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the end
2430 //                            // of the current scope.
2431 //
2432 // MutexBase implements behavior for both statically and dynamically
2433 // allocated mutexes.  Do not use MutexBase directly.  Instead, write
2434 // the following to define a static mutex:
2435 //
2436 //   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
2437 //
2438 // You can forward declare a static mutex like this:
2439 //
2440 //   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
2441 //
2442 // To create a dynamic mutex, just define an object of type Mutex.
2443 class MutexBase {
2444  public:
2445   // Acquires this mutex.
2446   void Lock() {
2447     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
2448     owner_ = pthread_self();
2449     has_owner_ = true;
2450   }
2451
2452   // Releases this mutex.
2453   void Unlock() {
2454     // Since the lock is being released the owner_ field should no longer be
2455     // considered valid. We don't protect writing to has_owner_ here, as it's
2456     // the caller's responsibility to ensure that the current thread holds the
2457     // mutex when this is called.
2458     has_owner_ = false;
2459     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
2460   }
2461
2462   // Does nothing if the current thread holds the mutex. Otherwise, crashes
2463   // with high probability.
2464   void AssertHeld() const {
2465     GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
2466         << "The current thread is not holding the mutex @" << this;
2467   }
2468
2469   // A static mutex may be used before main() is entered.  It may even
2470   // be used before the dynamic initialization stage.  Therefore we
2471   // must be able to initialize a static mutex object at link time.
2472   // This means MutexBase has to be a POD and its member variables
2473   // have to be public.
2474  public:
2475   pthread_mutex_t mutex_;  // The underlying pthread mutex.
2476   // has_owner_ indicates whether the owner_ field below contains a valid thread
2477   // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
2478   // accesses to the owner_ field should be protected by a check of this field.
2479   // An alternative might be to memset() owner_ to all zeros, but there's no
2480   // guarantee that a zero'd pthread_t is necessarily invalid or even different
2481   // from pthread_self().
2482   bool has_owner_;
2483   pthread_t owner_;  // The thread holding the mutex.
2484 };
2485
2486 // Forward-declares a static mutex.
2487 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2488     extern ::testing::internal::MutexBase mutex
2489
2490 // Defines and statically (i.e. at link time) initializes a static mutex.
2491 // The initialization list here does not explicitly initialize each field,
2492 // instead relying on default initialization for the unspecified fields. In
2493 // particular, the owner_ field (a pthread_t) is not explicitly initialized.
2494 // This allows initialization to work whether pthread_t is a scalar or struct.
2495 // The flag -Wmissing-field-initializers must not be specified for this to work.
2496 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
2497     ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
2498
2499 // The Mutex class can only be used for mutexes created at runtime. It
2500 // shares its API with MutexBase otherwise.
2501 class Mutex : public MutexBase {
2502  public:
2503   Mutex() {
2504     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
2505     has_owner_ = false;
2506   }
2507   ~Mutex() {
2508     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
2509   }
2510
2511  private:
2512   GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
2513 };
2514
2515 // We cannot name this class MutexLock as the ctor declaration would
2516 // conflict with a macro named MutexLock, which is defined on some
2517 // platforms.  Hence the typedef trick below.
2518 class GTestMutexLock {
2519  public:
2520   explicit GTestMutexLock(MutexBase* mutex)
2521       : mutex_(mutex) { mutex_->Lock(); }
2522
2523   ~GTestMutexLock() { mutex_->Unlock(); }
2524
2525  private:
2526   MutexBase* const mutex_;
2527
2528   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
2529 };
2530
2531 typedef GTestMutexLock MutexLock;
2532
2533 // Helpers for ThreadLocal.
2534
2535 // pthread_key_create() requires DeleteThreadLocalValue() to have
2536 // C-linkage.  Therefore it cannot be templatized to access
2537 // ThreadLocal<T>.  Hence the need for class
2538 // ThreadLocalValueHolderBase.
2539 class ThreadLocalValueHolderBase {
2540  public:
2541   virtual ~ThreadLocalValueHolderBase() {}
2542 };
2543
2544 // Called by pthread to delete thread-local data stored by
2545 // pthread_setspecific().
2546 extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
2547   delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
2548 }
2549
2550 // Implements thread-local storage on pthreads-based systems.
2551 //
2552 //   // Thread 1
2553 //   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.
2554 //
2555 //   // Thread 2
2556 //   tl.set(150);  // Changes the value for thread 2 only.
2557 //   EXPECT_EQ(150, tl.get());
2558 //
2559 //   // Thread 1
2560 //   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.
2561 //   tl.set(200);
2562 //   EXPECT_EQ(200, tl.get());
2563 //
2564 // The template type argument T must have a public copy constructor.
2565 // In addition, the default ThreadLocal constructor requires T to have
2566 // a public default constructor.
2567 //
2568 // An object managed for a thread by a ThreadLocal instance is deleted
2569 // when the thread exits.  Or, if the ThreadLocal instance dies in
2570 // that thread, when the ThreadLocal dies.  It's the user's
2571 // responsibility to ensure that all other threads using a ThreadLocal
2572 // have exited when it dies, or the per-thread objects for those
2573 // threads will not be deleted.
2574 //
2575 // Google Test only uses global ThreadLocal objects.  That means they
2576 // will die after main() has returned.  Therefore, no per-thread
2577 // object managed by Google Test will be leaked as long as all threads
2578 // using Google Test have exited when main() returns.
2579 template <typename T>
2580 class ThreadLocal {
2581  public:
2582   ThreadLocal() : key_(CreateKey()),
2583                   default_() {}
2584   explicit ThreadLocal(const T& value) : key_(CreateKey()),
2585                                          default_(value) {}
2586
2587   ~ThreadLocal() {
2588     // Destroys the managed object for the current thread, if any.
2589     DeleteThreadLocalValue(pthread_getspecific(key_));
2590
2591     // Releases resources associated with the key.  This will *not*
2592     // delete managed objects for other threads.
2593     GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
2594   }
2595
2596   T* pointer() { return GetOrCreateValue(); }
2597   const T* pointer() const { return GetOrCreateValue(); }
2598   const T& get() const { return *pointer(); }
2599   void set(const T& value) { *pointer() = value; }
2600
2601  private:
2602   // Holds a value of type T.
2603   class ValueHolder : public ThreadLocalValueHolderBase {
2604    public:
2605     explicit ValueHolder(const T& value) : value_(value) {}
2606
2607     T* pointer() { return &value_; }
2608
2609    private:
2610     T value_;
2611     GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
2612   };
2613
2614   static pthread_key_t CreateKey() {
2615     pthread_key_t key;
2616     // When a thread exits, DeleteThreadLocalValue() will be called on
2617     // the object managed for that thread.
2618     GTEST_CHECK_POSIX_SUCCESS_(
2619         pthread_key_create(&key, &DeleteThreadLocalValue));
2620     return key;
2621   }
2622
2623   T* GetOrCreateValue() const {
2624     ThreadLocalValueHolderBase* const holder =
2625         static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
2626     if (holder != NULL) {
2627       return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
2628     }
2629
2630     ValueHolder* const new_holder = new ValueHolder(default_);
2631     ThreadLocalValueHolderBase* const holder_base = new_holder;
2632     GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
2633     return new_holder->pointer();
2634   }
2635
2636   // A key pthreads uses for looking up per-thread values.
2637   const pthread_key_t key_;
2638   const T default_;  // The default value for each thread.
2639
2640   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
2641 };
2642
2643 # define GTEST_IS_THREADSAFE 1
2644
2645 #else  // GTEST_HAS_PTHREAD
2646
2647 // A dummy implementation of synchronization primitives (mutex, lock,
2648 // and thread-local variable).  Necessary for compiling Google Test where
2649 // mutex is not supported - using Google Test in multiple threads is not
2650 // supported on such platforms.
2651
2652 class Mutex {
2653  public:
2654   Mutex() {}
2655   void Lock() {}
2656   void Unlock() {}
2657   void AssertHeld() const {}
2658 };
2659
2660 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
2661   extern ::testing::internal::Mutex mutex
2662
2663 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
2664
2665 class GTestMutexLock {
2666  public:
2667   explicit GTestMutexLock(Mutex*) {}  // NOLINT
2668 };
2669
2670 typedef GTestMutexLock MutexLock;
2671
2672 template <typename T>
2673 class ThreadLocal {
2674  public:
2675   ThreadLocal() : value_() {}
2676   explicit ThreadLocal(const T& value) : value_(value) {}
2677   T* pointer() { return &value_; }
2678   const T* pointer() const { return &value_; }
2679   const T& get() const { return value_; }
2680   void set(const T& value) { value_ = value; }
2681  private:
2682   T value_;
2683 };
2684
2685 // The above synchronization primitives have dummy implementations.
2686 // Therefore Google Test is not thread-safe.
2687 # define GTEST_IS_THREADSAFE 0
2688
2689 #endif  // GTEST_HAS_PTHREAD
2690
2691 // Returns the number of threads running in the process, or 0 to indicate that
2692 // we cannot detect it.
2693 GTEST_API_ size_t GetThreadCount();
2694
2695 // Passing non-POD classes through ellipsis (...) crashes the ARM
2696 // compiler and generates a warning in Sun Studio.  The Nokia Symbian
2697 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
2698 // for objects passed through ellipsis (...), failing for uncopyable
2699 // objects.  We define this to ensure that only POD is passed through
2700 // ellipsis on these systems.
2701 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
2702 // We lose support for NULL detection where the compiler doesn't like
2703 // passing non-POD classes through ellipsis (...).
2704 # define GTEST_ELLIPSIS_NEEDS_POD_ 1
2705 #else
2706 # define GTEST_CAN_COMPARE_NULL 1
2707 #endif
2708
2709 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
2710 // const T& and const T* in a function template.  These compilers
2711 // _can_ decide between class template specializations for T and T*,
2712 // so a tr1::type_traits-like is_pointer works.
2713 #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
2714 # define GTEST_NEEDS_IS_POINTER_ 1
2715 #endif
2716
2717 template <bool bool_value>
2718 struct bool_constant {
2719   typedef bool_constant<bool_value> type;
2720   static const bool value = bool_value;
2721 };
2722 template <bool bool_value> const bool bool_constant<bool_value>::value;
2723
2724 typedef bool_constant<false> false_type;
2725 typedef bool_constant<true> true_type;
2726
2727 template <typename T>
2728 struct is_pointer : public false_type {};
2729
2730 template <typename T>
2731 struct is_pointer<T*> : public true_type {};
2732
2733 template <typename Iterator>
2734 struct IteratorTraits {
2735   typedef typename Iterator::value_type value_type;
2736 };
2737
2738 template <typename T>
2739 struct IteratorTraits<T*> {
2740   typedef T value_type;
2741 };
2742
2743 template <typename T>
2744 struct IteratorTraits<const T*> {
2745   typedef T value_type;
2746 };
2747
2748 #if GTEST_OS_WINDOWS
2749 # define GTEST_PATH_SEP_ "\\"
2750 # define GTEST_HAS_ALT_PATH_SEP_ 1
2751 // The biggest signed integer type the compiler supports.
2752 typedef __int64 BiggestInt;
2753 #else
2754 # define GTEST_PATH_SEP_ "/"
2755 # define GTEST_HAS_ALT_PATH_SEP_ 0
2756 typedef long long BiggestInt;  // NOLINT
2757 #endif  // GTEST_OS_WINDOWS
2758
2759 // Utilities for char.
2760
2761 // isspace(int ch) and friends accept an unsigned char or EOF.  char
2762 // may be signed, depending on the compiler (or compiler flags).
2763 // Therefore we need to cast a char to unsigned char before calling
2764 // isspace(), etc.
2765
2766 inline bool IsAlpha(char ch) {
2767   return isalpha(static_cast<unsigned char>(ch)) != 0;
2768 }
2769 inline bool IsAlNum(char ch) {
2770   return isalnum(static_cast<unsigned char>(ch)) != 0;
2771 }
2772 inline bool IsDigit(char ch) {
2773   return isdigit(static_cast<unsigned char>(ch)) != 0;
2774 }
2775 inline bool IsLower(char ch) {
2776   return islower(static_cast<unsigned char>(ch)) != 0;
2777 }
2778 inline bool IsSpace(char ch) {
2779   return isspace(static_cast<unsigned char>(ch)) != 0;
2780 }
2781 inline bool IsUpper(char ch) {
2782   return isupper(static_cast<unsigned char>(ch)) != 0;
2783 }
2784 inline bool IsXDigit(char ch) {
2785   return isxdigit(static_cast<unsigned char>(ch)) != 0;
2786 }
2787 inline bool IsXDigit(wchar_t ch) {
2788   const unsigned char low_byte = static_cast<unsigned char>(ch);
2789   return ch == low_byte && isxdigit(low_byte) != 0;
2790 }
2791
2792 inline char ToLower(char ch) {
2793   return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
2794 }
2795 inline char ToUpper(char ch) {
2796   return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
2797 }
2798
2799 // The testing::internal::posix namespace holds wrappers for common
2800 // POSIX functions.  These wrappers hide the differences between
2801 // Windows/MSVC and POSIX systems.  Since some compilers define these
2802 // standard functions as macros, the wrapper cannot have the same name
2803 // as the wrapped function.
2804
2805 namespace posix {
2806
2807 // Functions with a different name on Windows.
2808
2809 #if GTEST_OS_WINDOWS
2810
2811 typedef struct _stat StatStruct;
2812
2813 # ifdef __BORLANDC__
2814 inline int IsATTY(int fd) { return isatty(fd); }
2815 inline int StrCaseCmp(const char* s1, const char* s2) {
2816   return stricmp(s1, s2);
2817 }
2818 inline char* StrDup(const char* src) { return strdup(src); }
2819 # else  // !__BORLANDC__
2820 #  if GTEST_OS_WINDOWS_MOBILE
2821 inline int IsATTY(int /* fd */) { return 0; }
2822 #  else
2823 inline int IsATTY(int fd) { return _isatty(fd); }
2824 #  endif  // GTEST_OS_WINDOWS_MOBILE
2825 inline int StrCaseCmp(const char* s1, const char* s2) {
2826   return _stricmp(s1, s2);
2827 }
2828 inline char* StrDup(const char* src) { return _strdup(src); }
2829 # endif  // __BORLANDC__
2830
2831 # if GTEST_OS_WINDOWS_MOBILE
2832 inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
2833 // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
2834 // time and thus not defined there.
2835 # else
2836 inline int FileNo(FILE* file) { return _fileno(file); }
2837 inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
2838 inline int RmDir(const char* dir) { return _rmdir(dir); }
2839 inline bool IsDir(const StatStruct& st) {
2840   return (_S_IFDIR & st.st_mode) != 0;
2841 }
2842 # endif  // GTEST_OS_WINDOWS_MOBILE
2843
2844 #else
2845
2846 typedef struct stat StatStruct;
2847
2848 inline int FileNo(FILE* file) { return fileno(file); }
2849 inline int IsATTY(int fd) { return isatty(fd); }
2850 inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
2851 inline int StrCaseCmp(const char* s1, const char* s2) {
2852   return strcasecmp(s1, s2);
2853 }
2854 inline char* StrDup(const char* src) { return strdup(src); }
2855 inline int RmDir(const char* dir) { return rmdir(dir); }
2856 inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
2857
2858 #endif  // GTEST_OS_WINDOWS
2859
2860 // Functions deprecated by MSVC 8.0.
2861
2862 #ifdef _MSC_VER
2863 // Temporarily disable warning 4996 (deprecated function).
2864 # pragma warning(push)
2865 # pragma warning(disable:4996)
2866 #endif
2867
2868 inline const char* StrNCpy(char* dest, const char* src, size_t n) {
2869   return strncpy(dest, src, n);
2870 }
2871
2872 // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
2873 // StrError() aren't needed on Windows CE at this time and thus not
2874 // defined there.
2875
2876 #if !GTEST_OS_WINDOWS_MOBILE
2877 inline int ChDir(const char* dir) { return chdir(dir); }
2878 #endif
2879 inline FILE* FOpen(const char* path, const char* mode) {
2880   return fopen(path, mode);
2881 }
2882 #if !GTEST_OS_WINDOWS_MOBILE
2883 inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
2884   return freopen(path, mode, stream);
2885 }
2886 inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
2887 #endif
2888 inline int FClose(FILE* fp) { return fclose(fp); }
2889 #if !GTEST_OS_WINDOWS_MOBILE
2890 inline int Read(int fd, void* buf, unsigned int count) {
2891   return static_cast<int>(read(fd, buf, count));
2892 }
2893 inline int Write(int fd, const void* buf, unsigned int count) {
2894   return static_cast<int>(write(fd, buf, count));
2895 }
2896 inline int Close(int fd) { return close(fd); }
2897 inline const char* StrError(int errnum) { return strerror(errnum); }
2898 #endif
2899 inline const char* GetEnv(const char* name) {
2900 #if GTEST_OS_WINDOWS_MOBILE
2901   // We are on Windows CE, which has no environment variables.
2902   return NULL;
2903 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
2904   // Environment variables which we programmatically clear will be set to the
2905   // empty string rather than unset (NULL).  Handle that case.
2906   const char* const env = getenv(name);
2907   return (env != NULL && env[0] != '\0') ? env : NULL;
2908 #else
2909   return getenv(name);
2910 #endif
2911 }
2912
2913 #ifdef _MSC_VER
2914 # pragma warning(pop)  // Restores the warning state.
2915 #endif
2916
2917 #if GTEST_OS_WINDOWS_MOBILE
2918 // Windows CE has no C library. The abort() function is used in
2919 // several places in Google Test. This implementation provides a reasonable
2920 // imitation of standard behaviour.
2921 void Abort();
2922 #else
2923 inline void Abort() { abort(); }
2924 #endif  // GTEST_OS_WINDOWS_MOBILE
2925
2926 }  // namespace posix
2927
2928 // MSVC "deprecates" snprintf and issues warnings wherever it is used.  In
2929 // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
2930 // MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate
2931 // function in order to achieve that.  We use macro definition here because
2932 // snprintf is a variadic function.
2933 #if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
2934 // MSVC 2005 and above support variadic macros.
2935 # define GTEST_SNPRINTF_(buffer, size, format, ...) \
2936      _snprintf_s(buffer, size, size, format, __VA_ARGS__)
2937 #elif defined(_MSC_VER)
2938 // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
2939 // complain about _snprintf.
2940 # define GTEST_SNPRINTF_ _snprintf
2941 #else
2942 # define GTEST_SNPRINTF_ snprintf
2943 #endif
2944
2945 // The maximum number a BiggestInt can represent.  This definition
2946 // works no matter BiggestInt is represented in one's complement or
2947 // two's complement.
2948 //
2949 // We cannot rely on numeric_limits in STL, as __int64 and long long
2950 // are not part of standard C++ and numeric_limits doesn't need to be
2951 // defined for them.
2952 const BiggestInt kMaxBiggestInt =
2953     ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
2954
2955 // This template class serves as a compile-time function from size to
2956 // type.  It maps a size in bytes to a primitive type with that
2957 // size. e.g.
2958 //
2959 //   TypeWithSize<4>::UInt
2960 //
2961 // is typedef-ed to be unsigned int (unsigned integer made up of 4
2962 // bytes).
2963 //
2964 // Such functionality should belong to STL, but I cannot find it
2965 // there.
2966 //
2967 // Google Test uses this class in the implementation of floating-point
2968 // comparison.
2969 //
2970 // For now it only handles UInt (unsigned int) as that's all Google Test
2971 // needs.  Other types can be easily added in the future if need
2972 // arises.
2973 template <size_t size>
2974 class TypeWithSize {
2975  public:
2976   // This prevents the user from using TypeWithSize<N> with incorrect
2977   // values of N.
2978   typedef void UInt;
2979 };
2980
2981 // The specialization for size 4.
2982 template <>
2983 class TypeWithSize<4> {
2984  public:
2985   // unsigned int has size 4 in both gcc and MSVC.
2986   //
2987   // As base/basictypes.h doesn't compile on Windows, we cannot use
2988   // uint32, uint64, and etc here.
2989   typedef int Int;
2990   typedef unsigned int UInt;
2991 };
2992
2993 // The specialization for size 8.
2994 template <>
2995 class TypeWithSize<8> {
2996  public:
2997 #if GTEST_OS_WINDOWS
2998   typedef __int64 Int;
2999   typedef unsigned __int64 UInt;
3000 #else
3001   typedef long long Int;  // NOLINT
3002   typedef unsigned long long UInt;  // NOLINT
3003 #endif  // GTEST_OS_WINDOWS
3004 };
3005
3006 // Integer types of known sizes.
3007 typedef TypeWithSize<4>::Int Int32;
3008 typedef TypeWithSize<4>::UInt UInt32;
3009 typedef TypeWithSize<8>::Int Int64;
3010 typedef TypeWithSize<8>::UInt UInt64;
3011 typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
3012
3013 // Utilities for command line flags and environment variables.
3014
3015 // Macro for referencing flags.
3016 #define GTEST_FLAG(name) FLAGS_gtest_##name
3017
3018 // Macros for declaring flags.
3019 #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
3020 #define GTEST_DECLARE_int32_(name) \
3021     GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
3022 #define GTEST_DECLARE_string_(name) \
3023     GTEST_API_ extern ::std::string GTEST_FLAG(name)
3024
3025 // Macros for defining flags.
3026 #define GTEST_DEFINE_bool_(name, default_val, doc) \
3027     GTEST_API_ bool GTEST_FLAG(name) = (default_val)
3028 #define GTEST_DEFINE_int32_(name, default_val, doc) \
3029     GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
3030 #define GTEST_DEFINE_string_(name, default_val, doc) \
3031     GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
3032
3033 // Thread annotations
3034 #define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
3035 #define GTEST_LOCK_EXCLUDED_(locks)
3036
3037 // Parses 'str' for a 32-bit signed integer.  If successful, writes the result
3038 // to *value and returns true; otherwise leaves *value unchanged and returns
3039 // false.
3040 // TODO(chandlerc): Find a better way to refactor flag and environment parsing
3041 // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
3042 // function.
3043 bool ParseInt32(const Message& src_text, const char* str, Int32* value);
3044
3045 // Parses a bool/Int32/string from the environment variable
3046 // corresponding to the given Google Test flag.
3047 bool BoolFromGTestEnv(const char* flag, bool default_val);
3048 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
3049 const char* StringFromGTestEnv(const char* flag, const char* default_val);
3050
3051 }  // namespace internal
3052 }  // namespace testing
3053
3054 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
3055
3056 #if GTEST_OS_LINUX
3057 # include <stdlib.h>
3058 # include <sys/types.h>
3059 # include <sys/wait.h>
3060 # include <unistd.h>
3061 #endif  // GTEST_OS_LINUX
3062
3063 #include <ctype.h>
3064 #include <string.h>
3065 #include <iomanip>
3066 #include <limits>
3067 #include <set>
3068
3069 // Copyright 2005, Google Inc.
3070 // All rights reserved.
3071 //
3072 // Redistribution and use in source and binary forms, with or without
3073 // modification, are permitted provided that the following conditions are
3074 // met:
3075 //
3076 //     * Redistributions of source code must retain the above copyright
3077 // notice, this list of conditions and the following disclaimer.
3078 //     * Redistributions in binary form must reproduce the above
3079 // copyright notice, this list of conditions and the following disclaimer
3080 // in the documentation and/or other materials provided with the
3081 // distribution.
3082 //     * Neither the name of Google Inc. nor the names of its
3083 // contributors may be used to endorse or promote products derived from
3084 // this software without specific prior written permission.
3085 //
3086 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3087 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3088 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3089 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3090 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3091 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3092 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3093 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3094 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3095 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3096 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3097 //
3098 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
3099 //
3100 // The Google C++ Testing Framework (Google Test)
3101 //
3102 // This header file declares the String class and functions used internally by
3103 // Google Test.  They are subject to change without notice. They should not used
3104 // by code external to Google Test.
3105 //
3106 // This header file is #included by <gtest/internal/gtest-internal.h>.
3107 // It should not be #included by other files.
3108
3109 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3110 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3111
3112 #ifdef __BORLANDC__
3113 // string.h is not guaranteed to provide strcpy on C++ Builder.
3114 # include <mem.h>
3115 #endif
3116
3117 #include <string.h>
3118 #include <string>
3119
3120
3121 namespace testing {
3122 namespace internal {
3123
3124 // String - an abstract class holding static string utilities.
3125 class GTEST_API_ String {
3126  public:
3127   // Static utility methods
3128
3129   // Clones a 0-terminated C string, allocating memory using new.  The
3130   // caller is responsible for deleting the return value using
3131   // delete[].  Returns the cloned string, or NULL if the input is
3132   // NULL.
3133   //
3134   // This is different from strdup() in string.h, which allocates
3135   // memory using malloc().
3136   static const char* CloneCString(const char* c_str);
3137
3138 #if GTEST_OS_WINDOWS_MOBILE
3139   // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
3140   // able to pass strings to Win32 APIs on CE we need to convert them
3141   // to 'Unicode', UTF-16.
3142
3143   // Creates a UTF-16 wide string from the given ANSI string, allocating
3144   // memory using new. The caller is responsible for deleting the return
3145   // value using delete[]. Returns the wide string, or NULL if the
3146   // input is NULL.
3147   //
3148   // The wide string is created using the ANSI codepage (CP_ACP) to
3149   // match the behaviour of the ANSI versions of Win32 calls and the
3150   // C runtime.
3151   static LPCWSTR AnsiToUtf16(const char* c_str);
3152
3153   // Creates an ANSI string from the given wide string, allocating
3154   // memory using new. The caller is responsible for deleting the return
3155   // value using delete[]. Returns the ANSI string, or NULL if the
3156   // input is NULL.
3157   //
3158   // The returned string is created using the ANSI codepage (CP_ACP) to
3159   // match the behaviour of the ANSI versions of Win32 calls and the
3160   // C runtime.
3161   static const char* Utf16ToAnsi(LPCWSTR utf16_str);
3162 #endif
3163
3164   // Compares two C strings.  Returns true iff they have the same content.
3165   //
3166   // Unlike strcmp(), this function can handle NULL argument(s).  A
3167   // NULL C string is considered different to any non-NULL C string,
3168   // including the empty string.
3169   static bool CStringEquals(const char* lhs, const char* rhs);
3170
3171   // Converts a wide C string to a String using the UTF-8 encoding.
3172   // NULL will be converted to "(null)".  If an error occurred during
3173   // the conversion, "(failed to convert from wide string)" is
3174   // returned.
3175   static std::string ShowWideCString(const wchar_t* wide_c_str);
3176
3177   // Compares two wide C strings.  Returns true iff they have the same
3178   // content.
3179   //
3180   // Unlike wcscmp(), this function can handle NULL argument(s).  A
3181   // NULL C string is considered different to any non-NULL C string,
3182   // including the empty string.
3183   static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
3184
3185   // Compares two C strings, ignoring case.  Returns true iff they
3186   // have the same content.
3187   //
3188   // Unlike strcasecmp(), this function can handle NULL argument(s).
3189   // A NULL C string is considered different to any non-NULL C string,
3190   // including the empty string.
3191   static bool CaseInsensitiveCStringEquals(const char* lhs,
3192                                            const char* rhs);
3193
3194   // Compares two wide C strings, ignoring case.  Returns true iff they
3195   // have the same content.
3196   //
3197   // Unlike wcscasecmp(), this function can handle NULL argument(s).
3198   // A NULL C string is considered different to any non-NULL wide C string,
3199   // including the empty string.
3200   // NB: The implementations on different platforms slightly differ.
3201   // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
3202   // environment variable. On GNU platform this method uses wcscasecmp
3203   // which compares according to LC_CTYPE category of the current locale.
3204   // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
3205   // current locale.
3206   static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
3207                                                const wchar_t* rhs);
3208
3209   // Returns true iff the given string ends with the given suffix, ignoring
3210   // case. Any string is considered to end with an empty suffix.
3211   static bool EndsWithCaseInsensitive(
3212       const std::string& str, const std::string& suffix);
3213
3214   // Formats a list of arguments to an std::string, using the same format
3215   // spec string as for printf.
3216   //
3217   // We do not use the StringPrintf class as it is not universally
3218   // available.
3219   //
3220   // The result is limited to 4096 characters (including the tailing
3221   // 0).  If 4096 characters are not enough to format the input,
3222   // "<buffer exceeded>" is returned.
3223   static std::string Format(const char* format, ...);
3224
3225  private:
3226   String();  // Not meant to be instantiated.
3227 };  // class String
3228
3229 // Gets the content of the stringstream's buffer as an std::string.  Each '\0'
3230 // character in the buffer is replaced with "\\0".
3231 GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
3232
3233 // Converts a streamable value to an std::string.  A NULL pointer is
3234 // converted to "(null)".  When the input value is a ::string,
3235 // ::std::string, ::wstring, or ::std::wstring object, each NUL
3236 // character in it is replaced with "\\0".
3237
3238 // Declared here but defined in gtest.h, so that it has access
3239 // to the definition of the Message class, required by the ARM
3240 // compiler.
3241 template <typename T>
3242 std::string StreamableToString(const T& streamable);
3243
3244 }  // namespace internal
3245 }  // namespace testing
3246
3247 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
3248 // Copyright 2008, Google Inc.
3249 // All rights reserved.
3250 //
3251 // Redistribution and use in source and binary forms, with or without
3252 // modification, are permitted provided that the following conditions are
3253 // met:
3254 //
3255 //     * Redistributions of source code must retain the above copyright
3256 // notice, this list of conditions and the following disclaimer.
3257 //     * Redistributions in binary form must reproduce the above
3258 // copyright notice, this list of conditions and the following disclaimer
3259 // in the documentation and/or other materials provided with the
3260 // distribution.
3261 //     * Neither the name of Google Inc. nor the names of its
3262 // contributors may be used to endorse or promote products derived from
3263 // this software without specific prior written permission.
3264 //
3265 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3266 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3267 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3268 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3269 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3270 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3271 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3272 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3273 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3274 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3275 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3276 //
3277 // Author: keith.ray@gmail.com (Keith Ray)
3278 //
3279 // Google Test filepath utilities
3280 //
3281 // This header file declares classes and functions used internally by
3282 // Google Test.  They are subject to change without notice.
3283 //
3284 // This file is #included in <gtest/internal/gtest-internal.h>.
3285 // Do not include this header file separately!
3286
3287 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3288 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3289
3290
3291 namespace testing {
3292 namespace internal {
3293
3294 // FilePath - a class for file and directory pathname manipulation which
3295 // handles platform-specific conventions (like the pathname separator).
3296 // Used for helper functions for naming files in a directory for xml output.
3297 // Except for Set methods, all methods are const or static, which provides an
3298 // "immutable value object" -- useful for peace of mind.
3299 // A FilePath with a value ending in a path separator ("like/this/") represents
3300 // a directory, otherwise it is assumed to represent a file. In either case,
3301 // it may or may not represent an actual file or directory in the file system.
3302 // Names are NOT checked for syntax correctness -- no checking for illegal
3303 // characters, malformed paths, etc.
3304
3305 class GTEST_API_ FilePath {
3306  public:
3307   FilePath() : pathname_("") { }
3308   FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
3309
3310   explicit FilePath(const std::string& pathname) : pathname_(pathname) {
3311     Normalize();
3312   }
3313
3314   FilePath& operator=(const FilePath& rhs) {
3315     Set(rhs);
3316     return *this;
3317   }
3318
3319   void Set(const FilePath& rhs) {
3320     pathname_ = rhs.pathname_;
3321   }
3322
3323   const std::string& string() const { return pathname_; }
3324   const char* c_str() const { return pathname_.c_str(); }
3325
3326   // Returns the current working directory, or "" if unsuccessful.
3327   static FilePath GetCurrentDir();
3328
3329   // Given directory = "dir", base_name = "test", number = 0,
3330   // extension = "xml", returns "dir/test.xml". If number is greater
3331   // than zero (e.g., 12), returns "dir/test_12.xml".
3332   // On Windows platform, uses \ as the separator rather than /.
3333   static FilePath MakeFileName(const FilePath& directory,
3334                                const FilePath& base_name,
3335                                int number,
3336                                const char* extension);
3337
3338   // Given directory = "dir", relative_path = "test.xml",
3339   // returns "dir/test.xml".
3340   // On Windows, uses \ as the separator rather than /.
3341   static FilePath ConcatPaths(const FilePath& directory,
3342                               const FilePath& relative_path);
3343
3344   // Returns a pathname for a file that does not currently exist. The pathname
3345   // will be directory/base_name.extension or
3346   // directory/base_name_<number>.extension if directory/base_name.extension
3347   // already exists. The number will be incremented until a pathname is found
3348   // that does not already exist.
3349   // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
3350   // There could be a race condition if two or more processes are calling this
3351   // function at the same time -- they could both pick the same filename.
3352   static FilePath GenerateUniqueFileName(const FilePath& directory,
3353                                          const FilePath& base_name,
3354                                          const char* extension);
3355
3356   // Returns true iff the path is "".
3357   bool IsEmpty() const { return pathname_.empty(); }
3358
3359   // If input name has a trailing separator character, removes it and returns
3360   // the name, otherwise return the name string unmodified.
3361   // On Windows platform, uses \ as the separator, other platforms use /.
3362   FilePath RemoveTrailingPathSeparator() const;
3363
3364   // Returns a copy of the FilePath with the directory part removed.
3365   // Example: FilePath("path/to/file").RemoveDirectoryName() returns
3366   // FilePath("file"). If there is no directory part ("just_a_file"), it returns
3367   // the FilePath unmodified. If there is no file part ("just_a_dir/") it
3368   // returns an empty FilePath ("").
3369   // On Windows platform, '\' is the path separator, otherwise it is '/'.
3370   FilePath RemoveDirectoryName() const;
3371
3372   // RemoveFileName returns the directory path with the filename removed.
3373   // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
3374   // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
3375   // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
3376   // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
3377   // On Windows platform, '\' is the path separator, otherwise it is '/'.
3378   FilePath RemoveFileName() const;
3379
3380   // Returns a copy of the FilePath with the case-insensitive extension removed.
3381   // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
3382   // FilePath("dir/file"). If a case-insensitive extension is not
3383   // found, returns a copy of the original FilePath.
3384   FilePath RemoveExtension(const char* extension) const;
3385
3386   // Creates directories so that path exists. Returns true if successful or if
3387   // the directories already exist; returns false if unable to create
3388   // directories for any reason. Will also return false if the FilePath does
3389   // not represent a directory (that is, it doesn't end with a path separator).
3390   bool CreateDirectoriesRecursively() const;
3391
3392   // Create the directory so that path exists. Returns true if successful or
3393   // if the directory already exists; returns false if unable to create the
3394   // directory for any reason, including if the parent directory does not
3395   // exist. Not named "CreateDirectory" because that's a macro on Windows.
3396   bool CreateFolder() const;
3397
3398   // Returns true if FilePath describes something in the file-system,
3399   // either a file, directory, or whatever, and that something exists.
3400   bool FileOrDirectoryExists() const;
3401
3402   // Returns true if pathname describes a directory in the file-system
3403   // that exists.
3404   bool DirectoryExists() const;
3405
3406   // Returns true if FilePath ends with a path separator, which indicates that
3407   // it is intended to represent a directory. Returns false otherwise.
3408   // This does NOT check that a directory (or file) actually exists.
3409   bool IsDirectory() const;
3410
3411   // Returns true if pathname describes a root directory. (Windows has one
3412   // root directory per disk drive.)
3413   bool IsRootDirectory() const;
3414
3415   // Returns true if pathname describes an absolute path.
3416   bool IsAbsolutePath() const;
3417
3418  private:
3419   // Replaces multiple consecutive separators with a single separator.
3420   // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
3421   // redundancies that might be in a pathname involving "." or "..".
3422   //
3423   // A pathname with multiple consecutive separators may occur either through
3424   // user error or as a result of some scripts or APIs that generate a pathname
3425   // with a trailing separator. On other platforms the same API or script
3426   // may NOT generate a pathname with a trailing "/". Then elsewhere that
3427   // pathname may have another "/" and pathname components added to it,
3428   // without checking for the separator already being there.
3429   // The script language and operating system may allow paths like "foo//bar"
3430   // but some of the functions in FilePath will not handle that correctly. In
3431   // particular, RemoveTrailingPathSeparator() only removes one separator, and
3432   // it is called in CreateDirectoriesRecursively() assuming that it will change
3433   // a pathname from directory syntax (trailing separator) to filename syntax.
3434   //
3435   // On Windows this method also replaces the alternate path separator '/' with
3436   // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
3437   // "bar\\foo".
3438
3439   void Normalize();
3440
3441   // Returns a pointer to the last occurence of a valid path separator in
3442   // the FilePath. On Windows, for example, both '/' and '\' are valid path
3443   // separators. Returns NULL if no path separator was found.
3444   const char* FindLastPathSeparator() const;
3445
3446   std::string pathname_;
3447 };  // class FilePath
3448
3449 }  // namespace internal
3450 }  // namespace testing
3451
3452 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
3453 // This file was GENERATED by command:
3454 //     pump.py gtest-type-util.h.pump
3455 // DO NOT EDIT BY HAND!!!
3456
3457 // Copyright 2008 Google Inc.
3458 // All Rights Reserved.
3459 //
3460 // Redistribution and use in source and binary forms, with or without
3461 // modification, are permitted provided that the following conditions are
3462 // met:
3463 //
3464 //     * Redistributions of source code must retain the above copyright
3465 // notice, this list of conditions and the following disclaimer.
3466 //     * Redistributions in binary form must reproduce the above
3467 // copyright notice, this list of conditions and the following disclaimer
3468 // in the documentation and/or other materials provided with the
3469 // distribution.
3470 //     * Neither the name of Google Inc. nor the names of its
3471 // contributors may be used to endorse or promote products derived from
3472 // this software without specific prior written permission.
3473 //
3474 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3475 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3476 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3477 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3478 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3479 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3480 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3481 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3482 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3483 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3484 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3485 //
3486 // Author: wan@google.com (Zhanyong Wan)
3487
3488 // Type utilities needed for implementing typed and type-parameterized
3489 // tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
3490 //
3491 // Currently we support at most 50 types in a list, and at most 50
3492 // type-parameterized tests in one type-parameterized test case.
3493 // Please contact googletestframework@googlegroups.com if you need
3494 // more.
3495
3496 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3497 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
3498
3499
3500 // #ifdef __GNUC__ is too general here.  It is possible to use gcc without using
3501 // libstdc++ (which is where cxxabi.h comes from).
3502 # if GTEST_HAS_CXXABI_H_
3503 #  include <cxxabi.h>
3504 # elif defined(__HP_aCC)
3505 #  include <acxx_demangle.h>
3506 # endif  // GTEST_HASH_CXXABI_H_
3507
3508 namespace testing {
3509 namespace internal {
3510
3511 // GetTypeName<T>() returns a human-readable name of type T.
3512 // NB: This function is also used in Google Mock, so don't move it inside of
3513 // the typed-test-only section below.
3514 template <typename T>
3515 std::string GetTypeName() {
3516 # if GTEST_HAS_RTTI
3517
3518   const char* const name = typeid(T).name();
3519 #  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
3520   int status = 0;
3521   // gcc's implementation of typeid(T).name() mangles the type name,
3522   // so we have to demangle it.
3523 #   if GTEST_HAS_CXXABI_H_
3524   using abi::__cxa_demangle;
3525 #   endif  // GTEST_HAS_CXXABI_H_
3526   char* const readable_name = __cxa_demangle(name, 0, 0, &status);
3527   const std::string name_str(status == 0 ? readable_name : name);
3528   free(readable_name);
3529   return name_str;
3530 #  else
3531   return name;
3532 #  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC
3533
3534 # else
3535
3536   return "<type>";
3537
3538 # endif  // GTEST_HAS_RTTI
3539 }
3540
3541 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
3542
3543 // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
3544 // type.  This can be used as a compile-time assertion to ensure that
3545 // two types are equal.
3546
3547 template <typename T1, typename T2>
3548 struct AssertTypeEq;
3549
3550 template <typename T>
3551 struct AssertTypeEq<T, T> {
3552   typedef bool type;
3553 };
3554
3555 // A unique type used as the default value for the arguments of class
3556 // template Types.  This allows us to simulate variadic templates
3557 // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
3558 // support directly.
3559 struct None {};
3560
3561 // The following family of struct and struct templates are used to
3562 // represent type lists.  In particular, TypesN<T1, T2, ..., TN>
3563 // represents a type list with N types (T1, T2, ..., and TN) in it.
3564 // Except for Types0, every struct in the family has two member types:
3565 // Head for the first type in the list, and Tail for the rest of the
3566 // list.
3567
3568 // The empty type list.
3569 struct Types0 {};
3570
3571 // Type lists of length 1, 2, 3, and so on.
3572
3573 template <typename T1>
3574 struct Types1 {
3575   typedef T1 Head;
3576   typedef Types0 Tail;
3577 };
3578 template <typename T1, typename T2>
3579 struct Types2 {
3580   typedef T1 Head;
3581   typedef Types1<T2> Tail;
3582 };
3583
3584 template <typename T1, typename T2, typename T3>
3585 struct Types3 {
3586   typedef T1 Head;
3587   typedef Types2<T2, T3> Tail;
3588 };
3589
3590 template <typename T1, typename T2, typename T3, typename T4>
3591 struct Types4 {
3592   typedef T1 Head;
3593   typedef Types3<T2, T3, T4> Tail;
3594 };
3595
3596 template <typename T1, typename T2, typename T3, typename T4, typename T5>
3597 struct Types5 {
3598   typedef T1 Head;
3599   typedef Types4<T2, T3, T4, T5> Tail;
3600 };
3601
3602 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3603     typename T6>
3604 struct Types6 {
3605   typedef T1 Head;
3606   typedef Types5<T2, T3, T4, T5, T6> Tail;
3607 };
3608
3609 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3610     typename T6, typename T7>
3611 struct Types7 {
3612   typedef T1 Head;
3613   typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
3614 };
3615
3616 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3617     typename T6, typename T7, typename T8>
3618 struct Types8 {
3619   typedef T1 Head;
3620   typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
3621 };
3622
3623 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3624     typename T6, typename T7, typename T8, typename T9>
3625 struct Types9 {
3626   typedef T1 Head;
3627   typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
3628 };
3629
3630 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3631     typename T6, typename T7, typename T8, typename T9, typename T10>
3632 struct Types10 {
3633   typedef T1 Head;
3634   typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
3635 };
3636
3637 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3638     typename T6, typename T7, typename T8, typename T9, typename T10,
3639     typename T11>
3640 struct Types11 {
3641   typedef T1 Head;
3642   typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
3643 };
3644
3645 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3646     typename T6, typename T7, typename T8, typename T9, typename T10,
3647     typename T11, typename T12>
3648 struct Types12 {
3649   typedef T1 Head;
3650   typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
3651 };
3652
3653 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3654     typename T6, typename T7, typename T8, typename T9, typename T10,
3655     typename T11, typename T12, typename T13>
3656 struct Types13 {
3657   typedef T1 Head;
3658   typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
3659 };
3660
3661 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3662     typename T6, typename T7, typename T8, typename T9, typename T10,
3663     typename T11, typename T12, typename T13, typename T14>
3664 struct Types14 {
3665   typedef T1 Head;
3666   typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
3667 };
3668
3669 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3670     typename T6, typename T7, typename T8, typename T9, typename T10,
3671     typename T11, typename T12, typename T13, typename T14, typename T15>
3672 struct Types15 {
3673   typedef T1 Head;
3674   typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
3675       T15> Tail;
3676 };
3677
3678 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3679     typename T6, typename T7, typename T8, typename T9, typename T10,
3680     typename T11, typename T12, typename T13, typename T14, typename T15,
3681     typename T16>
3682 struct Types16 {
3683   typedef T1 Head;
3684   typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3685       T16> Tail;
3686 };
3687
3688 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3689     typename T6, typename T7, typename T8, typename T9, typename T10,
3690     typename T11, typename T12, typename T13, typename T14, typename T15,
3691     typename T16, typename T17>
3692 struct Types17 {
3693   typedef T1 Head;
3694   typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3695       T16, T17> Tail;
3696 };
3697
3698 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3699     typename T6, typename T7, typename T8, typename T9, typename T10,
3700     typename T11, typename T12, typename T13, typename T14, typename T15,
3701     typename T16, typename T17, typename T18>
3702 struct Types18 {
3703   typedef T1 Head;
3704   typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3705       T16, T17, T18> Tail;
3706 };
3707
3708 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3709     typename T6, typename T7, typename T8, typename T9, typename T10,
3710     typename T11, typename T12, typename T13, typename T14, typename T15,
3711     typename T16, typename T17, typename T18, typename T19>
3712 struct Types19 {
3713   typedef T1 Head;
3714   typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3715       T16, T17, T18, T19> Tail;
3716 };
3717
3718 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3719     typename T6, typename T7, typename T8, typename T9, typename T10,
3720     typename T11, typename T12, typename T13, typename T14, typename T15,
3721     typename T16, typename T17, typename T18, typename T19, typename T20>
3722 struct Types20 {
3723   typedef T1 Head;
3724   typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3725       T16, T17, T18, T19, T20> Tail;
3726 };
3727
3728 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3729     typename T6, typename T7, typename T8, typename T9, typename T10,
3730     typename T11, typename T12, typename T13, typename T14, typename T15,
3731     typename T16, typename T17, typename T18, typename T19, typename T20,
3732     typename T21>
3733 struct Types21 {
3734   typedef T1 Head;
3735   typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3736       T16, T17, T18, T19, T20, T21> Tail;
3737 };
3738
3739 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3740     typename T6, typename T7, typename T8, typename T9, typename T10,
3741     typename T11, typename T12, typename T13, typename T14, typename T15,
3742     typename T16, typename T17, typename T18, typename T19, typename T20,
3743     typename T21, typename T22>
3744 struct Types22 {
3745   typedef T1 Head;
3746   typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3747       T16, T17, T18, T19, T20, T21, T22> Tail;
3748 };
3749
3750 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3751     typename T6, typename T7, typename T8, typename T9, typename T10,
3752     typename T11, typename T12, typename T13, typename T14, typename T15,
3753     typename T16, typename T17, typename T18, typename T19, typename T20,
3754     typename T21, typename T22, typename T23>
3755 struct Types23 {
3756   typedef T1 Head;
3757   typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3758       T16, T17, T18, T19, T20, T21, T22, T23> Tail;
3759 };
3760
3761 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3762     typename T6, typename T7, typename T8, typename T9, typename T10,
3763     typename T11, typename T12, typename T13, typename T14, typename T15,
3764     typename T16, typename T17, typename T18, typename T19, typename T20,
3765     typename T21, typename T22, typename T23, typename T24>
3766 struct Types24 {
3767   typedef T1 Head;
3768   typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3769       T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
3770 };
3771
3772 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3773     typename T6, typename T7, typename T8, typename T9, typename T10,
3774     typename T11, typename T12, typename T13, typename T14, typename T15,
3775     typename T16, typename T17, typename T18, typename T19, typename T20,
3776     typename T21, typename T22, typename T23, typename T24, typename T25>
3777 struct Types25 {
3778   typedef T1 Head;
3779   typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3780       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
3781 };
3782
3783 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3784     typename T6, typename T7, typename T8, typename T9, typename T10,
3785     typename T11, typename T12, typename T13, typename T14, typename T15,
3786     typename T16, typename T17, typename T18, typename T19, typename T20,
3787     typename T21, typename T22, typename T23, typename T24, typename T25,
3788     typename T26>
3789 struct Types26 {
3790   typedef T1 Head;
3791   typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3792       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
3793 };
3794
3795 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3796     typename T6, typename T7, typename T8, typename T9, typename T10,
3797     typename T11, typename T12, typename T13, typename T14, typename T15,
3798     typename T16, typename T17, typename T18, typename T19, typename T20,
3799     typename T21, typename T22, typename T23, typename T24, typename T25,
3800     typename T26, typename T27>
3801 struct Types27 {
3802   typedef T1 Head;
3803   typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3804       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
3805 };
3806
3807 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3808     typename T6, typename T7, typename T8, typename T9, typename T10,
3809     typename T11, typename T12, typename T13, typename T14, typename T15,
3810     typename T16, typename T17, typename T18, typename T19, typename T20,
3811     typename T21, typename T22, typename T23, typename T24, typename T25,
3812     typename T26, typename T27, typename T28>
3813 struct Types28 {
3814   typedef T1 Head;
3815   typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3816       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
3817 };
3818
3819 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3820     typename T6, typename T7, typename T8, typename T9, typename T10,
3821     typename T11, typename T12, typename T13, typename T14, typename T15,
3822     typename T16, typename T17, typename T18, typename T19, typename T20,
3823     typename T21, typename T22, typename T23, typename T24, typename T25,
3824     typename T26, typename T27, typename T28, typename T29>
3825 struct Types29 {
3826   typedef T1 Head;
3827   typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3828       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
3829       T29> Tail;
3830 };
3831
3832 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3833     typename T6, typename T7, typename T8, typename T9, typename T10,
3834     typename T11, typename T12, typename T13, typename T14, typename T15,
3835     typename T16, typename T17, typename T18, typename T19, typename T20,
3836     typename T21, typename T22, typename T23, typename T24, typename T25,
3837     typename T26, typename T27, typename T28, typename T29, typename T30>
3838 struct Types30 {
3839   typedef T1 Head;
3840   typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3841       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3842       T30> Tail;
3843 };
3844
3845 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3846     typename T6, typename T7, typename T8, typename T9, typename T10,
3847     typename T11, typename T12, typename T13, typename T14, typename T15,
3848     typename T16, typename T17, typename T18, typename T19, typename T20,
3849     typename T21, typename T22, typename T23, typename T24, typename T25,
3850     typename T26, typename T27, typename T28, typename T29, typename T30,
3851     typename T31>
3852 struct Types31 {
3853   typedef T1 Head;
3854   typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3855       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3856       T30, T31> Tail;
3857 };
3858
3859 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3860     typename T6, typename T7, typename T8, typename T9, typename T10,
3861     typename T11, typename T12, typename T13, typename T14, typename T15,
3862     typename T16, typename T17, typename T18, typename T19, typename T20,
3863     typename T21, typename T22, typename T23, typename T24, typename T25,
3864     typename T26, typename T27, typename T28, typename T29, typename T30,
3865     typename T31, typename T32>
3866 struct Types32 {
3867   typedef T1 Head;
3868   typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3869       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3870       T30, T31, T32> Tail;
3871 };
3872
3873 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3874     typename T6, typename T7, typename T8, typename T9, typename T10,
3875     typename T11, typename T12, typename T13, typename T14, typename T15,
3876     typename T16, typename T17, typename T18, typename T19, typename T20,
3877     typename T21, typename T22, typename T23, typename T24, typename T25,
3878     typename T26, typename T27, typename T28, typename T29, typename T30,
3879     typename T31, typename T32, typename T33>
3880 struct Types33 {
3881   typedef T1 Head;
3882   typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3883       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3884       T30, T31, T32, T33> Tail;
3885 };
3886
3887 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3888     typename T6, typename T7, typename T8, typename T9, typename T10,
3889     typename T11, typename T12, typename T13, typename T14, typename T15,
3890     typename T16, typename T17, typename T18, typename T19, typename T20,
3891     typename T21, typename T22, typename T23, typename T24, typename T25,
3892     typename T26, typename T27, typename T28, typename T29, typename T30,
3893     typename T31, typename T32, typename T33, typename T34>
3894 struct Types34 {
3895   typedef T1 Head;
3896   typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3897       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3898       T30, T31, T32, T33, T34> Tail;
3899 };
3900
3901 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3902     typename T6, typename T7, typename T8, typename T9, typename T10,
3903     typename T11, typename T12, typename T13, typename T14, typename T15,
3904     typename T16, typename T17, typename T18, typename T19, typename T20,
3905     typename T21, typename T22, typename T23, typename T24, typename T25,
3906     typename T26, typename T27, typename T28, typename T29, typename T30,
3907     typename T31, typename T32, typename T33, typename T34, typename T35>
3908 struct Types35 {
3909   typedef T1 Head;
3910   typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3911       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3912       T30, T31, T32, T33, T34, T35> Tail;
3913 };
3914
3915 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3916     typename T6, typename T7, typename T8, typename T9, typename T10,
3917     typename T11, typename T12, typename T13, typename T14, typename T15,
3918     typename T16, typename T17, typename T18, typename T19, typename T20,
3919     typename T21, typename T22, typename T23, typename T24, typename T25,
3920     typename T26, typename T27, typename T28, typename T29, typename T30,
3921     typename T31, typename T32, typename T33, typename T34, typename T35,
3922     typename T36>
3923 struct Types36 {
3924   typedef T1 Head;
3925   typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3926       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3927       T30, T31, T32, T33, T34, T35, T36> Tail;
3928 };
3929
3930 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3931     typename T6, typename T7, typename T8, typename T9, typename T10,
3932     typename T11, typename T12, typename T13, typename T14, typename T15,
3933     typename T16, typename T17, typename T18, typename T19, typename T20,
3934     typename T21, typename T22, typename T23, typename T24, typename T25,
3935     typename T26, typename T27, typename T28, typename T29, typename T30,
3936     typename T31, typename T32, typename T33, typename T34, typename T35,
3937     typename T36, typename T37>
3938 struct Types37 {
3939   typedef T1 Head;
3940   typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3941       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3942       T30, T31, T32, T33, T34, T35, T36, T37> Tail;
3943 };
3944
3945 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3946     typename T6, typename T7, typename T8, typename T9, typename T10,
3947     typename T11, typename T12, typename T13, typename T14, typename T15,
3948     typename T16, typename T17, typename T18, typename T19, typename T20,
3949     typename T21, typename T22, typename T23, typename T24, typename T25,
3950     typename T26, typename T27, typename T28, typename T29, typename T30,
3951     typename T31, typename T32, typename T33, typename T34, typename T35,
3952     typename T36, typename T37, typename T38>
3953 struct Types38 {
3954   typedef T1 Head;
3955   typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3956       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3957       T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
3958 };
3959
3960 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3961     typename T6, typename T7, typename T8, typename T9, typename T10,
3962     typename T11, typename T12, typename T13, typename T14, typename T15,
3963     typename T16, typename T17, typename T18, typename T19, typename T20,
3964     typename T21, typename T22, typename T23, typename T24, typename T25,
3965     typename T26, typename T27, typename T28, typename T29, typename T30,
3966     typename T31, typename T32, typename T33, typename T34, typename T35,
3967     typename T36, typename T37, typename T38, typename T39>
3968 struct Types39 {
3969   typedef T1 Head;
3970   typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3971       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3972       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
3973 };
3974
3975 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3976     typename T6, typename T7, typename T8, typename T9, typename T10,
3977     typename T11, typename T12, typename T13, typename T14, typename T15,
3978     typename T16, typename T17, typename T18, typename T19, typename T20,
3979     typename T21, typename T22, typename T23, typename T24, typename T25,
3980     typename T26, typename T27, typename T28, typename T29, typename T30,
3981     typename T31, typename T32, typename T33, typename T34, typename T35,
3982     typename T36, typename T37, typename T38, typename T39, typename T40>
3983 struct Types40 {
3984   typedef T1 Head;
3985   typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
3986       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
3987       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
3988 };
3989
3990 template <typename T1, typename T2, typename T3, typename T4, typename T5,
3991     typename T6, typename T7, typename T8, typename T9, typename T10,
3992     typename T11, typename T12, typename T13, typename T14, typename T15,
3993     typename T16, typename T17, typename T18, typename T19, typename T20,
3994     typename T21, typename T22, typename T23, typename T24, typename T25,
3995     typename T26, typename T27, typename T28, typename T29, typename T30,
3996     typename T31, typename T32, typename T33, typename T34, typename T35,
3997     typename T36, typename T37, typename T38, typename T39, typename T40,
3998     typename T41>
3999 struct Types41 {
4000   typedef T1 Head;
4001   typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4002       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4003       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> 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, typename T25,
4011     typename T26, typename T27, typename T28, typename T29, typename T30,
4012     typename T31, typename T32, typename T33, typename T34, typename T35,
4013     typename T36, typename T37, typename T38, typename T39, typename T40,
4014     typename T41, typename T42>
4015 struct Types42 {
4016   typedef T1 Head;
4017   typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4018       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4019       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
4020 };
4021
4022 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4023     typename T6, typename T7, typename T8, typename T9, typename T10,
4024     typename T11, typename T12, typename T13, typename T14, typename T15,
4025     typename T16, typename T17, typename T18, typename T19, typename T20,
4026     typename T21, typename T22, typename T23, typename T24, typename T25,
4027     typename T26, typename T27, typename T28, typename T29, typename T30,
4028     typename T31, typename T32, typename T33, typename T34, typename T35,
4029     typename T36, typename T37, typename T38, typename T39, typename T40,
4030     typename T41, typename T42, typename T43>
4031 struct Types43 {
4032   typedef T1 Head;
4033   typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4034       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4035       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
4036       T43> Tail;
4037 };
4038
4039 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4040     typename T6, typename T7, typename T8, typename T9, typename T10,
4041     typename T11, typename T12, typename T13, typename T14, typename T15,
4042     typename T16, typename T17, typename T18, typename T19, typename T20,
4043     typename T21, typename T22, typename T23, typename T24, typename T25,
4044     typename T26, typename T27, typename T28, typename T29, typename T30,
4045     typename T31, typename T32, typename T33, typename T34, typename T35,
4046     typename T36, typename T37, typename T38, typename T39, typename T40,
4047     typename T41, typename T42, typename T43, typename T44>
4048 struct Types44 {
4049   typedef T1 Head;
4050   typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4051       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4052       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4053       T44> Tail;
4054 };
4055
4056 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4057     typename T6, typename T7, typename T8, typename T9, typename T10,
4058     typename T11, typename T12, typename T13, typename T14, typename T15,
4059     typename T16, typename T17, typename T18, typename T19, typename T20,
4060     typename T21, typename T22, typename T23, typename T24, typename T25,
4061     typename T26, typename T27, typename T28, typename T29, typename T30,
4062     typename T31, typename T32, typename T33, typename T34, typename T35,
4063     typename T36, typename T37, typename T38, typename T39, typename T40,
4064     typename T41, typename T42, typename T43, typename T44, typename T45>
4065 struct Types45 {
4066   typedef T1 Head;
4067   typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4068       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4069       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4070       T44, T45> Tail;
4071 };
4072
4073 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4074     typename T6, typename T7, typename T8, typename T9, typename T10,
4075     typename T11, typename T12, typename T13, typename T14, typename T15,
4076     typename T16, typename T17, typename T18, typename T19, typename T20,
4077     typename T21, typename T22, typename T23, typename T24, typename T25,
4078     typename T26, typename T27, typename T28, typename T29, typename T30,
4079     typename T31, typename T32, typename T33, typename T34, typename T35,
4080     typename T36, typename T37, typename T38, typename T39, typename T40,
4081     typename T41, typename T42, typename T43, typename T44, typename T45,
4082     typename T46>
4083 struct Types46 {
4084   typedef T1 Head;
4085   typedef Types45<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, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4088       T44, T45, T46> Tail;
4089 };
4090
4091 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4092     typename T6, typename T7, typename T8, typename T9, typename T10,
4093     typename T11, typename T12, typename T13, typename T14, typename T15,
4094     typename T16, typename T17, typename T18, typename T19, typename T20,
4095     typename T21, typename T22, typename T23, typename T24, typename T25,
4096     typename T26, typename T27, typename T28, typename T29, typename T30,
4097     typename T31, typename T32, typename T33, typename T34, typename T35,
4098     typename T36, typename T37, typename T38, typename T39, typename T40,
4099     typename T41, typename T42, typename T43, typename T44, typename T45,
4100     typename T46, typename T47>
4101 struct Types47 {
4102   typedef T1 Head;
4103   typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4104       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4105       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4106       T44, T45, T46, T47> Tail;
4107 };
4108
4109 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4110     typename T6, typename T7, typename T8, typename T9, typename T10,
4111     typename T11, typename T12, typename T13, typename T14, typename T15,
4112     typename T16, typename T17, typename T18, typename T19, typename T20,
4113     typename T21, typename T22, typename T23, typename T24, typename T25,
4114     typename T26, typename T27, typename T28, typename T29, typename T30,
4115     typename T31, typename T32, typename T33, typename T34, typename T35,
4116     typename T36, typename T37, typename T38, typename T39, typename T40,
4117     typename T41, typename T42, typename T43, typename T44, typename T45,
4118     typename T46, typename T47, typename T48>
4119 struct Types48 {
4120   typedef T1 Head;
4121   typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4122       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4123       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4124       T44, T45, T46, T47, T48> Tail;
4125 };
4126
4127 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4128     typename T6, typename T7, typename T8, typename T9, typename T10,
4129     typename T11, typename T12, typename T13, typename T14, typename T15,
4130     typename T16, typename T17, typename T18, typename T19, typename T20,
4131     typename T21, typename T22, typename T23, typename T24, typename T25,
4132     typename T26, typename T27, typename T28, typename T29, typename T30,
4133     typename T31, typename T32, typename T33, typename T34, typename T35,
4134     typename T36, typename T37, typename T38, typename T39, typename T40,
4135     typename T41, typename T42, typename T43, typename T44, typename T45,
4136     typename T46, typename T47, typename T48, typename T49>
4137 struct Types49 {
4138   typedef T1 Head;
4139   typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4140       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4141       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4142       T44, T45, T46, T47, T48, T49> Tail;
4143 };
4144
4145 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4146     typename T6, typename T7, typename T8, typename T9, typename T10,
4147     typename T11, typename T12, typename T13, typename T14, typename T15,
4148     typename T16, typename T17, typename T18, typename T19, typename T20,
4149     typename T21, typename T22, typename T23, typename T24, typename T25,
4150     typename T26, typename T27, typename T28, typename T29, typename T30,
4151     typename T31, typename T32, typename T33, typename T34, typename T35,
4152     typename T36, typename T37, typename T38, typename T39, typename T40,
4153     typename T41, typename T42, typename T43, typename T44, typename T45,
4154     typename T46, typename T47, typename T48, typename T49, typename T50>
4155 struct Types50 {
4156   typedef T1 Head;
4157   typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4158       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4159       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4160       T44, T45, T46, T47, T48, T49, T50> Tail;
4161 };
4162
4163
4164 }  // namespace internal
4165
4166 // We don't want to require the users to write TypesN<...> directly,
4167 // as that would require them to count the length.  Types<...> is much
4168 // easier to write, but generates horrible messages when there is a
4169 // compiler error, as gcc insists on printing out each template
4170 // argument, even if it has the default value (this means Types<int>
4171 // will appear as Types<int, None, None, ..., None> in the compiler
4172 // errors).
4173 //
4174 // Our solution is to combine the best part of the two approaches: a
4175 // user would write Types<T1, ..., TN>, and Google Test will translate
4176 // that to TypesN<T1, ..., TN> internally to make error messages
4177 // readable.  The translation is done by the 'type' member of the
4178 // Types template.
4179 template <typename T1 = internal::None, typename T2 = internal::None,
4180     typename T3 = internal::None, typename T4 = internal::None,
4181     typename T5 = internal::None, typename T6 = internal::None,
4182     typename T7 = internal::None, typename T8 = internal::None,
4183     typename T9 = internal::None, typename T10 = internal::None,
4184     typename T11 = internal::None, typename T12 = internal::None,
4185     typename T13 = internal::None, typename T14 = internal::None,
4186     typename T15 = internal::None, typename T16 = internal::None,
4187     typename T17 = internal::None, typename T18 = internal::None,
4188     typename T19 = internal::None, typename T20 = internal::None,
4189     typename T21 = internal::None, typename T22 = internal::None,
4190     typename T23 = internal::None, typename T24 = internal::None,
4191     typename T25 = internal::None, typename T26 = internal::None,
4192     typename T27 = internal::None, typename T28 = internal::None,
4193     typename T29 = internal::None, typename T30 = internal::None,
4194     typename T31 = internal::None, typename T32 = internal::None,
4195     typename T33 = internal::None, typename T34 = internal::None,
4196     typename T35 = internal::None, typename T36 = internal::None,
4197     typename T37 = internal::None, typename T38 = internal::None,
4198     typename T39 = internal::None, typename T40 = internal::None,
4199     typename T41 = internal::None, typename T42 = internal::None,
4200     typename T43 = internal::None, typename T44 = internal::None,
4201     typename T45 = internal::None, typename T46 = internal::None,
4202     typename T47 = internal::None, typename T48 = internal::None,
4203     typename T49 = internal::None, typename T50 = internal::None>
4204 struct Types {
4205   typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4206       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4207       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4208       T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
4209 };
4210
4211 template <>
4212 struct Types<internal::None, internal::None, internal::None, internal::None,
4213     internal::None, internal::None, internal::None, internal::None,
4214     internal::None, internal::None, internal::None, internal::None,
4215     internal::None, internal::None, internal::None, internal::None,
4216     internal::None, internal::None, internal::None, internal::None,
4217     internal::None, internal::None, internal::None, internal::None,
4218     internal::None, internal::None, internal::None, internal::None,
4219     internal::None, internal::None, internal::None, internal::None,
4220     internal::None, internal::None, internal::None, internal::None,
4221     internal::None, internal::None, internal::None, internal::None,
4222     internal::None, internal::None, internal::None, internal::None,
4223     internal::None, internal::None, internal::None, internal::None,
4224     internal::None, internal::None> {
4225   typedef internal::Types0 type;
4226 };
4227 template <typename T1>
4228 struct Types<T1, internal::None, internal::None, internal::None,
4229     internal::None, internal::None, internal::None, internal::None,
4230     internal::None, internal::None, internal::None, internal::None,
4231     internal::None, internal::None, internal::None, internal::None,
4232     internal::None, internal::None, internal::None, internal::None,
4233     internal::None, internal::None, internal::None, internal::None,
4234     internal::None, internal::None, internal::None, internal::None,
4235     internal::None, internal::None, internal::None, internal::None,
4236     internal::None, internal::None, internal::None, internal::None,
4237     internal::None, internal::None, internal::None, internal::None,
4238     internal::None, internal::None, internal::None, internal::None,
4239     internal::None, internal::None, internal::None, internal::None,
4240     internal::None, internal::None> {
4241   typedef internal::Types1<T1> type;
4242 };
4243 template <typename T1, typename T2>
4244 struct Types<T1, T2, internal::None, internal::None, internal::None,
4245     internal::None, internal::None, internal::None, internal::None,
4246     internal::None, internal::None, internal::None, internal::None,
4247     internal::None, internal::None, internal::None, internal::None,
4248     internal::None, internal::None, internal::None, internal::None,
4249     internal::None, internal::None, internal::None, internal::None,
4250     internal::None, internal::None, internal::None, internal::None,
4251     internal::None, internal::None, internal::None, internal::None,
4252     internal::None, internal::None, internal::None, internal::None,
4253     internal::None, internal::None, internal::None, internal::None,
4254     internal::None, internal::None, internal::None, internal::None,
4255     internal::None, internal::None, internal::None, internal::None,
4256     internal::None> {
4257   typedef internal::Types2<T1, T2> type;
4258 };
4259 template <typename T1, typename T2, typename T3>
4260 struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
4261     internal::None, internal::None, internal::None, internal::None,
4262     internal::None, internal::None, internal::None, internal::None,
4263     internal::None, internal::None, internal::None, internal::None,
4264     internal::None, internal::None, internal::None, internal::None,
4265     internal::None, internal::None, internal::None, internal::None,
4266     internal::None, internal::None, internal::None, internal::None,
4267     internal::None, internal::None, internal::None, internal::None,
4268     internal::None, internal::None, internal::None, internal::None,
4269     internal::None, internal::None, internal::None, internal::None,
4270     internal::None, internal::None, internal::None, internal::None,
4271     internal::None, internal::None, internal::None, internal::None> {
4272   typedef internal::Types3<T1, T2, T3> type;
4273 };
4274 template <typename T1, typename T2, typename T3, typename T4>
4275 struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
4276     internal::None, internal::None, internal::None, internal::None,
4277     internal::None, internal::None, internal::None, internal::None,
4278     internal::None, internal::None, internal::None, internal::None,
4279     internal::None, internal::None, internal::None, internal::None,
4280     internal::None, internal::None, internal::None, internal::None,
4281     internal::None, internal::None, internal::None, internal::None,
4282     internal::None, internal::None, internal::None, internal::None,
4283     internal::None, internal::None, internal::None, internal::None,
4284     internal::None, internal::None, internal::None, internal::None,
4285     internal::None, internal::None, internal::None, internal::None,
4286     internal::None, internal::None, internal::None> {
4287   typedef internal::Types4<T1, T2, T3, T4> type;
4288 };
4289 template <typename T1, typename T2, typename T3, typename T4, typename T5>
4290 struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
4291     internal::None, internal::None, internal::None, internal::None,
4292     internal::None, internal::None, internal::None, internal::None,
4293     internal::None, internal::None, internal::None, internal::None,
4294     internal::None, internal::None, internal::None, internal::None,
4295     internal::None, internal::None, internal::None, internal::None,
4296     internal::None, internal::None, internal::None, internal::None,
4297     internal::None, internal::None, internal::None, internal::None,
4298     internal::None, internal::None, internal::None, internal::None,
4299     internal::None, internal::None, internal::None, internal::None,
4300     internal::None, internal::None, internal::None, internal::None,
4301     internal::None, internal::None, internal::None> {
4302   typedef internal::Types5<T1, T2, T3, T4, T5> type;
4303 };
4304 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4305     typename T6>
4306 struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
4307     internal::None, internal::None, internal::None, internal::None,
4308     internal::None, internal::None, internal::None, internal::None,
4309     internal::None, internal::None, internal::None, internal::None,
4310     internal::None, internal::None, internal::None, internal::None,
4311     internal::None, internal::None, internal::None, internal::None,
4312     internal::None, internal::None, internal::None, internal::None,
4313     internal::None, internal::None, internal::None, internal::None,
4314     internal::None, internal::None, internal::None, internal::None,
4315     internal::None, internal::None, internal::None, internal::None,
4316     internal::None, internal::None, internal::None, internal::None,
4317     internal::None, internal::None> {
4318   typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
4319 };
4320 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4321     typename T6, typename T7>
4322 struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
4323     internal::None, internal::None, internal::None, internal::None,
4324     internal::None, internal::None, internal::None, internal::None,
4325     internal::None, internal::None, internal::None, internal::None,
4326     internal::None, internal::None, internal::None, internal::None,
4327     internal::None, internal::None, internal::None, internal::None,
4328     internal::None, internal::None, internal::None, internal::None,
4329     internal::None, internal::None, internal::None, internal::None,
4330     internal::None, internal::None, internal::None, internal::None,
4331     internal::None, internal::None, internal::None, internal::None,
4332     internal::None, internal::None, internal::None, internal::None,
4333     internal::None> {
4334   typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
4335 };
4336 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4337     typename T6, typename T7, typename T8>
4338 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
4339     internal::None, internal::None, internal::None, internal::None,
4340     internal::None, internal::None, internal::None, internal::None,
4341     internal::None, internal::None, internal::None, internal::None,
4342     internal::None, internal::None, internal::None, internal::None,
4343     internal::None, internal::None, internal::None, internal::None,
4344     internal::None, internal::None, internal::None, internal::None,
4345     internal::None, internal::None, internal::None, internal::None,
4346     internal::None, internal::None, internal::None, internal::None,
4347     internal::None, internal::None, internal::None, internal::None,
4348     internal::None, internal::None, internal::None, internal::None> {
4349   typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
4350 };
4351 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4352     typename T6, typename T7, typename T8, typename T9>
4353 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
4354     internal::None, internal::None, internal::None, internal::None,
4355     internal::None, internal::None, internal::None, internal::None,
4356     internal::None, internal::None, internal::None, internal::None,
4357     internal::None, internal::None, internal::None, internal::None,
4358     internal::None, internal::None, internal::None, internal::None,
4359     internal::None, internal::None, internal::None, internal::None,
4360     internal::None, internal::None, internal::None, internal::None,
4361     internal::None, internal::None, internal::None, internal::None,
4362     internal::None, internal::None, internal::None, internal::None,
4363     internal::None, internal::None, internal::None, internal::None> {
4364   typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
4365 };
4366 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4367     typename T6, typename T7, typename T8, typename T9, typename T10>
4368 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
4369     internal::None, internal::None, internal::None, internal::None,
4370     internal::None, internal::None, internal::None, internal::None,
4371     internal::None, internal::None, internal::None, internal::None,
4372     internal::None, internal::None, internal::None, internal::None,
4373     internal::None, internal::None, internal::None, internal::None,
4374     internal::None, internal::None, internal::None, internal::None,
4375     internal::None, internal::None, internal::None, internal::None,
4376     internal::None, internal::None, internal::None, internal::None,
4377     internal::None, internal::None, internal::None, internal::None,
4378     internal::None, internal::None, internal::None> {
4379   typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
4380 };
4381 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4382     typename T6, typename T7, typename T8, typename T9, typename T10,
4383     typename T11>
4384 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
4385     internal::None, internal::None, internal::None, internal::None,
4386     internal::None, internal::None, internal::None, internal::None,
4387     internal::None, internal::None, internal::None, internal::None,
4388     internal::None, internal::None, internal::None, internal::None,
4389     internal::None, internal::None, internal::None, internal::None,
4390     internal::None, internal::None, internal::None, internal::None,
4391     internal::None, internal::None, internal::None, internal::None,
4392     internal::None, internal::None, internal::None, internal::None,
4393     internal::None, internal::None, internal::None, internal::None,
4394     internal::None, internal::None> {
4395   typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
4396 };
4397 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4398     typename T6, typename T7, typename T8, typename T9, typename T10,
4399     typename T11, typename T12>
4400 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
4401     internal::None, internal::None, internal::None, internal::None,
4402     internal::None, internal::None, internal::None, internal::None,
4403     internal::None, internal::None, internal::None, internal::None,
4404     internal::None, internal::None, internal::None, internal::None,
4405     internal::None, internal::None, internal::None, internal::None,
4406     internal::None, internal::None, internal::None, internal::None,
4407     internal::None, internal::None, internal::None, internal::None,
4408     internal::None, internal::None, internal::None, internal::None,
4409     internal::None, internal::None, internal::None, internal::None,
4410     internal::None> {
4411   typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
4412       T12> type;
4413 };
4414 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4415     typename T6, typename T7, typename T8, typename T9, typename T10,
4416     typename T11, typename T12, typename T13>
4417 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
4418     internal::None, internal::None, internal::None, internal::None,
4419     internal::None, internal::None, internal::None, internal::None,
4420     internal::None, internal::None, internal::None, internal::None,
4421     internal::None, internal::None, internal::None, internal::None,
4422     internal::None, internal::None, internal::None, internal::None,
4423     internal::None, internal::None, internal::None, internal::None,
4424     internal::None, internal::None, internal::None, internal::None,
4425     internal::None, internal::None, internal::None, internal::None,
4426     internal::None, internal::None, internal::None, internal::None,
4427     internal::None> {
4428   typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4429       T13> type;
4430 };
4431 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4432     typename T6, typename T7, typename T8, typename T9, typename T10,
4433     typename T11, typename T12, typename T13, typename T14>
4434 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
4435     internal::None, internal::None, internal::None, internal::None,
4436     internal::None, internal::None, internal::None, internal::None,
4437     internal::None, internal::None, internal::None, internal::None,
4438     internal::None, internal::None, internal::None, internal::None,
4439     internal::None, internal::None, internal::None, internal::None,
4440     internal::None, internal::None, internal::None, internal::None,
4441     internal::None, internal::None, internal::None, internal::None,
4442     internal::None, internal::None, internal::None, internal::None,
4443     internal::None, internal::None, internal::None, internal::None> {
4444   typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4445       T13, T14> type;
4446 };
4447 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4448     typename T6, typename T7, typename T8, typename T9, typename T10,
4449     typename T11, typename T12, typename T13, typename T14, typename T15>
4450 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4451     internal::None, internal::None, internal::None, internal::None,
4452     internal::None, internal::None, internal::None, internal::None,
4453     internal::None, internal::None, internal::None, internal::None,
4454     internal::None, internal::None, internal::None, internal::None,
4455     internal::None, internal::None, internal::None, internal::None,
4456     internal::None, internal::None, internal::None, internal::None,
4457     internal::None, internal::None, internal::None, internal::None,
4458     internal::None, internal::None, internal::None, internal::None,
4459     internal::None, internal::None, internal::None> {
4460   typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4461       T13, T14, T15> type;
4462 };
4463 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4464     typename T6, typename T7, typename T8, typename T9, typename T10,
4465     typename T11, typename T12, typename T13, typename T14, typename T15,
4466     typename T16>
4467 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4468     T16, internal::None, internal::None, internal::None, internal::None,
4469     internal::None, internal::None, internal::None, internal::None,
4470     internal::None, internal::None, internal::None, internal::None,
4471     internal::None, internal::None, internal::None, internal::None,
4472     internal::None, internal::None, internal::None, internal::None,
4473     internal::None, internal::None, internal::None, internal::None,
4474     internal::None, internal::None, internal::None, internal::None,
4475     internal::None, internal::None, internal::None, internal::None,
4476     internal::None, internal::None> {
4477   typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4478       T13, T14, T15, T16> type;
4479 };
4480 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4481     typename T6, typename T7, typename T8, typename T9, typename T10,
4482     typename T11, typename T12, typename T13, typename T14, typename T15,
4483     typename T16, typename T17>
4484 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4485     T16, T17, internal::None, internal::None, internal::None, internal::None,
4486     internal::None, internal::None, internal::None, internal::None,
4487     internal::None, internal::None, internal::None, internal::None,
4488     internal::None, internal::None, internal::None, internal::None,
4489     internal::None, internal::None, internal::None, internal::None,
4490     internal::None, internal::None, internal::None, internal::None,
4491     internal::None, internal::None, internal::None, internal::None,
4492     internal::None, internal::None, internal::None, internal::None,
4493     internal::None> {
4494   typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4495       T13, T14, T15, T16, T17> type;
4496 };
4497 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4498     typename T6, typename T7, typename T8, typename T9, typename T10,
4499     typename T11, typename T12, typename T13, typename T14, typename T15,
4500     typename T16, typename T17, typename T18>
4501 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4502     T16, T17, T18, internal::None, internal::None, internal::None,
4503     internal::None, internal::None, internal::None, internal::None,
4504     internal::None, internal::None, internal::None, internal::None,
4505     internal::None, internal::None, internal::None, internal::None,
4506     internal::None, internal::None, internal::None, internal::None,
4507     internal::None, internal::None, internal::None, internal::None,
4508     internal::None, internal::None, internal::None, internal::None,
4509     internal::None, internal::None, internal::None, internal::None,
4510     internal::None> {
4511   typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4512       T13, T14, T15, T16, T17, T18> type;
4513 };
4514 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4515     typename T6, typename T7, typename T8, typename T9, typename T10,
4516     typename T11, typename T12, typename T13, typename T14, typename T15,
4517     typename T16, typename T17, typename T18, typename T19>
4518 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4519     T16, T17, T18, T19, internal::None, internal::None, internal::None,
4520     internal::None, internal::None, internal::None, internal::None,
4521     internal::None, internal::None, internal::None, internal::None,
4522     internal::None, internal::None, internal::None, internal::None,
4523     internal::None, internal::None, internal::None, internal::None,
4524     internal::None, internal::None, internal::None, internal::None,
4525     internal::None, internal::None, internal::None, internal::None,
4526     internal::None, internal::None, internal::None, internal::None> {
4527   typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4528       T13, T14, T15, T16, T17, T18, T19> type;
4529 };
4530 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4531     typename T6, typename T7, typename T8, typename T9, typename T10,
4532     typename T11, typename T12, typename T13, typename T14, typename T15,
4533     typename T16, typename T17, typename T18, typename T19, typename T20>
4534 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4535     T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
4536     internal::None, internal::None, internal::None, internal::None,
4537     internal::None, internal::None, internal::None, internal::None,
4538     internal::None, internal::None, internal::None, internal::None,
4539     internal::None, internal::None, internal::None, internal::None,
4540     internal::None, internal::None, internal::None, internal::None,
4541     internal::None, internal::None, internal::None, internal::None,
4542     internal::None, internal::None, internal::None> {
4543   typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4544       T13, T14, T15, T16, T17, T18, T19, T20> type;
4545 };
4546 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4547     typename T6, typename T7, typename T8, typename T9, typename T10,
4548     typename T11, typename T12, typename T13, typename T14, typename T15,
4549     typename T16, typename T17, typename T18, typename T19, typename T20,
4550     typename T21>
4551 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4552     T16, T17, T18, T19, T20, T21, 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> {
4560   typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4561       T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
4562 };
4563 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4564     typename T6, typename T7, typename T8, typename T9, typename T10,
4565     typename T11, typename T12, typename T13, typename T14, typename T15,
4566     typename T16, typename T17, typename T18, typename T19, typename T20,
4567     typename T21, typename T22>
4568 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4569     T16, T17, T18, T19, T20, T21, T22, 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> {
4577   typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4578       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
4579 };
4580 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4581     typename T6, typename T7, typename T8, typename T9, typename T10,
4582     typename T11, typename T12, typename T13, typename T14, typename T15,
4583     typename T16, typename T17, typename T18, typename T19, typename T20,
4584     typename T21, typename T22, typename T23>
4585 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4586     T16, T17, T18, T19, T20, T21, T22, T23, 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> {
4594   typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4595       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
4596 };
4597 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4598     typename T6, typename T7, typename T8, typename T9, typename T10,
4599     typename T11, typename T12, typename T13, typename T14, typename T15,
4600     typename T16, typename T17, typename T18, typename T19, typename T20,
4601     typename T21, typename T22, typename T23, typename T24>
4602 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4603     T16, T17, T18, T19, T20, T21, T22, T23, T24, 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     internal::None, internal::None, internal::None, internal::None,
4610     internal::None> {
4611   typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4612       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
4613 };
4614 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4615     typename T6, typename T7, typename T8, typename T9, typename T10,
4616     typename T11, typename T12, typename T13, typename T14, typename T15,
4617     typename T16, typename T17, typename T18, typename T19, typename T20,
4618     typename T21, typename T22, typename T23, typename T24, typename T25>
4619 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4620     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, 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, internal::None,
4624     internal::None, internal::None, internal::None, internal::None,
4625     internal::None, internal::None, internal::None, internal::None,
4626     internal::None, internal::None, internal::None, internal::None> {
4627   typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4628       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
4629 };
4630 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4631     typename T6, typename T7, typename T8, typename T9, typename T10,
4632     typename T11, typename T12, typename T13, typename T14, typename T15,
4633     typename T16, typename T17, typename T18, typename T19, typename T20,
4634     typename T21, typename T22, typename T23, typename T24, typename T25,
4635     typename T26>
4636 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4637     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
4638     internal::None, internal::None, internal::None, internal::None,
4639     internal::None, internal::None, internal::None, internal::None,
4640     internal::None, internal::None, internal::None, internal::None,
4641     internal::None, internal::None, internal::None, internal::None,
4642     internal::None, internal::None, internal::None, internal::None,
4643     internal::None, internal::None, internal::None> {
4644   typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4645       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
4646       T26> type;
4647 };
4648 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4649     typename T6, typename T7, typename T8, typename T9, typename T10,
4650     typename T11, typename T12, typename T13, typename T14, typename T15,
4651     typename T16, typename T17, typename T18, typename T19, typename T20,
4652     typename T21, typename T22, typename T23, typename T24, typename T25,
4653     typename T26, typename T27>
4654 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4655     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
4656     internal::None, internal::None, internal::None, internal::None,
4657     internal::None, internal::None, internal::None, internal::None,
4658     internal::None, internal::None, internal::None, internal::None,
4659     internal::None, internal::None, internal::None, internal::None,
4660     internal::None, internal::None, internal::None, internal::None,
4661     internal::None, internal::None> {
4662   typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4663       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4664       T27> type;
4665 };
4666 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4667     typename T6, typename T7, typename T8, typename T9, typename T10,
4668     typename T11, typename T12, typename T13, typename T14, typename T15,
4669     typename T16, typename T17, typename T18, typename T19, typename T20,
4670     typename T21, typename T22, typename T23, typename T24, typename T25,
4671     typename T26, typename T27, typename T28>
4672 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4673     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
4674     internal::None, internal::None, internal::None, internal::None,
4675     internal::None, internal::None, internal::None, internal::None,
4676     internal::None, internal::None, internal::None, internal::None,
4677     internal::None, internal::None, internal::None, internal::None,
4678     internal::None, internal::None, internal::None, internal::None,
4679     internal::None, internal::None> {
4680   typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4681       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4682       T27, T28> type;
4683 };
4684 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4685     typename T6, typename T7, typename T8, typename T9, typename T10,
4686     typename T11, typename T12, typename T13, typename T14, typename T15,
4687     typename T16, typename T17, typename T18, typename T19, typename T20,
4688     typename T21, typename T22, typename T23, typename T24, typename T25,
4689     typename T26, typename T27, typename T28, typename T29>
4690 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4691     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
4692     internal::None, internal::None, internal::None, internal::None,
4693     internal::None, internal::None, internal::None, internal::None,
4694     internal::None, internal::None, internal::None, internal::None,
4695     internal::None, internal::None, internal::None, internal::None,
4696     internal::None, internal::None, internal::None, internal::None,
4697     internal::None> {
4698   typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4699       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4700       T27, T28, T29> type;
4701 };
4702 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4703     typename T6, typename T7, typename T8, typename T9, typename T10,
4704     typename T11, typename T12, typename T13, typename T14, typename T15,
4705     typename T16, typename T17, typename T18, typename T19, typename T20,
4706     typename T21, typename T22, typename T23, typename T24, typename T25,
4707     typename T26, typename T27, typename T28, typename T29, typename T30>
4708 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4709     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4710     internal::None, internal::None, internal::None, internal::None,
4711     internal::None, internal::None, internal::None, internal::None,
4712     internal::None, internal::None, internal::None, internal::None,
4713     internal::None, internal::None, internal::None, internal::None,
4714     internal::None, internal::None, internal::None, internal::None> {
4715   typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4716       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4717       T27, T28, T29, T30> type;
4718 };
4719 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4720     typename T6, typename T7, typename T8, typename T9, typename T10,
4721     typename T11, typename T12, typename T13, typename T14, typename T15,
4722     typename T16, typename T17, typename T18, typename T19, typename T20,
4723     typename T21, typename T22, typename T23, typename T24, typename T25,
4724     typename T26, typename T27, typename T28, typename T29, typename T30,
4725     typename T31>
4726 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4727     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4728     T31, internal::None, internal::None, internal::None, internal::None,
4729     internal::None, internal::None, internal::None, internal::None,
4730     internal::None, internal::None, internal::None, internal::None,
4731     internal::None, internal::None, internal::None, internal::None,
4732     internal::None, internal::None, internal::None> {
4733   typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4734       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4735       T27, T28, T29, T30, T31> type;
4736 };
4737 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4738     typename T6, typename T7, typename T8, typename T9, typename T10,
4739     typename T11, typename T12, typename T13, typename T14, typename T15,
4740     typename T16, typename T17, typename T18, typename T19, typename T20,
4741     typename T21, typename T22, typename T23, typename T24, typename T25,
4742     typename T26, typename T27, typename T28, typename T29, typename T30,
4743     typename T31, typename T32>
4744 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4745     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4746     T31, T32, internal::None, internal::None, internal::None, internal::None,
4747     internal::None, internal::None, internal::None, internal::None,
4748     internal::None, internal::None, internal::None, internal::None,
4749     internal::None, internal::None, internal::None, internal::None,
4750     internal::None, internal::None> {
4751   typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4752       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4753       T27, T28, T29, T30, T31, T32> type;
4754 };
4755 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4756     typename T6, typename T7, typename T8, typename T9, typename T10,
4757     typename T11, typename T12, typename T13, typename T14, typename T15,
4758     typename T16, typename T17, typename T18, typename T19, typename T20,
4759     typename T21, typename T22, typename T23, typename T24, typename T25,
4760     typename T26, typename T27, typename T28, typename T29, typename T30,
4761     typename T31, typename T32, typename T33>
4762 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4763     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4764     T31, T32, T33, 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> {
4769   typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4770       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4771       T27, T28, T29, T30, T31, T32, T33> type;
4772 };
4773 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4774     typename T6, typename T7, typename T8, typename T9, typename T10,
4775     typename T11, typename T12, typename T13, typename T14, typename T15,
4776     typename T16, typename T17, typename T18, typename T19, typename T20,
4777     typename T21, typename T22, typename T23, typename T24, typename T25,
4778     typename T26, typename T27, typename T28, typename T29, typename T30,
4779     typename T31, typename T32, typename T33, typename T34>
4780 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4781     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4782     T31, T32, T33, T34, 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> {
4787   typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4788       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4789       T27, T28, T29, T30, T31, T32, T33, T34> 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, typename T22, typename T23, typename T24, typename T25,
4796     typename T26, typename T27, typename T28, typename T29, typename T30,
4797     typename T31, typename T32, typename T33, typename T34, typename T35>
4798 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4799     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4800     T31, T32, T33, T34, T35, 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   typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4805       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4806       T27, T28, T29, T30, T31, T32, T33, T34, T35> 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, typename T23, typename T24, typename T25,
4813     typename T26, typename T27, typename T28, typename T29, typename T30,
4814     typename T31, typename T32, typename T33, typename T34, typename T35,
4815     typename T36>
4816 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4817     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4818     T31, T32, T33, T34, T35, T36, 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, internal::None, internal::None> {
4822   typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4823       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4824       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
4825 };
4826 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4827     typename T6, typename T7, typename T8, typename T9, typename T10,
4828     typename T11, typename T12, typename T13, typename T14, typename T15,
4829     typename T16, typename T17, typename T18, typename T19, typename T20,
4830     typename T21, typename T22, typename T23, typename T24, typename T25,
4831     typename T26, typename T27, typename T28, typename T29, typename T30,
4832     typename T31, typename T32, typename T33, typename T34, typename T35,
4833     typename T36, typename T37>
4834 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4835     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4836     T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
4837     internal::None, internal::None, internal::None, internal::None,
4838     internal::None, internal::None, internal::None, internal::None,
4839     internal::None, internal::None, internal::None> {
4840   typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4841       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4842       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
4843 };
4844 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4845     typename T6, typename T7, typename T8, typename T9, typename T10,
4846     typename T11, typename T12, typename T13, typename T14, typename T15,
4847     typename T16, typename T17, typename T18, typename T19, typename T20,
4848     typename T21, typename T22, typename T23, typename T24, typename T25,
4849     typename T26, typename T27, typename T28, typename T29, typename T30,
4850     typename T31, typename T32, typename T33, typename T34, typename T35,
4851     typename T36, typename T37, typename T38>
4852 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4853     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4854     T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
4855     internal::None, internal::None, internal::None, internal::None,
4856     internal::None, internal::None, internal::None, internal::None,
4857     internal::None, internal::None> {
4858   typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4859       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4860       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
4861 };
4862 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4863     typename T6, typename T7, typename T8, typename T9, typename T10,
4864     typename T11, typename T12, typename T13, typename T14, typename T15,
4865     typename T16, typename T17, typename T18, typename T19, typename T20,
4866     typename T21, typename T22, typename T23, typename T24, typename T25,
4867     typename T26, typename T27, typename T28, typename T29, typename T30,
4868     typename T31, typename T32, typename T33, typename T34, typename T35,
4869     typename T36, typename T37, typename T38, typename T39>
4870 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4871     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4872     T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
4873     internal::None, internal::None, internal::None, internal::None,
4874     internal::None, internal::None, internal::None, internal::None,
4875     internal::None, internal::None> {
4876   typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4877       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4878       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
4879 };
4880 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4881     typename T6, typename T7, typename T8, typename T9, typename T10,
4882     typename T11, typename T12, typename T13, typename T14, typename T15,
4883     typename T16, typename T17, typename T18, typename T19, typename T20,
4884     typename T21, typename T22, typename T23, typename T24, typename T25,
4885     typename T26, typename T27, typename T28, typename T29, typename T30,
4886     typename T31, typename T32, typename T33, typename T34, typename T35,
4887     typename T36, typename T37, typename T38, typename T39, typename T40>
4888 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4889     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4890     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
4891     internal::None, internal::None, internal::None, internal::None,
4892     internal::None, internal::None, internal::None, internal::None,
4893     internal::None> {
4894   typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4895       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4896       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
4897       T40> type;
4898 };
4899 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4900     typename T6, typename T7, typename T8, typename T9, typename T10,
4901     typename T11, typename T12, typename T13, typename T14, typename T15,
4902     typename T16, typename T17, typename T18, typename T19, typename T20,
4903     typename T21, typename T22, typename T23, typename T24, typename T25,
4904     typename T26, typename T27, typename T28, typename T29, typename T30,
4905     typename T31, typename T32, typename T33, typename T34, typename T35,
4906     typename T36, typename T37, typename T38, typename T39, typename T40,
4907     typename T41>
4908 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4909     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4910     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
4911     internal::None, internal::None, internal::None, internal::None,
4912     internal::None, internal::None, internal::None, internal::None> {
4913   typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4914       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4915       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4916       T41> type;
4917 };
4918 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4919     typename T6, typename T7, typename T8, typename T9, typename T10,
4920     typename T11, typename T12, typename T13, typename T14, typename T15,
4921     typename T16, typename T17, typename T18, typename T19, typename T20,
4922     typename T21, typename T22, typename T23, typename T24, typename T25,
4923     typename T26, typename T27, typename T28, typename T29, typename T30,
4924     typename T31, typename T32, typename T33, typename T34, typename T35,
4925     typename T36, typename T37, typename T38, typename T39, typename T40,
4926     typename T41, typename T42>
4927 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4928     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4929     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
4930     internal::None, internal::None, internal::None, internal::None,
4931     internal::None, internal::None, internal::None> {
4932   typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4933       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4934       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4935       T41, T42> type;
4936 };
4937 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4938     typename T6, typename T7, typename T8, typename T9, typename T10,
4939     typename T11, typename T12, typename T13, typename T14, typename T15,
4940     typename T16, typename T17, typename T18, typename T19, typename T20,
4941     typename T21, typename T22, typename T23, typename T24, typename T25,
4942     typename T26, typename T27, typename T28, typename T29, typename T30,
4943     typename T31, typename T32, typename T33, typename T34, typename T35,
4944     typename T36, typename T37, typename T38, typename T39, typename T40,
4945     typename T41, typename T42, typename T43>
4946 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4947     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4948     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
4949     internal::None, internal::None, internal::None, internal::None,
4950     internal::None, internal::None, internal::None> {
4951   typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4952       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4953       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4954       T41, T42, T43> type;
4955 };
4956 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4957     typename T6, typename T7, typename T8, typename T9, typename T10,
4958     typename T11, typename T12, typename T13, typename T14, typename T15,
4959     typename T16, typename T17, typename T18, typename T19, typename T20,
4960     typename T21, typename T22, typename T23, typename T24, typename T25,
4961     typename T26, typename T27, typename T28, typename T29, typename T30,
4962     typename T31, typename T32, typename T33, typename T34, typename T35,
4963     typename T36, typename T37, typename T38, typename T39, typename T40,
4964     typename T41, typename T42, typename T43, typename T44>
4965 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4966     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4967     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
4968     internal::None, internal::None, internal::None, internal::None,
4969     internal::None, internal::None> {
4970   typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4971       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4972       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4973       T41, T42, T43, T44> type;
4974 };
4975 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4976     typename T6, typename T7, typename T8, typename T9, typename T10,
4977     typename T11, typename T12, typename T13, typename T14, typename T15,
4978     typename T16, typename T17, typename T18, typename T19, typename T20,
4979     typename T21, typename T22, typename T23, typename T24, typename T25,
4980     typename T26, typename T27, typename T28, typename T29, typename T30,
4981     typename T31, typename T32, typename T33, typename T34, typename T35,
4982     typename T36, typename T37, typename T38, typename T39, typename T40,
4983     typename T41, typename T42, typename T43, typename T44, typename T45>
4984 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
4985     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
4986     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
4987     internal::None, internal::None, internal::None, internal::None,
4988     internal::None> {
4989   typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
4990       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
4991       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
4992       T41, T42, T43, T44, T45> type;
4993 };
4994 template <typename T1, typename T2, typename T3, typename T4, typename T5,
4995     typename T6, typename T7, typename T8, typename T9, typename T10,
4996     typename T11, typename T12, typename T13, typename T14, typename T15,
4997     typename T16, typename T17, typename T18, typename T19, typename T20,
4998     typename T21, typename T22, typename T23, typename T24, typename T25,
4999     typename T26, typename T27, typename T28, typename T29, typename T30,
5000     typename T31, typename T32, typename T33, typename T34, typename T35,
5001     typename T36, typename T37, typename T38, typename T39, typename T40,
5002     typename T41, typename T42, typename T43, typename T44, typename T45,
5003     typename T46>
5004 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5005     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5006     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5007     T46, internal::None, internal::None, internal::None, internal::None> {
5008   typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5009       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5010       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5011       T41, T42, T43, T44, T45, T46> type;
5012 };
5013 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5014     typename T6, typename T7, typename T8, typename T9, typename T10,
5015     typename T11, typename T12, typename T13, typename T14, typename T15,
5016     typename T16, typename T17, typename T18, typename T19, typename T20,
5017     typename T21, typename T22, typename T23, typename T24, typename T25,
5018     typename T26, typename T27, typename T28, typename T29, typename T30,
5019     typename T31, typename T32, typename T33, typename T34, typename T35,
5020     typename T36, typename T37, typename T38, typename T39, typename T40,
5021     typename T41, typename T42, typename T43, typename T44, typename T45,
5022     typename T46, typename T47>
5023 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5024     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5025     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5026     T46, T47, internal::None, internal::None, internal::None> {
5027   typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5028       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5029       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5030       T41, T42, T43, T44, T45, T46, T47> type;
5031 };
5032 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5033     typename T6, typename T7, typename T8, typename T9, typename T10,
5034     typename T11, typename T12, typename T13, typename T14, typename T15,
5035     typename T16, typename T17, typename T18, typename T19, typename T20,
5036     typename T21, typename T22, typename T23, typename T24, typename T25,
5037     typename T26, typename T27, typename T28, typename T29, typename T30,
5038     typename T31, typename T32, typename T33, typename T34, typename T35,
5039     typename T36, typename T37, typename T38, typename T39, typename T40,
5040     typename T41, typename T42, typename T43, typename T44, typename T45,
5041     typename T46, typename T47, typename T48>
5042 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
5043     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
5044     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5045     T46, T47, T48, internal::None, internal::None> {
5046   typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5047       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5048       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5049       T41, T42, T43, T44, T45, T46, T47, T48> type;
5050 };
5051 template <typename T1, typename T2, typename T3, typename T4, typename T5,
5052     typename T6, typename T7, typename T8, typename T9, typename T10,
5053     typename T11, typename T12, typename T13, typename T14, typename T15,
5054     typename T16, typename T17, typename T18, typename T19, typename T20,
5055     typename T21, typename T22, typename T23, typename T24, typename T25,
5056     typename T26, typename T27, typename T28, typename T29, typename T30,
5057     typename T31, typename T32, typename T33, typename T34, typename T35,
5058     typename T36, typename T37, typename T38, typename T39, typename T40,
5059     typename T41, typename T42, typename T43, typename T44, typename T45,
5060     typename T46, typename T47, typename T48, typename T49>
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, T37, T38, T39, T40, T41, T42, T43, T44, T45,
5064     T46, T47, T48, T49, internal::None> {
5065   typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
5066       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
5067       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
5068       T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
5069 };
5070
5071 namespace internal {
5072
5073 # define GTEST_TEMPLATE_ template <typename T> class
5074
5075 // The template "selector" struct TemplateSel<Tmpl> is used to
5076 // represent Tmpl, which must be a class template with one type
5077 // parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined
5078 // as the type Tmpl<T>.  This allows us to actually instantiate the
5079 // template "selected" by TemplateSel<Tmpl>.
5080 //
5081 // This trick is necessary for simulating typedef for class templates,
5082 // which C++ doesn't support directly.
5083 template <GTEST_TEMPLATE_ Tmpl>
5084 struct TemplateSel {
5085   template <typename T>
5086   struct Bind {
5087     typedef Tmpl<T> type;
5088   };
5089 };
5090
5091 # define GTEST_BIND_(TmplSel, T) \
5092   TmplSel::template Bind<T>::type
5093
5094 // A unique struct template used as the default value for the
5095 // arguments of class template Templates.  This allows us to simulate
5096 // variadic templates (e.g. Templates<int>, Templates<int, double>,
5097 // and etc), which C++ doesn't support directly.
5098 template <typename T>
5099 struct NoneT {};
5100
5101 // The following family of struct and struct templates are used to
5102 // represent template lists.  In particular, TemplatesN<T1, T2, ...,
5103 // TN> represents a list of N templates (T1, T2, ..., and TN).  Except
5104 // for Templates0, every struct in the family has two member types:
5105 // Head for the selector of the first template in the list, and Tail
5106 // for the rest of the list.
5107
5108 // The empty template list.
5109 struct Templates0 {};
5110
5111 // Template lists of length 1, 2, 3, and so on.
5112
5113 template <GTEST_TEMPLATE_ T1>
5114 struct Templates1 {
5115   typedef TemplateSel<T1> Head;
5116   typedef Templates0 Tail;
5117 };
5118 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
5119 struct Templates2 {
5120   typedef TemplateSel<T1> Head;
5121   typedef Templates1<T2> Tail;
5122 };
5123
5124 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
5125 struct Templates3 {
5126   typedef TemplateSel<T1> Head;
5127   typedef Templates2<T2, T3> Tail;
5128 };
5129
5130 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5131     GTEST_TEMPLATE_ T4>
5132 struct Templates4 {
5133   typedef TemplateSel<T1> Head;
5134   typedef Templates3<T2, T3, T4> Tail;
5135 };
5136
5137 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5138     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
5139 struct Templates5 {
5140   typedef TemplateSel<T1> Head;
5141   typedef Templates4<T2, T3, T4, T5> Tail;
5142 };
5143
5144 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5145     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
5146 struct Templates6 {
5147   typedef TemplateSel<T1> Head;
5148   typedef Templates5<T2, T3, T4, T5, T6> Tail;
5149 };
5150
5151 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5152     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5153     GTEST_TEMPLATE_ T7>
5154 struct Templates7 {
5155   typedef TemplateSel<T1> Head;
5156   typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
5157 };
5158
5159 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5160     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5161     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
5162 struct Templates8 {
5163   typedef TemplateSel<T1> Head;
5164   typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
5165 };
5166
5167 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5168     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5169     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
5170 struct Templates9 {
5171   typedef TemplateSel<T1> Head;
5172   typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
5173 };
5174
5175 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5176     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5177     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5178     GTEST_TEMPLATE_ T10>
5179 struct Templates10 {
5180   typedef TemplateSel<T1> Head;
5181   typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
5182 };
5183
5184 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5185     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5186     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5187     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
5188 struct Templates11 {
5189   typedef TemplateSel<T1> Head;
5190   typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
5191 };
5192
5193 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5194     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5195     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5196     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
5197 struct Templates12 {
5198   typedef TemplateSel<T1> Head;
5199   typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
5200 };
5201
5202 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5203     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5204     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5205     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5206     GTEST_TEMPLATE_ T13>
5207 struct Templates13 {
5208   typedef TemplateSel<T1> Head;
5209   typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
5210 };
5211
5212 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5213     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5214     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5215     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5216     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
5217 struct Templates14 {
5218   typedef TemplateSel<T1> Head;
5219   typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5220       T14> Tail;
5221 };
5222
5223 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5224     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5225     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5226     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5227     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
5228 struct Templates15 {
5229   typedef TemplateSel<T1> Head;
5230   typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5231       T15> Tail;
5232 };
5233
5234 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5235     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5236     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5237     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5238     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5239     GTEST_TEMPLATE_ T16>
5240 struct Templates16 {
5241   typedef TemplateSel<T1> Head;
5242   typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5243       T15, T16> Tail;
5244 };
5245
5246 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5247     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5248     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5249     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5250     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5251     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
5252 struct Templates17 {
5253   typedef TemplateSel<T1> Head;
5254   typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5255       T15, T16, T17> Tail;
5256 };
5257
5258 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5259     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5260     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5261     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5262     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5263     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
5264 struct Templates18 {
5265   typedef TemplateSel<T1> Head;
5266   typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5267       T15, T16, T17, T18> Tail;
5268 };
5269
5270 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5271     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5272     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5273     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5274     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5275     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5276     GTEST_TEMPLATE_ T19>
5277 struct Templates19 {
5278   typedef TemplateSel<T1> Head;
5279   typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5280       T15, T16, T17, T18, T19> Tail;
5281 };
5282
5283 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5284     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5285     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5286     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5287     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5288     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5289     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
5290 struct Templates20 {
5291   typedef TemplateSel<T1> Head;
5292   typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5293       T15, T16, T17, T18, T19, T20> Tail;
5294 };
5295
5296 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5297     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5298     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5299     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5300     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5301     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5302     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
5303 struct Templates21 {
5304   typedef TemplateSel<T1> Head;
5305   typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5306       T15, T16, T17, T18, T19, T20, T21> Tail;
5307 };
5308
5309 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5310     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5311     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5312     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5313     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5314     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5315     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5316     GTEST_TEMPLATE_ T22>
5317 struct Templates22 {
5318   typedef TemplateSel<T1> Head;
5319   typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5320       T15, T16, T17, T18, T19, T20, T21, T22> Tail;
5321 };
5322
5323 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5324     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5325     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5326     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5327     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5328     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5329     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5330     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
5331 struct Templates23 {
5332   typedef TemplateSel<T1> Head;
5333   typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5334       T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
5335 };
5336
5337 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5338     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5339     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5340     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5341     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5342     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5343     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5344     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
5345 struct Templates24 {
5346   typedef TemplateSel<T1> Head;
5347   typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5348       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
5349 };
5350
5351 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5352     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5353     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5354     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5355     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5356     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5357     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5358     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5359     GTEST_TEMPLATE_ T25>
5360 struct Templates25 {
5361   typedef TemplateSel<T1> Head;
5362   typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5363       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
5364 };
5365
5366 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5367     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5368     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5369     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5370     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5371     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5372     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5373     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5374     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
5375 struct Templates26 {
5376   typedef TemplateSel<T1> Head;
5377   typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5378       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
5379 };
5380
5381 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5382     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5383     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5384     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5385     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5386     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5387     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5388     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5389     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
5390 struct Templates27 {
5391   typedef TemplateSel<T1> Head;
5392   typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5393       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> 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, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5399     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5400     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5401     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5402     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5403     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5404     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5405     GTEST_TEMPLATE_ T28>
5406 struct Templates28 {
5407   typedef TemplateSel<T1> Head;
5408   typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5409       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5410       T28> Tail;
5411 };
5412
5413 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5414     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5415     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5416     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5417     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5418     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5419     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5420     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5421     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5422     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
5423 struct Templates29 {
5424   typedef TemplateSel<T1> Head;
5425   typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5426       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5427       T29> Tail;
5428 };
5429
5430 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5431     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5432     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5433     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5434     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5435     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5436     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5437     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5438     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5439     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
5440 struct Templates30 {
5441   typedef TemplateSel<T1> Head;
5442   typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5443       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5444       T29, T30> 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, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5452     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5453     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5454     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5455     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5456     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5457     GTEST_TEMPLATE_ T31>
5458 struct Templates31 {
5459   typedef TemplateSel<T1> Head;
5460   typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5461       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5462       T29, T30, T31> Tail;
5463 };
5464
5465 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5466     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5467     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5468     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5469     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5470     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5471     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5472     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5473     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5474     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5475     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
5476 struct Templates32 {
5477   typedef TemplateSel<T1> Head;
5478   typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5479       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5480       T29, T30, T31, T32> Tail;
5481 };
5482
5483 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5484     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5485     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5486     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5487     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5488     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5489     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5490     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5491     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5492     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5493     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
5494 struct Templates33 {
5495   typedef TemplateSel<T1> Head;
5496   typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5497       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5498       T29, T30, T31, T32, T33> Tail;
5499 };
5500
5501 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5502     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5503     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5504     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5505     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5506     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5507     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5508     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5509     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5510     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5511     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5512     GTEST_TEMPLATE_ T34>
5513 struct Templates34 {
5514   typedef TemplateSel<T1> Head;
5515   typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5516       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5517       T29, T30, T31, T32, T33, T34> Tail;
5518 };
5519
5520 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5521     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5522     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5523     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5524     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5525     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5526     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5527     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5528     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5529     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5530     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5531     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
5532 struct Templates35 {
5533   typedef TemplateSel<T1> Head;
5534   typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5535       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5536       T29, T30, T31, T32, T33, T34, T35> Tail;
5537 };
5538
5539 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5540     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5541     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5542     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5543     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5544     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5545     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5546     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5547     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5548     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5549     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5550     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
5551 struct Templates36 {
5552   typedef TemplateSel<T1> Head;
5553   typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5554       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5555       T29, T30, T31, T32, T33, T34, T35, T36> Tail;
5556 };
5557
5558 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5559     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5560     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5561     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5562     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5563     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5564     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5565     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5566     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5567     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5568     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5569     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5570     GTEST_TEMPLATE_ T37>
5571 struct Templates37 {
5572   typedef TemplateSel<T1> Head;
5573   typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5574       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5575       T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
5576 };
5577
5578 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5579     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5580     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5581     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5582     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5583     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5584     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5585     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5586     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5587     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5588     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5589     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5590     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
5591 struct Templates38 {
5592   typedef TemplateSel<T1> Head;
5593   typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5594       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5595       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
5596 };
5597
5598 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5599     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5600     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5601     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5602     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5603     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5604     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5605     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5606     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5607     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5608     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5609     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5610     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
5611 struct Templates39 {
5612   typedef TemplateSel<T1> Head;
5613   typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5614       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5615       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
5616 };
5617
5618 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5619     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5620     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5621     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5622     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5623     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5624     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5625     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5626     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5627     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5628     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5629     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5630     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5631     GTEST_TEMPLATE_ T40>
5632 struct Templates40 {
5633   typedef TemplateSel<T1> Head;
5634   typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5635       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5636       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
5637 };
5638
5639 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5640     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5641     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5642     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5643     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5644     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5645     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5646     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5647     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5648     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5649     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5650     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5651     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5652     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
5653 struct Templates41 {
5654   typedef TemplateSel<T1> Head;
5655   typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5656       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5657       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
5658 };
5659
5660 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5661     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5662     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5663     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5664     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5665     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5666     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5667     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5668     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5669     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5670     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5671     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5672     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5673     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
5674 struct Templates42 {
5675   typedef TemplateSel<T1> Head;
5676   typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5677       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5678       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
5679       T42> Tail;
5680 };
5681
5682 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5683     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5684     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5685     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5686     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5687     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5688     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5689     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5690     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5691     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5692     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5693     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5694     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5695     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5696     GTEST_TEMPLATE_ T43>
5697 struct Templates43 {
5698   typedef TemplateSel<T1> Head;
5699   typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5700       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5701       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5702       T43> Tail;
5703 };
5704
5705 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5706     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5707     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5708     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5709     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5710     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5711     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5712     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5713     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5714     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5715     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5716     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5717     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5718     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5719     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
5720 struct Templates44 {
5721   typedef TemplateSel<T1> Head;
5722   typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5723       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5724       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5725       T43, T44> 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     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5740     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5741     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5742     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
5743 struct Templates45 {
5744   typedef TemplateSel<T1> Head;
5745   typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5746       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5747       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5748       T43, T44, T45> Tail;
5749 };
5750
5751 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5752     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5753     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5754     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5755     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5756     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5757     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5758     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5759     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5760     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5761     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5762     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5763     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5764     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5765     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5766     GTEST_TEMPLATE_ T46>
5767 struct Templates46 {
5768   typedef TemplateSel<T1> Head;
5769   typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5770       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5771       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5772       T43, T44, T45, T46> Tail;
5773 };
5774
5775 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5776     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5777     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5778     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5779     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5780     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5781     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5782     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5783     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5784     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5785     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5786     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5787     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5788     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5789     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5790     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
5791 struct Templates47 {
5792   typedef TemplateSel<T1> Head;
5793   typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5794       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5795       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5796       T43, T44, T45, T46, T47> Tail;
5797 };
5798
5799 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5800     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5801     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5802     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5803     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5804     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5805     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5806     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5807     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5808     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5809     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5810     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5811     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5812     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5813     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5814     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
5815 struct Templates48 {
5816   typedef TemplateSel<T1> Head;
5817   typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5818       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5819       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5820       T43, T44, T45, T46, T47, T48> 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, GTEST_TEMPLATE_ T39,
5836     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5837     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5838     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
5839     GTEST_TEMPLATE_ T49>
5840 struct Templates49 {
5841   typedef TemplateSel<T1> Head;
5842   typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5843       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5844       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5845       T43, T44, T45, T46, T47, T48, T49> Tail;
5846 };
5847
5848 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5849     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5850     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
5851     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
5852     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
5853     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
5854     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
5855     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
5856     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
5857     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
5858     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
5859     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
5860     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
5861     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
5862     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
5863     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
5864     GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
5865 struct Templates50 {
5866   typedef TemplateSel<T1> Head;
5867   typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
5868       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
5869       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
5870       T43, T44, T45, T46, T47, T48, T49, T50> Tail;
5871 };
5872
5873
5874 // We don't want to require the users to write TemplatesN<...> directly,
5875 // as that would require them to count the length.  Templates<...> is much
5876 // easier to write, but generates horrible messages when there is a
5877 // compiler error, as gcc insists on printing out each template
5878 // argument, even if it has the default value (this means Templates<list>
5879 // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
5880 // errors).
5881 //
5882 // Our solution is to combine the best part of the two approaches: a
5883 // user would write Templates<T1, ..., TN>, and Google Test will translate
5884 // that to TemplatesN<T1, ..., TN> internally to make error messages
5885 // readable.  The translation is done by the 'type' member of the
5886 // Templates template.
5887 template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
5888     GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
5889     GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
5890     GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
5891     GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
5892     GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
5893     GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
5894     GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
5895     GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
5896     GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
5897     GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
5898     GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
5899     GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
5900     GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
5901     GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
5902     GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
5903     GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
5904     GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
5905     GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
5906     GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
5907     GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
5908     GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
5909     GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
5910     GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
5911     GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
5912 struct Templates {
5913   typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
5914       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
5915       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
5916       T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
5917 };
5918
5919 template <>
5920 struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5921     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5922     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5923     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5924     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5925     NoneT> {
5926   typedef Templates0 type;
5927 };
5928 template <GTEST_TEMPLATE_ T1>
5929 struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5930     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5931     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5932     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5933     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5934     NoneT> {
5935   typedef Templates1<T1> type;
5936 };
5937 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
5938 struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5939     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5940     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5941     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5942     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5943     NoneT> {
5944   typedef Templates2<T1, T2> type;
5945 };
5946 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
5947 struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5948     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5949     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5950     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5951     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5952   typedef Templates3<T1, T2, T3> type;
5953 };
5954 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5955     GTEST_TEMPLATE_ T4>
5956 struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5957     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5958     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5959     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5960     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5961   typedef Templates4<T1, T2, T3, T4> type;
5962 };
5963 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5964     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
5965 struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5966     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5967     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5968     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5969     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5970   typedef Templates5<T1, T2, T3, T4, T5> type;
5971 };
5972 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5973     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
5974 struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
5975     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5976     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5977     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5978     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5979   typedef Templates6<T1, T2, T3, T4, T5, T6> type;
5980 };
5981 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5982     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5983     GTEST_TEMPLATE_ T7>
5984 struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
5985     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5986     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5987     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5988     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5989   typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
5990 };
5991 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
5992     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
5993     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
5994 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
5995     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5996     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5997     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
5998     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
5999   typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
6000 };
6001 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6002     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6003     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
6004 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
6005     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6006     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6007     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6008     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6009   typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
6010 };
6011 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6012     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6013     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6014     GTEST_TEMPLATE_ T10>
6015 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
6016     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6017     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6018     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6019     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6020   typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
6021 };
6022 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6023     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6024     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6025     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
6026 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
6027     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6028     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6029     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6030     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6031   typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
6032 };
6033 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6034     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6035     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6036     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
6037 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
6038     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6039     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6040     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6041     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6042   typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
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>
6049 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
6050     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6051     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6052     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6053     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6054   typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6055       T13> type;
6056 };
6057 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6058     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6059     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6060     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6061     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
6062 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6063     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6064     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6065     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6066     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6067   typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6068       T14> type;
6069 };
6070 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6071     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6072     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6073     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6074     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
6075 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6076     T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6077     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6078     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6079     NoneT, NoneT, NoneT, NoneT, NoneT> {
6080   typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6081       T14, T15> type;
6082 };
6083 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6084     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6085     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6086     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6087     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6088     GTEST_TEMPLATE_ T16>
6089 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6090     T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6091     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6092     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6093     NoneT, NoneT, NoneT, NoneT, NoneT> {
6094   typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6095       T14, T15, T16> type;
6096 };
6097 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6098     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6099     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6100     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6101     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6102     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
6103 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6104     T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6105     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6106     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6107     NoneT, NoneT, NoneT, NoneT, NoneT> {
6108   typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6109       T14, T15, T16, T17> type;
6110 };
6111 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6112     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6113     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6114     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6115     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6116     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
6117 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6118     T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6119     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6120     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6121     NoneT, NoneT, NoneT, NoneT> {
6122   typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6123       T14, T15, T16, T17, T18> type;
6124 };
6125 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6126     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6127     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6128     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6129     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6130     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6131     GTEST_TEMPLATE_ T19>
6132 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6133     T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6134     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6135     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6136     NoneT, NoneT, NoneT, NoneT> {
6137   typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6138       T14, T15, T16, T17, T18, T19> type;
6139 };
6140 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6141     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6142     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6143     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6144     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6145     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6146     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
6147 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6148     T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6149     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6150     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6151     NoneT, NoneT, NoneT, NoneT> {
6152   typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6153       T14, T15, T16, T17, T18, T19, T20> type;
6154 };
6155 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6156     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6157     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6158     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6159     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6160     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6161     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
6162 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6163     T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
6164     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6165     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6166     NoneT, NoneT, NoneT, NoneT> {
6167   typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6168       T14, T15, T16, T17, T18, T19, T20, T21> type;
6169 };
6170 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6171     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6172     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6173     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6174     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6175     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6176     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6177     GTEST_TEMPLATE_ T22>
6178 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6179     T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
6180     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6181     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6182     NoneT, NoneT, NoneT> {
6183   typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6184       T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
6185 };
6186 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6187     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6188     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6189     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6190     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6191     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6192     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6193     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
6194 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6195     T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
6196     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6197     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6198     NoneT, NoneT, NoneT> {
6199   typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6200       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
6201 };
6202 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6203     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6204     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6205     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6206     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6207     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6208     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6209     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
6210 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6211     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, 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> {
6215   typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6216       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
6217 };
6218 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6219     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6220     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6221     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6222     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6223     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6224     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6225     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6226     GTEST_TEMPLATE_ T25>
6227 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6228     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
6229     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6230     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6231     NoneT, NoneT> {
6232   typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6233       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
6234 };
6235 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6236     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6237     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6238     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6239     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6240     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6241     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6242     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6243     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
6244 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6245     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
6246     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6247     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6248     NoneT, NoneT> {
6249   typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6250       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
6251 };
6252 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6253     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6254     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6255     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6256     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6257     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6258     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6259     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6260     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
6261 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6262     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
6263     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6264     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6265     NoneT, NoneT> {
6266   typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6267       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6268       T27> type;
6269 };
6270 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6271     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6272     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6273     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6274     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6275     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6276     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6277     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6278     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6279     GTEST_TEMPLATE_ T28>
6280 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6281     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6282     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6283     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6284     NoneT, NoneT> {
6285   typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6286       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6287       T28> 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, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6294     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6295     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6296     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6297     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6298     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
6299 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6300     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6301     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6302     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6303     NoneT> {
6304   typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6305       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6306       T28, T29> type;
6307 };
6308 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6309     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6310     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6311     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6312     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6313     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6314     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6315     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6316     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6317     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
6318 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6319     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6320     T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6321     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6322   typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6323       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6324       T28, T29, T30> type;
6325 };
6326 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6327     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6328     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6329     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6330     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6331     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6332     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6333     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6334     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6335     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6336     GTEST_TEMPLATE_ T31>
6337 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6338     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6339     T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6340     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6341   typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6342       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6343       T28, T29, T30, T31> type;
6344 };
6345 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6346     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6347     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6348     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6349     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6350     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6351     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6352     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6353     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6354     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6355     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
6356 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6357     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6358     T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6359     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6360   typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6361       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6362       T28, T29, T30, T31, T32> type;
6363 };
6364 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6365     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6366     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6367     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6368     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6369     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6370     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6371     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6372     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6373     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6374     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
6375 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6376     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6377     T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6378     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6379   typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6380       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6381       T28, T29, T30, T31, T32, T33> type;
6382 };
6383 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6384     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6385     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6386     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6387     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6388     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6389     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6390     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6391     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6392     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6393     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6394     GTEST_TEMPLATE_ T34>
6395 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6396     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6397     T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6398     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6399   typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6400       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6401       T28, T29, T30, T31, T32, T33, T34> type;
6402 };
6403 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6404     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6405     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6406     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6407     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6408     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6409     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6410     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6411     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6412     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6413     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6414     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
6415 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6416     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6417     T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
6418     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6419   typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6420       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6421       T28, T29, T30, T31, T32, T33, T34, T35> type;
6422 };
6423 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6424     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6425     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6426     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6427     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6428     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6429     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6430     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6431     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6432     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6433     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6434     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
6435 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6436     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6437     T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
6438     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6439   typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6440       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6441       T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
6442 };
6443 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6444     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6445     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6446     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6447     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6448     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6449     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6450     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6451     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6452     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6453     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6454     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6455     GTEST_TEMPLATE_ T37>
6456 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6457     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6458     T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
6459     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6460   typedef Templates37<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, T25, T26, T27,
6462       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
6463 };
6464 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6465     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6466     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6467     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6468     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6469     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6470     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6471     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6472     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6473     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6474     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6475     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6476     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
6477 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6478     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6479     T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
6480     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6481   typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6482       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6483       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
6484 };
6485 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6486     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6487     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6488     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6489     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6490     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6491     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6492     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6493     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6494     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6495     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6496     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6497     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
6498 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6499     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6500     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
6501     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6502   typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6503       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6504       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
6505 };
6506 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6507     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6508     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6509     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6510     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6511     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6512     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6513     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6514     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6515     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6516     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6517     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6518     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6519     GTEST_TEMPLATE_ T40>
6520 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6521     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6522     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
6523     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6524   typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6525       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6526       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
6527 };
6528 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6529     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6530     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6531     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6532     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6533     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6534     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6535     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6536     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6537     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6538     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6539     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6540     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6541     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
6542 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6543     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6544     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
6545     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6546   typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6547       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6548       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6549       T41> type;
6550 };
6551 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6552     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6553     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6554     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6555     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6556     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6557     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6558     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6559     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6560     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6561     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6562     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6563     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6564     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
6565 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6566     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6567     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
6568     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6569   typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6570       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6571       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6572       T42> type;
6573 };
6574 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6575     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6576     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6577     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6578     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6579     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6580     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6581     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6582     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6583     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6584     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6585     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6586     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6587     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6588     GTEST_TEMPLATE_ T43>
6589 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6590     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6591     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
6592     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6593   typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6594       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6595       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6596       T42, T43> type;
6597 };
6598 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6599     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6600     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6601     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6602     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6603     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6604     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6605     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6606     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6607     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6608     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6609     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6610     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6611     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6612     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
6613 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6614     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6615     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6616     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
6617   typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6618       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6619       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6620       T42, T43, T44> type;
6621 };
6622 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6623     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6624     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6625     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6626     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6627     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6628     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6629     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6630     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6631     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6632     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6633     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6634     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6635     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6636     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
6637 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6638     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6639     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6640     T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
6641   typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6642       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6643       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6644       T42, T43, T44, T45> type;
6645 };
6646 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6647     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6648     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6649     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6650     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6651     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6652     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6653     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6654     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6655     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6656     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6657     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6658     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6659     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6660     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6661     GTEST_TEMPLATE_ T46>
6662 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6663     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6664     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6665     T45, T46, NoneT, NoneT, NoneT, NoneT> {
6666   typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6667       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6668       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6669       T42, T43, T44, T45, T46> type;
6670 };
6671 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6672     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6673     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6674     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6675     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6676     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6677     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6678     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6679     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6680     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6681     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6682     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6683     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6684     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6685     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6686     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
6687 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6688     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6689     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6690     T45, T46, T47, NoneT, NoneT, NoneT> {
6691   typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6692       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6693       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6694       T42, T43, T44, T45, T46, T47> type;
6695 };
6696 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6697     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6698     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6699     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6700     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6701     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6702     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6703     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6704     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6705     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6706     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6707     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6708     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6709     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6710     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6711     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
6712 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6713     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6714     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6715     T45, T46, T47, T48, NoneT, NoneT> {
6716   typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6717       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6718       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6719       T42, T43, T44, T45, T46, T47, T48> type;
6720 };
6721 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
6722     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
6723     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
6724     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
6725     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
6726     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
6727     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
6728     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
6729     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
6730     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
6731     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
6732     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
6733     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
6734     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
6735     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
6736     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
6737     GTEST_TEMPLATE_ T49>
6738 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
6739     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
6740     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
6741     T45, T46, T47, T48, T49, NoneT> {
6742   typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6743       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
6744       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
6745       T42, T43, T44, T45, T46, T47, T48, T49> type;
6746 };
6747
6748 // The TypeList template makes it possible to use either a single type
6749 // or a Types<...> list in TYPED_TEST_CASE() and
6750 // INSTANTIATE_TYPED_TEST_CASE_P().
6751
6752 template <typename T>
6753 struct TypeList {
6754   typedef Types1<T> type;
6755 };
6756
6757 template <typename T1, typename T2, typename T3, typename T4, typename T5,
6758     typename T6, typename T7, typename T8, typename T9, typename T10,
6759     typename T11, typename T12, typename T13, typename T14, typename T15,
6760     typename T16, typename T17, typename T18, typename T19, typename T20,
6761     typename T21, typename T22, typename T23, typename T24, typename T25,
6762     typename T26, typename T27, typename T28, typename T29, typename T30,
6763     typename T31, typename T32, typename T33, typename T34, typename T35,
6764     typename T36, typename T37, typename T38, typename T39, typename T40,
6765     typename T41, typename T42, typename T43, typename T44, typename T45,
6766     typename T46, typename T47, typename T48, typename T49, typename T50>
6767 struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
6768     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
6769     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
6770     T44, T45, T46, T47, T48, T49, T50> > {
6771   typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
6772       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
6773       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
6774       T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
6775 };
6776
6777 #endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
6778
6779 }  // namespace internal
6780 }  // namespace testing
6781
6782 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
6783
6784 // Due to C++ preprocessor weirdness, we need double indirection to
6785 // concatenate two tokens when one of them is __LINE__.  Writing
6786 //
6787 //   foo ## __LINE__
6788 //
6789 // will result in the token foo__LINE__, instead of foo followed by
6790 // the current line number.  For more details, see
6791 // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
6792 #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
6793 #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
6794
6795 // Google Test defines the testing::Message class to allow construction of
6796 // test messages via the << operator.  The idea is that anything
6797 // streamable to std::ostream can be streamed to a testing::Message.
6798 // This allows a user to use his own types in Google Test assertions by
6799 // overloading the << operator.
6800 //
6801 // util/gtl/stl_logging.h overloads << for STL containers.  These
6802 // overloads cannot be defined in the std namespace, as that will be
6803 // undefined behavior.  Therefore, they are defined in the global
6804 // namespace instead.
6805 //
6806 // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
6807 // overloads are visible in either the std namespace or the global
6808 // namespace, but not other namespaces, including the testing
6809 // namespace which Google Test's Message class is in.
6810 //
6811 // To allow STL containers (and other types that has a << operator
6812 // defined in the global namespace) to be used in Google Test assertions,
6813 // testing::Message must access the custom << operator from the global
6814 // namespace.  Hence this helper function.
6815 //
6816 // Note: Jeffrey Yasskin suggested an alternative fix by "using
6817 // ::operator<<;" in the definition of Message's operator<<.  That fix
6818 // doesn't require a helper function, but unfortunately doesn't
6819 // compile with MSVC.
6820 template <typename T>
6821 inline void GTestStreamToHelper(std::ostream* os, const T& val) {
6822   *os << val;
6823 }
6824
6825 class ProtocolMessage;
6826 namespace proto2 { class Message; }
6827
6828 namespace testing {
6829
6830 // Forward declarations.
6831
6832 class AssertionResult;                 // Result of an assertion.
6833 class Message;                         // Represents a failure message.
6834 class Test;                            // Represents a test.
6835 class TestInfo;                        // Information about a test.
6836 class TestPartResult;                  // Result of a test part.
6837 class UnitTest;                        // A collection of test cases.
6838
6839 template <typename T>
6840 ::std::string PrintToString(const T& value);
6841
6842 namespace internal {
6843
6844 struct TraceInfo;                      // Information about a trace point.
6845 class ScopedTrace;                     // Implements scoped trace.
6846 class TestInfoImpl;                    // Opaque implementation of TestInfo
6847 class UnitTestImpl;                    // Opaque implementation of UnitTest
6848
6849 // How many times InitGoogleTest() has been called.
6850 GTEST_API_ extern int g_init_gtest_count;
6851
6852 // The text used in failure messages to indicate the start of the
6853 // stack trace.
6854 GTEST_API_ extern const char kStackTraceMarker[];
6855
6856 // A secret type that Google Test users don't know about.  It has no
6857 // definition on purpose.  Therefore it's impossible to create a
6858 // Secret object, which is what we want.
6859 class Secret;
6860
6861 // Two overloaded helpers for checking at compile time whether an
6862 // expression is a null pointer literal (i.e. NULL or any 0-valued
6863 // compile-time integral constant).  Their return values have
6864 // different sizes, so we can use sizeof() to test which version is
6865 // picked by the compiler.  These helpers have no implementations, as
6866 // we only need their signatures.
6867 //
6868 // Given IsNullLiteralHelper(x), the compiler will pick the first
6869 // version if x can be implicitly converted to Secret*, and pick the
6870 // second version otherwise.  Since Secret is a secret and incomplete
6871 // type, the only expression a user can write that has type Secret* is
6872 // a null pointer literal.  Therefore, we know that x is a null
6873 // pointer literal if and only if the first version is picked by the
6874 // compiler.
6875 char IsNullLiteralHelper(Secret* p);
6876 char (&IsNullLiteralHelper(...))[2];  // NOLINT
6877
6878 // A compile-time bool constant that is true if and only if x is a
6879 // null pointer literal (i.e. NULL or any 0-valued compile-time
6880 // integral constant).
6881 #ifdef GTEST_ELLIPSIS_NEEDS_POD_
6882 // We lose support for NULL detection where the compiler doesn't like
6883 // passing non-POD classes through ellipsis (...).
6884 # define GTEST_IS_NULL_LITERAL_(x) false
6885 #else
6886 # define GTEST_IS_NULL_LITERAL_(x) \
6887     (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
6888 #endif  // GTEST_ELLIPSIS_NEEDS_POD_
6889
6890 // Appends the user-supplied message to the Google-Test-generated message.
6891 GTEST_API_ std::string AppendUserMessage(
6892     const std::string& gtest_msg, const Message& user_msg);
6893
6894 // A helper class for creating scoped traces in user programs.
6895 class GTEST_API_ ScopedTrace {
6896  public:
6897   // The c'tor pushes the given source file location and message onto
6898   // a trace stack maintained by Google Test.
6899   ScopedTrace(const char* file, int line, const Message& message);
6900
6901   // The d'tor pops the info pushed by the c'tor.
6902   //
6903   // Note that the d'tor is not virtual in order to be efficient.
6904   // Don't inherit from ScopedTrace!
6905   ~ScopedTrace();
6906
6907  private:
6908   GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
6909 } GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its
6910                             // c'tor and d'tor.  Therefore it doesn't
6911                             // need to be used otherwise.
6912
6913 // Converts a streamable value to an std::string.  A NULL pointer is
6914 // converted to "(null)".  When the input value is a ::string,
6915 // ::std::string, ::wstring, or ::std::wstring object, each NUL
6916 // character in it is replaced with "\\0".
6917 // Declared here but defined in gtest.h, so that it has access
6918 // to the definition of the Message class, required by the ARM
6919 // compiler.
6920 template <typename T>
6921 std::string StreamableToString(const T& streamable);
6922
6923 // Constructs and returns the message for an equality assertion
6924 // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
6925 //
6926 // The first four parameters are the expressions used in the assertion
6927 // and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
6928 // where foo is 5 and bar is 6, we have:
6929 //
6930 //   expected_expression: "foo"
6931 //   actual_expression:   "bar"
6932 //   expected_value:      "5"
6933 //   actual_value:        "6"
6934 //
6935 // The ignoring_case parameter is true iff the assertion is a
6936 // *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will
6937 // be inserted into the message.
6938 GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
6939                                      const char* actual_expression,
6940                                      const std::string& expected_value,
6941                                      const std::string& actual_value,
6942                                      bool ignoring_case);
6943
6944 // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
6945 GTEST_API_ std::string GetBoolAssertionFailureMessage(
6946     const AssertionResult& assertion_result,
6947     const char* expression_text,
6948     const char* actual_predicate_value,
6949     const char* expected_predicate_value);
6950
6951 // This template class represents an IEEE floating-point number
6952 // (either single-precision or double-precision, depending on the
6953 // template parameters).
6954 //
6955 // The purpose of this class is to do more sophisticated number
6956 // comparison.  (Due to round-off error, etc, it's very unlikely that
6957 // two floating-points will be equal exactly.  Hence a naive
6958 // comparison by the == operation often doesn't work.)
6959 //
6960 // Format of IEEE floating-point:
6961 //
6962 //   The most-significant bit being the leftmost, an IEEE
6963 //   floating-point looks like
6964 //
6965 //     sign_bit exponent_bits fraction_bits
6966 //
6967 //   Here, sign_bit is a single bit that designates the sign of the
6968 //   number.
6969 //
6970 //   For float, there are 8 exponent bits and 23 fraction bits.
6971 //
6972 //   For double, there are 11 exponent bits and 52 fraction bits.
6973 //
6974 //   More details can be found at
6975 //   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
6976 //
6977 // Template parameter:
6978 //
6979 //   RawType: the raw floating-point type (either float or double)
6980 template <typename RawType>
6981 class FloatingPoint {
6982  public:
6983   // Defines the unsigned integer type that has the same size as the
6984   // floating point number.
6985   typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
6986
6987   // Constants.
6988
6989   // # of bits in a number.
6990   static const size_t kBitCount = 8*sizeof(RawType);
6991
6992   // # of fraction bits in a number.
6993   static const size_t kFractionBitCount =
6994     std::numeric_limits<RawType>::digits - 1;
6995
6996   // # of exponent bits in a number.
6997   static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
6998
6999   // The mask for the sign bit.
7000   static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
7001
7002   // The mask for the fraction bits.
7003   static const Bits kFractionBitMask =
7004     ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
7005
7006   // The mask for the exponent bits.
7007   static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
7008
7009   // How many ULP's (Units in the Last Place) we want to tolerate when
7010   // comparing two numbers.  The larger the value, the more error we
7011   // allow.  A 0 value means that two numbers must be exactly the same
7012   // to be considered equal.
7013   //
7014   // The maximum error of a single floating-point operation is 0.5
7015   // units in the last place.  On Intel CPU's, all floating-point
7016   // calculations are done with 80-bit precision, while double has 64
7017   // bits.  Therefore, 4 should be enough for ordinary use.
7018   //
7019   // See the following article for more details on ULP:
7020   // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm.
7021   static const size_t kMaxUlps = 4;
7022
7023   // Constructs a FloatingPoint from a raw floating-point number.
7024   //
7025   // On an Intel CPU, passing a non-normalized NAN (Not a Number)
7026   // around may change its bits, although the new value is guaranteed
7027   // to be also a NAN.  Therefore, don't expect this constructor to
7028   // preserve the bits in x when x is a NAN.
7029   explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
7030
7031   // Static methods
7032
7033   // Reinterprets a bit pattern as a floating-point number.
7034   //
7035   // This function is needed to test the AlmostEquals() method.
7036   static RawType ReinterpretBits(const Bits bits) {
7037     FloatingPoint fp(0);
7038     fp.u_.bits_ = bits;
7039     return fp.u_.value_;
7040   }
7041
7042   // Returns the floating-point number that represent positive infinity.
7043   static RawType Infinity() {
7044     return ReinterpretBits(kExponentBitMask);
7045   }
7046
7047   // Non-static methods
7048
7049   // Returns the bits that represents this number.
7050   const Bits &bits() const { return u_.bits_; }
7051
7052   // Returns the exponent bits of this number.
7053   Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
7054
7055   // Returns the fraction bits of this number.
7056   Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
7057
7058   // Returns the sign bit of this number.
7059   Bits sign_bit() const { return kSignBitMask & u_.bits_; }
7060
7061   // Returns true iff this is NAN (not a number).
7062   bool is_nan() const {
7063     // It's a NAN if the exponent bits are all ones and the fraction
7064     // bits are not entirely zeros.
7065     return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
7066   }
7067
7068   // Returns true iff this number is at most kMaxUlps ULP's away from
7069   // rhs.  In particular, this function:
7070   //
7071   //   - returns false if either number is (or both are) NAN.
7072   //   - treats really large numbers as almost equal to infinity.
7073   //   - thinks +0.0 and -0.0 are 0 DLP's apart.
7074   bool AlmostEquals(const FloatingPoint& rhs) const {
7075     // The IEEE standard says that any comparison operation involving
7076     // a NAN must return false.
7077     if (is_nan() || rhs.is_nan()) return false;
7078
7079     return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
7080         <= kMaxUlps;
7081   }
7082
7083  private:
7084   // The data type used to store the actual floating-point number.
7085   union FloatingPointUnion {
7086     RawType value_;  // The raw floating-point number.
7087     Bits bits_;      // The bits that represent the number.
7088   };
7089
7090   // Converts an integer from the sign-and-magnitude representation to
7091   // the biased representation.  More precisely, let N be 2 to the
7092   // power of (kBitCount - 1), an integer x is represented by the
7093   // unsigned number x + N.
7094   //
7095   // For instance,
7096   //
7097   //   -N + 1 (the most negative number representable using
7098   //          sign-and-magnitude) is represented by 1;
7099   //   0      is represented by N; and
7100   //   N - 1  (the biggest number representable using
7101   //          sign-and-magnitude) is represented by 2N - 1.
7102   //
7103   // Read http://en.wikipedia.org/wiki/Signed_number_representations
7104   // for more details on signed number representations.
7105   static Bits SignAndMagnitudeToBiased(const Bits &sam) {
7106     if (kSignBitMask & sam) {
7107       // sam represents a negative number.
7108       return ~sam + 1;
7109     } else {
7110       // sam represents a positive number.
7111       return kSignBitMask | sam;
7112     }
7113   }
7114
7115   // Given two numbers in the sign-and-magnitude representation,
7116   // returns the distance between them as an unsigned number.
7117   static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
7118                                                      const Bits &sam2) {
7119     const Bits biased1 = SignAndMagnitudeToBiased(sam1);
7120     const Bits biased2 = SignAndMagnitudeToBiased(sam2);
7121     return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
7122   }
7123
7124   FloatingPointUnion u_;
7125 };
7126
7127 // Typedefs the instances of the FloatingPoint template class that we
7128 // care to use.
7129 typedef FloatingPoint<float> Float;
7130 typedef FloatingPoint<double> Double;
7131
7132 // In order to catch the mistake of putting tests that use different
7133 // test fixture classes in the same test case, we need to assign
7134 // unique IDs to fixture classes and compare them.  The TypeId type is
7135 // used to hold such IDs.  The user should treat TypeId as an opaque
7136 // type: the only operation allowed on TypeId values is to compare
7137 // them for equality using the == operator.
7138 typedef const void* TypeId;
7139
7140 template <typename T>
7141 class TypeIdHelper {
7142  public:
7143   // dummy_ must not have a const type.  Otherwise an overly eager
7144   // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
7145   // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
7146   static bool dummy_;
7147 };
7148
7149 template <typename T>
7150 bool TypeIdHelper<T>::dummy_ = false;
7151
7152 // GetTypeId<T>() returns the ID of type T.  Different values will be
7153 // returned for different types.  Calling the function twice with the
7154 // same type argument is guaranteed to return the same ID.
7155 template <typename T>
7156 TypeId GetTypeId() {
7157   // The compiler is required to allocate a different
7158   // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
7159   // the template.  Therefore, the address of dummy_ is guaranteed to
7160   // be unique.
7161   return &(TypeIdHelper<T>::dummy_);
7162 }
7163
7164 // Returns the type ID of ::testing::Test.  Always call this instead
7165 // of GetTypeId< ::testing::Test>() to get the type ID of
7166 // ::testing::Test, as the latter may give the wrong result due to a
7167 // suspected linker bug when compiling Google Test as a Mac OS X
7168 // framework.
7169 GTEST_API_ TypeId GetTestTypeId();
7170
7171 // Defines the abstract factory interface that creates instances
7172 // of a Test object.
7173 class TestFactoryBase {
7174  public:
7175   virtual ~TestFactoryBase() {}
7176
7177   // Creates a test instance to run. The instance is both created and destroyed
7178   // within TestInfoImpl::Run()
7179   virtual Test* CreateTest() = 0;
7180
7181  protected:
7182   TestFactoryBase() {}
7183
7184  private:
7185   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
7186 };
7187
7188 // This class provides implementation of TeastFactoryBase interface.
7189 // It is used in TEST and TEST_F macros.
7190 template <class TestClass>
7191 class TestFactoryImpl : public TestFactoryBase {
7192  public:
7193   virtual Test* CreateTest() { return new TestClass; }
7194 };
7195
7196 #if GTEST_OS_WINDOWS
7197
7198 // Predicate-formatters for implementing the HRESULT checking macros
7199 // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
7200 // We pass a long instead of HRESULT to avoid causing an
7201 // include dependency for the HRESULT type.
7202 GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
7203                                             long hr);  // NOLINT
7204 GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
7205                                             long hr);  // NOLINT
7206
7207 #endif  // GTEST_OS_WINDOWS
7208
7209 // Types of SetUpTestCase() and TearDownTestCase() functions.
7210 typedef void (*SetUpTestCaseFunc)();
7211 typedef void (*TearDownTestCaseFunc)();
7212
7213 // Creates a new TestInfo object and registers it with Google Test;
7214 // returns the created object.
7215 //
7216 // Arguments:
7217 //
7218 //   test_case_name:   name of the test case
7219 //   name:             name of the test
7220 //   type_param        the name of the test's type parameter, or NULL if
7221 //                     this is not  a typed or a type-parameterized test.
7222 //   value_param       text representation of the test's value parameter,
7223 //                     or NULL if this is not a type-parameterized test.
7224 //   fixture_class_id: ID of the test fixture class
7225 //   set_up_tc:        pointer to the function that sets up the test case
7226 //   tear_down_tc:     pointer to the function that tears down the test case
7227 //   factory:          pointer to the factory that creates a test object.
7228 //                     The newly created TestInfo instance will assume
7229 //                     ownership of the factory object.
7230 GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
7231     const char* test_case_name, const char* name,
7232     const char* type_param,
7233     const char* value_param,
7234     TypeId fixture_class_id,
7235     SetUpTestCaseFunc set_up_tc,
7236     TearDownTestCaseFunc tear_down_tc,
7237     TestFactoryBase* factory);
7238
7239 // If *pstr starts with the given prefix, modifies *pstr to be right
7240 // past the prefix and returns true; otherwise leaves *pstr unchanged
7241 // and returns false.  None of pstr, *pstr, and prefix can be NULL.
7242 GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
7243
7244 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7245
7246 // State of the definition of a type-parameterized test case.
7247 class GTEST_API_ TypedTestCasePState {
7248  public:
7249   TypedTestCasePState() : registered_(false) {}
7250
7251   // Adds the given test name to defined_test_names_ and return true
7252   // if the test case hasn't been registered; otherwise aborts the
7253   // program.
7254   bool AddTestName(const char* file, int line, const char* case_name,
7255                    const char* test_name) {
7256     if (registered_) {
7257       fprintf(stderr, "%s Test %s must be defined before "
7258               "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
7259               FormatFileLocation(file, line).c_str(), test_name, case_name);
7260       fflush(stderr);
7261       posix::Abort();
7262     }
7263     defined_test_names_.insert(test_name);
7264     return true;
7265   }
7266
7267   // Verifies that registered_tests match the test names in
7268   // defined_test_names_; returns registered_tests if successful, or
7269   // aborts the program otherwise.
7270   const char* VerifyRegisteredTestNames(
7271       const char* file, int line, const char* registered_tests);
7272
7273  private:
7274   bool registered_;
7275   ::std::set<const char*> defined_test_names_;
7276 };
7277
7278 // Skips to the first non-space char after the first comma in 'str';
7279 // returns NULL if no comma is found in 'str'.
7280 inline const char* SkipComma(const char* str) {
7281   const char* comma = strchr(str, ',');
7282   if (comma == NULL) {
7283     return NULL;
7284   }
7285   while (IsSpace(*(++comma))) {}
7286   return comma;
7287 }
7288
7289 // Returns the prefix of 'str' before the first comma in it; returns
7290 // the entire string if it contains no comma.
7291 inline std::string GetPrefixUntilComma(const char* str) {
7292   const char* comma = strchr(str, ',');
7293   return comma == NULL ? str : std::string(str, comma);
7294 }
7295
7296 // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
7297 // registers a list of type-parameterized tests with Google Test.  The
7298 // return value is insignificant - we just need to return something
7299 // such that we can call this function in a namespace scope.
7300 //
7301 // Implementation note: The GTEST_TEMPLATE_ macro declares a template
7302 // template parameter.  It's defined in gtest-type-util.h.
7303 template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
7304 class TypeParameterizedTest {
7305  public:
7306   // 'index' is the index of the test in the type list 'Types'
7307   // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
7308   // Types).  Valid values for 'index' are [0, N - 1] where N is the
7309   // length of Types.
7310   static bool Register(const char* prefix, const char* case_name,
7311                        const char* test_names, int index) {
7312     typedef typename Types::Head Type;
7313     typedef Fixture<Type> FixtureClass;
7314     typedef typename GTEST_BIND_(TestSel, Type) TestClass;
7315
7316     // First, registers the first type-parameterized test in the type
7317     // list.
7318     MakeAndRegisterTestInfo(
7319         String::Format("%s%s%s/%d", prefix, prefix[0] == '\0' ? "" : "/",
7320                        case_name, index).c_str(),
7321         GetPrefixUntilComma(test_names).c_str(),
7322         GetTypeName<Type>().c_str(),
7323         NULL,  // No value parameter.
7324         GetTypeId<FixtureClass>(),
7325         TestClass::SetUpTestCase,
7326         TestClass::TearDownTestCase,
7327         new TestFactoryImpl<TestClass>);
7328
7329     // Next, recurses (at compile time) with the tail of the type list.
7330     return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
7331         ::Register(prefix, case_name, test_names, index + 1);
7332   }
7333 };
7334
7335 // The base case for the compile time recursion.
7336 template <GTEST_TEMPLATE_ Fixture, class TestSel>
7337 class TypeParameterizedTest<Fixture, TestSel, Types0> {
7338  public:
7339   static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7340                        const char* /*test_names*/, int /*index*/) {
7341     return true;
7342   }
7343 };
7344
7345 // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
7346 // registers *all combinations* of 'Tests' and 'Types' with Google
7347 // Test.  The return value is insignificant - we just need to return
7348 // something such that we can call this function in a namespace scope.
7349 template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
7350 class TypeParameterizedTestCase {
7351  public:
7352   static bool Register(const char* prefix, const char* case_name,
7353                        const char* test_names) {
7354     typedef typename Tests::Head Head;
7355
7356     // First, register the first test in 'Test' for each type in 'Types'.
7357     TypeParameterizedTest<Fixture, Head, Types>::Register(
7358         prefix, case_name, test_names, 0);
7359
7360     // Next, recurses (at compile time) with the tail of the test list.
7361     return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
7362         ::Register(prefix, case_name, SkipComma(test_names));
7363   }
7364 };
7365
7366 // The base case for the compile time recursion.
7367 template <GTEST_TEMPLATE_ Fixture, typename Types>
7368 class TypeParameterizedTestCase<Fixture, Templates0, Types> {
7369  public:
7370   static bool Register(const char* /*prefix*/, const char* /*case_name*/,
7371                        const char* /*test_names*/) {
7372     return true;
7373   }
7374 };
7375
7376 #endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
7377
7378 // Returns the current OS stack trace as an std::string.
7379 //
7380 // The maximum number of stack frames to be included is specified by
7381 // the gtest_stack_trace_depth flag.  The skip_count parameter
7382 // specifies the number of top frames to be skipped, which doesn't
7383 // count against the number of frames to be included.
7384 //
7385 // For example, if Foo() calls Bar(), which in turn calls
7386 // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
7387 // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
7388 GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
7389     UnitTest* unit_test, int skip_count);
7390
7391 // Helpers for suppressing warnings on unreachable code or constant
7392 // condition.
7393
7394 // Always returns true.
7395 GTEST_API_ bool AlwaysTrue();
7396
7397 // Always returns false.
7398 inline bool AlwaysFalse() { return !AlwaysTrue(); }
7399
7400 // Helper for suppressing false warning from Clang on a const char*
7401 // variable declared in a conditional expression always being NULL in
7402 // the else branch.
7403 struct GTEST_API_ ConstCharPtr {
7404   ConstCharPtr(const char* str) : value(str) {}
7405   operator bool() const { return true; }
7406   const char* value;
7407 };
7408
7409 // A simple Linear Congruential Generator for generating random
7410 // numbers with a uniform distribution.  Unlike rand() and srand(), it
7411 // doesn't use global state (and therefore can't interfere with user
7412 // code).  Unlike rand_r(), it's portable.  An LCG isn't very random,
7413 // but it's good enough for our purposes.
7414 class GTEST_API_ Random {
7415  public:
7416   static const UInt32 kMaxRange = 1u << 31;
7417
7418   explicit Random(UInt32 seed) : state_(seed) {}
7419
7420   void Reseed(UInt32 seed) { state_ = seed; }
7421
7422   // Generates a random number from [0, range).  Crashes if 'range' is
7423   // 0 or greater than kMaxRange.
7424   UInt32 Generate(UInt32 range);
7425
7426  private:
7427   UInt32 state_;
7428   GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
7429 };
7430
7431 // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
7432 // compiler error iff T1 and T2 are different types.
7433 template <typename T1, typename T2>
7434 struct CompileAssertTypesEqual;
7435
7436 template <typename T>
7437 struct CompileAssertTypesEqual<T, T> {
7438 };
7439
7440 // Removes the reference from a type if it is a reference type,
7441 // otherwise leaves it unchanged.  This is the same as
7442 // tr1::remove_reference, which is not widely available yet.
7443 template <typename T>
7444 struct RemoveReference { typedef T type; };  // NOLINT
7445 template <typename T>
7446 struct RemoveReference<T&> { typedef T type; };  // NOLINT
7447
7448 // A handy wrapper around RemoveReference that works when the argument
7449 // T depends on template parameters.
7450 #define GTEST_REMOVE_REFERENCE_(T) \
7451     typename ::testing::internal::RemoveReference<T>::type
7452
7453 // Removes const from a type if it is a const type, otherwise leaves
7454 // it unchanged.  This is the same as tr1::remove_const, which is not
7455 // widely available yet.
7456 template <typename T>
7457 struct RemoveConst { typedef T type; };  // NOLINT
7458 template <typename T>
7459 struct RemoveConst<const T> { typedef T type; };  // NOLINT
7460
7461 // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
7462 // definition to fail to remove the const in 'const int[3]' and 'const
7463 // char[3][4]'.  The following specialization works around the bug.
7464 template <typename T, size_t N>
7465 struct RemoveConst<const T[N]> {
7466   typedef typename RemoveConst<T>::type type[N];
7467 };
7468
7469 #if defined(_MSC_VER) && _MSC_VER < 1400
7470 // This is the only specialization that allows VC++ 7.1 to remove const in
7471 // 'const int[3] and 'const int[3][4]'.  However, it causes trouble with GCC
7472 // and thus needs to be conditionally compiled.
7473 template <typename T, size_t N>
7474 struct RemoveConst<T[N]> {
7475   typedef typename RemoveConst<T>::type type[N];
7476 };
7477 #endif
7478
7479 // A handy wrapper around RemoveConst that works when the argument
7480 // T depends on template parameters.
7481 #define GTEST_REMOVE_CONST_(T) \
7482     typename ::testing::internal::RemoveConst<T>::type
7483
7484 // Turns const U&, U&, const U, and U all into U.
7485 #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
7486     GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
7487
7488 // Adds reference to a type if it is not a reference type,
7489 // otherwise leaves it unchanged.  This is the same as
7490 // tr1::add_reference, which is not widely available yet.
7491 template <typename T>
7492 struct AddReference { typedef T& type; };  // NOLINT
7493 template <typename T>
7494 struct AddReference<T&> { typedef T& type; };  // NOLINT
7495
7496 // A handy wrapper around AddReference that works when the argument T
7497 // depends on template parameters.
7498 #define GTEST_ADD_REFERENCE_(T) \
7499     typename ::testing::internal::AddReference<T>::type
7500
7501 // Adds a reference to const on top of T as necessary.  For example,
7502 // it transforms
7503 //
7504 //   char         ==> const char&
7505 //   const char   ==> const char&
7506 //   char&        ==> const char&
7507 //   const char&  ==> const char&
7508 //
7509 // The argument T must depend on some template parameters.
7510 #define GTEST_REFERENCE_TO_CONST_(T) \
7511     GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
7512
7513 // ImplicitlyConvertible<From, To>::value is a compile-time bool
7514 // constant that's true iff type From can be implicitly converted to
7515 // type To.
7516 template <typename From, typename To>
7517 class ImplicitlyConvertible {
7518  private:
7519   // We need the following helper functions only for their types.
7520   // They have no implementations.
7521
7522   // MakeFrom() is an expression whose type is From.  We cannot simply
7523   // use From(), as the type From may not have a public default
7524   // constructor.
7525   static From MakeFrom();
7526
7527   // These two functions are overloaded.  Given an expression
7528   // Helper(x), the compiler will pick the first version if x can be
7529   // implicitly converted to type To; otherwise it will pick the
7530   // second version.
7531   //
7532   // The first version returns a value of size 1, and the second
7533   // version returns a value of size 2.  Therefore, by checking the
7534   // size of Helper(x), which can be done at compile time, we can tell
7535   // which version of Helper() is used, and hence whether x can be
7536   // implicitly converted to type To.
7537   static char Helper(To);
7538   static char (&Helper(...))[2];  // NOLINT
7539
7540   // We have to put the 'public' section after the 'private' section,
7541   // or MSVC refuses to compile the code.
7542  public:
7543   // MSVC warns about implicitly converting from double to int for
7544   // possible loss of data, so we need to temporarily disable the
7545   // warning.
7546 #ifdef _MSC_VER
7547 # pragma warning(push)          // Saves the current warning state.
7548 # pragma warning(disable:4244)  // Temporarily disables warning 4244.
7549
7550   static const bool value =
7551       sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
7552 # pragma warning(pop)           // Restores the warning state.
7553 #elif defined(__BORLANDC__)
7554   // C++Builder cannot use member overload resolution during template
7555   // instantiation.  The simplest workaround is to use its C++0x type traits
7556   // functions (C++Builder 2009 and above only).
7557   static const bool value = __is_convertible(From, To);
7558 #else
7559   static const bool value =
7560       sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
7561 #endif  // _MSV_VER
7562 };
7563 template <typename From, typename To>
7564 const bool ImplicitlyConvertible<From, To>::value;
7565
7566 // IsAProtocolMessage<T>::value is a compile-time bool constant that's
7567 // true iff T is type ProtocolMessage, proto2::Message, or a subclass
7568 // of those.
7569 template <typename T>
7570 struct IsAProtocolMessage
7571     : public bool_constant<
7572   ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
7573   ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
7574 };
7575
7576 // When the compiler sees expression IsContainerTest<C>(0), if C is an
7577 // STL-style container class, the first overload of IsContainerTest
7578 // will be viable (since both C::iterator* and C::const_iterator* are
7579 // valid types and NULL can be implicitly converted to them).  It will
7580 // be picked over the second overload as 'int' is a perfect match for
7581 // the type of argument 0.  If C::iterator or C::const_iterator is not
7582 // a valid type, the first overload is not viable, and the second
7583 // overload will be picked.  Therefore, we can determine whether C is
7584 // a container class by checking the type of IsContainerTest<C>(0).
7585 // The value of the expression is insignificant.
7586 //
7587 // Note that we look for both C::iterator and C::const_iterator.  The
7588 // reason is that C++ injects the name of a class as a member of the
7589 // class itself (e.g. you can refer to class iterator as either
7590 // 'iterator' or 'iterator::iterator').  If we look for C::iterator
7591 // only, for example, we would mistakenly think that a class named
7592 // iterator is an STL container.
7593 //
7594 // Also note that the simpler approach of overloading
7595 // IsContainerTest(typename C::const_iterator*) and
7596 // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
7597 typedef int IsContainer;
7598 template <class C>
7599 IsContainer IsContainerTest(int /* dummy */,
7600                             typename C::iterator* /* it */ = NULL,
7601                             typename C::const_iterator* /* const_it */ = NULL) {
7602   return 0;
7603 }
7604
7605 typedef char IsNotContainer;
7606 template <class C>
7607 IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
7608
7609 // EnableIf<condition>::type is void when 'Cond' is true, and
7610 // undefined when 'Cond' is false.  To use SFINAE to make a function
7611 // overload only apply when a particular expression is true, add
7612 // "typename EnableIf<expression>::type* = 0" as the last parameter.
7613 template<bool> struct EnableIf;
7614 template<> struct EnableIf<true> { typedef void type; };  // NOLINT
7615
7616 // Utilities for native arrays.
7617
7618 // ArrayEq() compares two k-dimensional native arrays using the
7619 // elements' operator==, where k can be any integer >= 0.  When k is
7620 // 0, ArrayEq() degenerates into comparing a single pair of values.
7621
7622 template <typename T, typename U>
7623 bool ArrayEq(const T* lhs, size_t size, const U* rhs);
7624
7625 // This generic version is used when k is 0.
7626 template <typename T, typename U>
7627 inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
7628
7629 // This overload is used when k >= 1.
7630 template <typename T, typename U, size_t N>
7631 inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
7632   return internal::ArrayEq(lhs, N, rhs);
7633 }
7634
7635 // This helper reduces code bloat.  If we instead put its logic inside
7636 // the previous ArrayEq() function, arrays with different sizes would
7637 // lead to different copies of the template code.
7638 template <typename T, typename U>
7639 bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
7640   for (size_t i = 0; i != size; i++) {
7641     if (!internal::ArrayEq(lhs[i], rhs[i]))
7642       return false;
7643   }
7644   return true;
7645 }
7646
7647 // Finds the first element in the iterator range [begin, end) that
7648 // equals elem.  Element may be a native array type itself.
7649 template <typename Iter, typename Element>
7650 Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
7651   for (Iter it = begin; it != end; ++it) {
7652     if (internal::ArrayEq(*it, elem))
7653       return it;
7654   }
7655   return end;
7656 }
7657
7658 // CopyArray() copies a k-dimensional native array using the elements'
7659 // operator=, where k can be any integer >= 0.  When k is 0,
7660 // CopyArray() degenerates into copying a single value.
7661
7662 template <typename T, typename U>
7663 void CopyArray(const T* from, size_t size, U* to);
7664
7665 // This generic version is used when k is 0.
7666 template <typename T, typename U>
7667 inline void CopyArray(const T& from, U* to) { *to = from; }
7668
7669 // This overload is used when k >= 1.
7670 template <typename T, typename U, size_t N>
7671 inline void CopyArray(const T(&from)[N], U(*to)[N]) {
7672   internal::CopyArray(from, N, *to);
7673 }
7674
7675 // This helper reduces code bloat.  If we instead put its logic inside
7676 // the previous CopyArray() function, arrays with different sizes
7677 // would lead to different copies of the template code.
7678 template <typename T, typename U>
7679 void CopyArray(const T* from, size_t size, U* to) {
7680   for (size_t i = 0; i != size; i++) {
7681     internal::CopyArray(from[i], to + i);
7682   }
7683 }
7684
7685 // The relation between an NativeArray object (see below) and the
7686 // native array it represents.
7687 enum RelationToSource {
7688   kReference,  // The NativeArray references the native array.
7689   kCopy        // The NativeArray makes a copy of the native array and
7690                // owns the copy.
7691 };
7692
7693 // Adapts a native array to a read-only STL-style container.  Instead
7694 // of the complete STL container concept, this adaptor only implements
7695 // members useful for Google Mock's container matchers.  New members
7696 // should be added as needed.  To simplify the implementation, we only
7697 // support Element being a raw type (i.e. having no top-level const or
7698 // reference modifier).  It's the client's responsibility to satisfy
7699 // this requirement.  Element can be an array type itself (hence
7700 // multi-dimensional arrays are supported).
7701 template <typename Element>
7702 class NativeArray {
7703  public:
7704   // STL-style container typedefs.
7705   typedef Element value_type;
7706   typedef Element* iterator;
7707   typedef const Element* const_iterator;
7708
7709   // Constructs from a native array.
7710   NativeArray(const Element* array, size_t count, RelationToSource relation) {
7711     Init(array, count, relation);
7712   }
7713
7714   // Copy constructor.
7715   NativeArray(const NativeArray& rhs) {
7716     Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
7717   }
7718
7719   ~NativeArray() {
7720     // Ensures that the user doesn't instantiate NativeArray with a
7721     // const or reference type.
7722     static_cast<void>(StaticAssertTypeEqHelper<Element,
7723         GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
7724     if (relation_to_source_ == kCopy)
7725       delete[] array_;
7726   }
7727
7728   // STL-style container methods.
7729   size_t size() const { return size_; }
7730   const_iterator begin() const { return array_; }
7731   const_iterator end() const { return array_ + size_; }
7732   bool operator==(const NativeArray& rhs) const {
7733     return size() == rhs.size() &&
7734         ArrayEq(begin(), size(), rhs.begin());
7735   }
7736
7737  private:
7738   // Initializes this object; makes a copy of the input array if
7739   // 'relation' is kCopy.
7740   void Init(const Element* array, size_t a_size, RelationToSource relation) {
7741     if (relation == kReference) {
7742       array_ = array;
7743     } else {
7744       Element* const copy = new Element[a_size];
7745       CopyArray(array, a_size, copy);
7746       array_ = copy;
7747     }
7748     size_ = a_size;
7749     relation_to_source_ = relation;
7750   }
7751
7752   const Element* array_;
7753   size_t size_;
7754   RelationToSource relation_to_source_;
7755
7756   GTEST_DISALLOW_ASSIGN_(NativeArray);
7757 };
7758
7759 }  // namespace internal
7760 }  // namespace testing
7761
7762 #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
7763   ::testing::internal::AssertHelper(result_type, file, line, message) \
7764     = ::testing::Message()
7765
7766 #define GTEST_MESSAGE_(message, result_type) \
7767   GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
7768
7769 #define GTEST_FATAL_FAILURE_(message) \
7770   return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
7771
7772 #define GTEST_NONFATAL_FAILURE_(message) \
7773   GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
7774
7775 #define GTEST_SUCCESS_(message) \
7776   GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
7777
7778 // Suppresses MSVC warnings 4072 (unreachable code) for the code following
7779 // statement if it returns or throws (or doesn't return or throw in some
7780 // situations).
7781 #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
7782   if (::testing::internal::AlwaysTrue()) { statement; }
7783
7784 #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
7785   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7786   if (::testing::internal::ConstCharPtr gtest_msg = "") { \
7787     bool gtest_caught_expected = false; \
7788     try { \
7789       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7790     } \
7791     catch (expected_exception const&) { \
7792       gtest_caught_expected = true; \
7793     } \
7794     catch (...) { \
7795       gtest_msg.value = \
7796           "Expected: " #statement " throws an exception of type " \
7797           #expected_exception ".\n  Actual: it throws a different type."; \
7798       goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
7799     } \
7800     if (!gtest_caught_expected) { \
7801       gtest_msg.value = \
7802           "Expected: " #statement " throws an exception of type " \
7803           #expected_exception ".\n  Actual: it throws nothing."; \
7804       goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
7805     } \
7806   } else \
7807     GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
7808       fail(gtest_msg.value)
7809
7810 #define GTEST_TEST_NO_THROW_(statement, fail) \
7811   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7812   if (::testing::internal::AlwaysTrue()) { \
7813     try { \
7814       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7815     } \
7816     catch (...) { \
7817       goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
7818     } \
7819   } else \
7820     GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
7821       fail("Expected: " #statement " doesn't throw an exception.\n" \
7822            "  Actual: it throws.")
7823
7824 #define GTEST_TEST_ANY_THROW_(statement, fail) \
7825   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7826   if (::testing::internal::AlwaysTrue()) { \
7827     bool gtest_caught_any = false; \
7828     try { \
7829       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7830     } \
7831     catch (...) { \
7832       gtest_caught_any = true; \
7833     } \
7834     if (!gtest_caught_any) { \
7835       goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
7836     } \
7837   } else \
7838     GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
7839       fail("Expected: " #statement " throws an exception.\n" \
7840            "  Actual: it doesn't.")
7841
7842
7843 // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
7844 // either a boolean expression or an AssertionResult. text is a textual
7845 // represenation of expression as it was passed into the EXPECT_TRUE.
7846 #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
7847   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7848   if (const ::testing::AssertionResult gtest_ar_ = \
7849       ::testing::AssertionResult(expression)) \
7850     ; \
7851   else \
7852     fail(::testing::internal::GetBoolAssertionFailureMessage(\
7853         gtest_ar_, text, #actual, #expected).c_str())
7854
7855 #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
7856   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
7857   if (::testing::internal::AlwaysTrue()) { \
7858     ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
7859     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
7860     if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
7861       goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
7862     } \
7863   } else \
7864     GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
7865       fail("Expected: " #statement " doesn't generate new fatal " \
7866            "failures in the current thread.\n" \
7867            "  Actual: it does.")
7868
7869 // Expands to the name of the class that implements the given test.
7870 #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
7871   test_case_name##_##test_name##_Test
7872
7873 // Helper macro for defining tests.
7874 #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
7875 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
7876  public:\
7877   GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
7878  private:\
7879   virtual void TestBody();\
7880   static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
7881   GTEST_DISALLOW_COPY_AND_ASSIGN_(\
7882       GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
7883 };\
7884 \
7885 ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
7886   ::test_info_ =\
7887     ::testing::internal::MakeAndRegisterTestInfo(\
7888         #test_case_name, #test_name, NULL, NULL, \
7889         (parent_id), \
7890         parent_class::SetUpTestCase, \
7891         parent_class::TearDownTestCase, \
7892         new ::testing::internal::TestFactoryImpl<\
7893             GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
7894 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
7895
7896 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
7897 // Copyright 2005, Google Inc.
7898 // All rights reserved.
7899 //
7900 // Redistribution and use in source and binary forms, with or without
7901 // modification, are permitted provided that the following conditions are
7902 // met:
7903 //
7904 //     * Redistributions of source code must retain the above copyright
7905 // notice, this list of conditions and the following disclaimer.
7906 //     * Redistributions in binary form must reproduce the above
7907 // copyright notice, this list of conditions and the following disclaimer
7908 // in the documentation and/or other materials provided with the
7909 // distribution.
7910 //     * Neither the name of Google Inc. nor the names of its
7911 // contributors may be used to endorse or promote products derived from
7912 // this software without specific prior written permission.
7913 //
7914 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7915 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7916 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7917 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7918 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
7919 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
7920 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7921 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
7922 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7923 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7924 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7925 //
7926 // Author: wan@google.com (Zhanyong Wan)
7927 //
7928 // The Google C++ Testing Framework (Google Test)
7929 //
7930 // This header file defines the public API for death tests.  It is
7931 // #included by gtest.h so a user doesn't need to include this
7932 // directly.
7933
7934 #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
7935 #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
7936
7937 // Copyright 2005, Google Inc.
7938 // All rights reserved.
7939 //
7940 // Redistribution and use in source and binary forms, with or without
7941 // modification, are permitted provided that the following conditions are
7942 // met:
7943 //
7944 //     * Redistributions of source code must retain the above copyright
7945 // notice, this list of conditions and the following disclaimer.
7946 //     * Redistributions in binary form must reproduce the above
7947 // copyright notice, this list of conditions and the following disclaimer
7948 // in the documentation and/or other materials provided with the
7949 // distribution.
7950 //     * Neither the name of Google Inc. nor the names of its
7951 // contributors may be used to endorse or promote products derived from
7952 // this software without specific prior written permission.
7953 //
7954 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
7955 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7956 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7957 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7958 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
7959 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
7960 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
7961 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
7962 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
7963 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7964 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7965 //
7966 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
7967 //
7968 // The Google C++ Testing Framework (Google Test)
7969 //
7970 // This header file defines internal utilities needed for implementing
7971 // death tests.  They are subject to change without notice.
7972
7973 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
7974 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
7975
7976
7977 #include <stdio.h>
7978
7979 namespace testing {
7980 namespace internal {
7981
7982 GTEST_DECLARE_string_(internal_run_death_test);
7983
7984 // Names of the flags (needed for parsing Google Test flags).
7985 const char kDeathTestStyleFlag[] = "death_test_style";
7986 const char kDeathTestUseFork[] = "death_test_use_fork";
7987 const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
7988
7989 #if GTEST_HAS_DEATH_TEST
7990
7991 // DeathTest is a class that hides much of the complexity of the
7992 // GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method
7993 // returns a concrete class that depends on the prevailing death test
7994 // style, as defined by the --gtest_death_test_style and/or
7995 // --gtest_internal_run_death_test flags.
7996
7997 // In describing the results of death tests, these terms are used with
7998 // the corresponding definitions:
7999 //
8000 // exit status:  The integer exit information in the format specified
8001 //               by wait(2)
8002 // exit code:    The integer code passed to exit(3), _exit(2), or
8003 //               returned from main()
8004 class GTEST_API_ DeathTest {
8005  public:
8006   // Create returns false if there was an error determining the
8007   // appropriate action to take for the current death test; for example,
8008   // if the gtest_death_test_style flag is set to an invalid value.
8009   // The LastMessage method will return a more detailed message in that
8010   // case.  Otherwise, the DeathTest pointer pointed to by the "test"
8011   // argument is set.  If the death test should be skipped, the pointer
8012   // is set to NULL; otherwise, it is set to the address of a new concrete
8013   // DeathTest object that controls the execution of the current test.
8014   static bool Create(const char* statement, const RE* regex,
8015                      const char* file, int line, DeathTest** test);
8016   DeathTest();
8017   virtual ~DeathTest() { }
8018
8019   // A helper class that aborts a death test when it's deleted.
8020   class ReturnSentinel {
8021    public:
8022     explicit ReturnSentinel(DeathTest* test) : test_(test) { }
8023     ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
8024    private:
8025     DeathTest* const test_;
8026     GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
8027   } GTEST_ATTRIBUTE_UNUSED_;
8028
8029   // An enumeration of possible roles that may be taken when a death
8030   // test is encountered.  EXECUTE means that the death test logic should
8031   // be executed immediately.  OVERSEE means that the program should prepare
8032   // the appropriate environment for a child process to execute the death
8033   // test, then wait for it to complete.
8034   enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
8035
8036   // An enumeration of the three reasons that a test might be aborted.
8037   enum AbortReason {
8038     TEST_ENCOUNTERED_RETURN_STATEMENT,
8039     TEST_THREW_EXCEPTION,
8040     TEST_DID_NOT_DIE
8041   };
8042
8043   // Assumes one of the above roles.
8044   virtual TestRole AssumeRole() = 0;
8045
8046   // Waits for the death test to finish and returns its status.
8047   virtual int Wait() = 0;
8048
8049   // Returns true if the death test passed; that is, the test process
8050   // exited during the test, its exit status matches a user-supplied
8051   // predicate, and its stderr output matches a user-supplied regular
8052   // expression.
8053   // The user-supplied predicate may be a macro expression rather
8054   // than a function pointer or functor, or else Wait and Passed could
8055   // be combined.
8056   virtual bool Passed(bool exit_status_ok) = 0;
8057
8058   // Signals that the death test did not die as expected.
8059   virtual void Abort(AbortReason reason) = 0;
8060
8061   // Returns a human-readable outcome message regarding the outcome of
8062   // the last death test.
8063   static const char* LastMessage();
8064
8065   static void set_last_death_test_message(const std::string& message);
8066
8067  private:
8068   // A string containing a description of the outcome of the last death test.
8069   static std::string last_death_test_message_;
8070
8071   GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
8072 };
8073
8074 // Factory interface for death tests.  May be mocked out for testing.
8075 class DeathTestFactory {
8076  public:
8077   virtual ~DeathTestFactory() { }
8078   virtual bool Create(const char* statement, const RE* regex,
8079                       const char* file, int line, DeathTest** test) = 0;
8080 };
8081
8082 // A concrete DeathTestFactory implementation for normal use.
8083 class DefaultDeathTestFactory : public DeathTestFactory {
8084  public:
8085   virtual bool Create(const char* statement, const RE* regex,
8086                       const char* file, int line, DeathTest** test);
8087 };
8088
8089 // Returns true if exit_status describes a process that was terminated
8090 // by a signal, or exited normally with a nonzero exit code.
8091 GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
8092
8093 // Traps C++ exceptions escaping statement and reports them as test
8094 // failures. Note that trapping SEH exceptions is not implemented here.
8095 # if GTEST_HAS_EXCEPTIONS
8096 #  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
8097   try { \
8098     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8099   } catch (const ::std::exception& gtest_exception) { \
8100     fprintf(\
8101         stderr, \
8102         "\n%s: Caught std::exception-derived exception escaping the " \
8103         "death test statement. Exception message: %s\n", \
8104         ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
8105         gtest_exception.what()); \
8106     fflush(stderr); \
8107     death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
8108   } catch (...) { \
8109     death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
8110   }
8111
8112 # else
8113 #  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
8114   GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
8115
8116 # endif
8117
8118 // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
8119 // ASSERT_EXIT*, and EXPECT_EXIT*.
8120 # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
8121   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8122   if (::testing::internal::AlwaysTrue()) { \
8123     const ::testing::internal::RE& gtest_regex = (regex); \
8124     ::testing::internal::DeathTest* gtest_dt; \
8125     if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
8126         __FILE__, __LINE__, &gtest_dt)) { \
8127       goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
8128     } \
8129     if (gtest_dt != NULL) { \
8130       ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
8131           gtest_dt_ptr(gtest_dt); \
8132       switch (gtest_dt->AssumeRole()) { \
8133         case ::testing::internal::DeathTest::OVERSEE_TEST: \
8134           if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
8135             goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
8136           } \
8137           break; \
8138         case ::testing::internal::DeathTest::EXECUTE_TEST: { \
8139           ::testing::internal::DeathTest::ReturnSentinel \
8140               gtest_sentinel(gtest_dt); \
8141           GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
8142           gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
8143           break; \
8144         } \
8145         default: \
8146           break; \
8147       } \
8148     } \
8149   } else \
8150     GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
8151       fail(::testing::internal::DeathTest::LastMessage())
8152 // The symbol "fail" here expands to something into which a message
8153 // can be streamed.
8154
8155 // This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
8156 // NDEBUG mode. In this case we need the statements to be executed, the regex is
8157 // ignored, and the macro must accept a streamed message even though the message
8158 // is never printed.
8159 # define GTEST_EXECUTE_STATEMENT_(statement, regex) \
8160   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8161   if (::testing::internal::AlwaysTrue()) { \
8162      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8163   } else \
8164     ::testing::Message()
8165
8166 // A class representing the parsed contents of the
8167 // --gtest_internal_run_death_test flag, as it existed when
8168 // RUN_ALL_TESTS was called.
8169 class InternalRunDeathTestFlag {
8170  public:
8171   InternalRunDeathTestFlag(const std::string& a_file,
8172                            int a_line,
8173                            int an_index,
8174                            int a_write_fd)
8175       : file_(a_file), line_(a_line), index_(an_index),
8176         write_fd_(a_write_fd) {}
8177
8178   ~InternalRunDeathTestFlag() {
8179     if (write_fd_ >= 0)
8180       posix::Close(write_fd_);
8181   }
8182
8183   const std::string& file() const { return file_; }
8184   int line() const { return line_; }
8185   int index() const { return index_; }
8186   int write_fd() const { return write_fd_; }
8187
8188  private:
8189   std::string file_;
8190   int line_;
8191   int index_;
8192   int write_fd_;
8193
8194   GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
8195 };
8196
8197 // Returns a newly created InternalRunDeathTestFlag object with fields
8198 // initialized from the GTEST_FLAG(internal_run_death_test) flag if
8199 // the flag is specified; otherwise returns NULL.
8200 InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
8201
8202 #else  // GTEST_HAS_DEATH_TEST
8203
8204 // This macro is used for implementing macros such as
8205 // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
8206 // death tests are not supported. Those macros must compile on such systems
8207 // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
8208 // systems that support death tests. This allows one to write such a macro
8209 // on a system that does not support death tests and be sure that it will
8210 // compile on a death-test supporting system.
8211 //
8212 // Parameters:
8213 //   statement -  A statement that a macro such as EXPECT_DEATH would test
8214 //                for program termination. This macro has to make sure this
8215 //                statement is compiled but not executed, to ensure that
8216 //                EXPECT_DEATH_IF_SUPPORTED compiles with a certain
8217 //                parameter iff EXPECT_DEATH compiles with it.
8218 //   regex     -  A regex that a macro such as EXPECT_DEATH would use to test
8219 //                the output of statement.  This parameter has to be
8220 //                compiled but not evaluated by this macro, to ensure that
8221 //                this macro only accepts expressions that a macro such as
8222 //                EXPECT_DEATH would accept.
8223 //   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
8224 //                and a return statement for ASSERT_DEATH_IF_SUPPORTED.
8225 //                This ensures that ASSERT_DEATH_IF_SUPPORTED will not
8226 //                compile inside functions where ASSERT_DEATH doesn't
8227 //                compile.
8228 //
8229 //  The branch that has an always false condition is used to ensure that
8230 //  statement and regex are compiled (and thus syntactically correct) but
8231 //  never executed. The unreachable code macro protects the terminator
8232 //  statement from generating an 'unreachable code' warning in case
8233 //  statement unconditionally returns or throws. The Message constructor at
8234 //  the end allows the syntax of streaming additional messages into the
8235 //  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
8236 # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
8237     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
8238     if (::testing::internal::AlwaysTrue()) { \
8239       GTEST_LOG_(WARNING) \
8240           << "Death tests are not supported on this platform.\n" \
8241           << "Statement '" #statement "' cannot be verified."; \
8242     } else if (::testing::internal::AlwaysFalse()) { \
8243       ::testing::internal::RE::PartialMatch(".*", (regex)); \
8244       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
8245       terminator; \
8246     } else \
8247       ::testing::Message()
8248
8249 #endif  // GTEST_HAS_DEATH_TEST
8250
8251 }  // namespace internal
8252 }  // namespace testing
8253
8254 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
8255
8256 namespace testing {
8257
8258 // This flag controls the style of death tests.  Valid values are "threadsafe",
8259 // meaning that the death test child process will re-execute the test binary
8260 // from the start, running only a single death test, or "fast",
8261 // meaning that the child process will execute the test logic immediately
8262 // after forking.
8263 GTEST_DECLARE_string_(death_test_style);
8264
8265 #if GTEST_HAS_DEATH_TEST
8266
8267 namespace internal {
8268
8269 // Returns a Boolean value indicating whether the caller is currently
8270 // executing in the context of the death test child process.  Tools such as
8271 // Valgrind heap checkers may need this to modify their behavior in death
8272 // tests.  IMPORTANT: This is an internal utility.  Using it may break the
8273 // implementation of death tests.  User code MUST NOT use it.
8274 GTEST_API_ bool InDeathTestChild();
8275
8276 }  // namespace internal
8277
8278 // The following macros are useful for writing death tests.
8279
8280 // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
8281 // executed:
8282 //
8283 //   1. It generates a warning if there is more than one active
8284 //   thread.  This is because it's safe to fork() or clone() only
8285 //   when there is a single thread.
8286 //
8287 //   2. The parent process clone()s a sub-process and runs the death
8288 //   test in it; the sub-process exits with code 0 at the end of the
8289 //   death test, if it hasn't exited already.
8290 //
8291 //   3. The parent process waits for the sub-process to terminate.
8292 //
8293 //   4. The parent process checks the exit code and error message of
8294 //   the sub-process.
8295 //
8296 // Examples:
8297 //
8298 //   ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
8299 //   for (int i = 0; i < 5; i++) {
8300 //     EXPECT_DEATH(server.ProcessRequest(i),
8301 //                  "Invalid request .* in ProcessRequest()")
8302 //                  << "Failed to die on request " << i;
8303 //   }
8304 //
8305 //   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
8306 //
8307 //   bool KilledBySIGHUP(int exit_code) {
8308 //     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
8309 //   }
8310 //
8311 //   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
8312 //
8313 // On the regular expressions used in death tests:
8314 //
8315 //   On POSIX-compliant systems (*nix), we use the <regex.h> library,
8316 //   which uses the POSIX extended regex syntax.
8317 //
8318 //   On other platforms (e.g. Windows), we only support a simple regex
8319 //   syntax implemented as part of Google Test.  This limited
8320 //   implementation should be enough most of the time when writing
8321 //   death tests; though it lacks many features you can find in PCRE
8322 //   or POSIX extended regex syntax.  For example, we don't support
8323 //   union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
8324 //   repetition count ("x{5,7}"), among others.
8325 //
8326 //   Below is the syntax that we do support.  We chose it to be a
8327 //   subset of both PCRE and POSIX extended regex, so it's easy to
8328 //   learn wherever you come from.  In the following: 'A' denotes a
8329 //   literal character, period (.), or a single \\ escape sequence;
8330 //   'x' and 'y' denote regular expressions; 'm' and 'n' are for
8331 //   natural numbers.
8332 //
8333 //     c     matches any literal character c
8334 //     \\d   matches any decimal digit
8335 //     \\D   matches any character that's not a decimal digit
8336 //     \\f   matches \f
8337 //     \\n   matches \n
8338 //     \\r   matches \r
8339 //     \\s   matches any ASCII whitespace, including \n
8340 //     \\S   matches any character that's not a whitespace
8341 //     \\t   matches \t
8342 //     \\v   matches \v
8343 //     \\w   matches any letter, _, or decimal digit
8344 //     \\W   matches any character that \\w doesn't match
8345 //     \\c   matches any literal character c, which must be a punctuation
8346 //     .     matches any single character except \n
8347 //     A?    matches 0 or 1 occurrences of A
8348 //     A*    matches 0 or many occurrences of A
8349 //     A+    matches 1 or many occurrences of A
8350 //     ^     matches the beginning of a string (not that of each line)
8351 //     $     matches the end of a string (not that of each line)
8352 //     xy    matches x followed by y
8353 //
8354 //   If you accidentally use PCRE or POSIX extended regex features
8355 //   not implemented by us, you will get a run-time failure.  In that
8356 //   case, please try to rewrite your regular expression within the
8357 //   above syntax.
8358 //
8359 //   This implementation is *not* meant to be as highly tuned or robust
8360 //   as a compiled regex library, but should perform well enough for a
8361 //   death test, which already incurs significant overhead by launching
8362 //   a child process.
8363 //
8364 // Known caveats:
8365 //
8366 //   A "threadsafe" style death test obtains the path to the test
8367 //   program from argv[0] and re-executes it in the sub-process.  For
8368 //   simplicity, the current implementation doesn't search the PATH
8369 //   when launching the sub-process.  This means that the user must
8370 //   invoke the test program via a path that contains at least one
8371 //   path separator (e.g. path/to/foo_test and
8372 //   /absolute/path/to/bar_test are fine, but foo_test is not).  This
8373 //   is rarely a problem as people usually don't put the test binary
8374 //   directory in PATH.
8375 //
8376 // TODO(wan@google.com): make thread-safe death tests search the PATH.
8377
8378 // Asserts that a given statement causes the program to exit, with an
8379 // integer exit status that satisfies predicate, and emitting error output
8380 // that matches regex.
8381 # define ASSERT_EXIT(statement, predicate, regex) \
8382     GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
8383
8384 // Like ASSERT_EXIT, but continues on to successive tests in the
8385 // test case, if any:
8386 # define EXPECT_EXIT(statement, predicate, regex) \
8387     GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
8388
8389 // Asserts that a given statement causes the program to exit, either by
8390 // explicitly exiting with a nonzero exit code or being killed by a
8391 // signal, and emitting error output that matches regex.
8392 # define ASSERT_DEATH(statement, regex) \
8393     ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
8394
8395 // Like ASSERT_DEATH, but continues on to successive tests in the
8396 // test case, if any:
8397 # define EXPECT_DEATH(statement, regex) \
8398     EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
8399
8400 // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
8401
8402 // Tests that an exit code describes a normal exit with a given exit code.
8403 class GTEST_API_ ExitedWithCode {
8404  public:
8405   explicit ExitedWithCode(int exit_code);
8406   bool operator()(int exit_status) const;
8407  private:
8408   // No implementation - assignment is unsupported.
8409   void operator=(const ExitedWithCode& other);
8410
8411   const int exit_code_;
8412 };
8413
8414 # if !GTEST_OS_WINDOWS
8415 // Tests that an exit code describes an exit due to termination by a
8416 // given signal.
8417 class GTEST_API_ KilledBySignal {
8418  public:
8419   explicit KilledBySignal(int signum);
8420   bool operator()(int exit_status) const;
8421  private:
8422   const int signum_;
8423 };
8424 # endif  // !GTEST_OS_WINDOWS
8425
8426 // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
8427 // The death testing framework causes this to have interesting semantics,
8428 // since the sideeffects of the call are only visible in opt mode, and not
8429 // in debug mode.
8430 //
8431 // In practice, this can be used to test functions that utilize the
8432 // LOG(DFATAL) macro using the following style:
8433 //
8434 // int DieInDebugOr12(int* sideeffect) {
8435 //   if (sideeffect) {
8436 //     *sideeffect = 12;
8437 //   }
8438 //   LOG(DFATAL) << "death";
8439 //   return 12;
8440 // }
8441 //
8442 // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
8443 //   int sideeffect = 0;
8444 //   // Only asserts in dbg.
8445 //   EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
8446 //
8447 // #ifdef NDEBUG
8448 //   // opt-mode has sideeffect visible.
8449 //   EXPECT_EQ(12, sideeffect);
8450 // #else
8451 //   // dbg-mode no visible sideeffect.
8452 //   EXPECT_EQ(0, sideeffect);
8453 // #endif
8454 // }
8455 //
8456 // This will assert that DieInDebugReturn12InOpt() crashes in debug
8457 // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
8458 // appropriate fallback value (12 in this case) in opt mode. If you
8459 // need to test that a function has appropriate side-effects in opt
8460 // mode, include assertions against the side-effects.  A general
8461 // pattern for this is:
8462 //
8463 // EXPECT_DEBUG_DEATH({
8464 //   // Side-effects here will have an effect after this statement in
8465 //   // opt mode, but none in debug mode.
8466 //   EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
8467 // }, "death");
8468 //
8469 # ifdef NDEBUG
8470
8471 #  define EXPECT_DEBUG_DEATH(statement, regex) \
8472   GTEST_EXECUTE_STATEMENT_(statement, regex)
8473
8474 #  define ASSERT_DEBUG_DEATH(statement, regex) \
8475   GTEST_EXECUTE_STATEMENT_(statement, regex)
8476
8477 # else
8478
8479 #  define EXPECT_DEBUG_DEATH(statement, regex) \
8480   EXPECT_DEATH(statement, regex)
8481
8482 #  define ASSERT_DEBUG_DEATH(statement, regex) \
8483   ASSERT_DEATH(statement, regex)
8484
8485 # endif  // NDEBUG for EXPECT_DEBUG_DEATH
8486 #endif  // GTEST_HAS_DEATH_TEST
8487
8488 // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
8489 // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
8490 // death tests are supported; otherwise they just issue a warning.  This is
8491 // useful when you are combining death test assertions with normal test
8492 // assertions in one test.
8493 #if GTEST_HAS_DEATH_TEST
8494 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
8495     EXPECT_DEATH(statement, regex)
8496 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
8497     ASSERT_DEATH(statement, regex)
8498 #else
8499 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
8500     GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
8501 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
8502     GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
8503 #endif
8504
8505 }  // namespace testing
8506
8507 #endif  // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
8508 // Copyright 2005, Google Inc.
8509 // All rights reserved.
8510 //
8511 // Redistribution and use in source and binary forms, with or without
8512 // modification, are permitted provided that the following conditions are
8513 // met:
8514 //
8515 //     * Redistributions of source code must retain the above copyright
8516 // notice, this list of conditions and the following disclaimer.
8517 //     * Redistributions in binary form must reproduce the above
8518 // copyright notice, this list of conditions and the following disclaimer
8519 // in the documentation and/or other materials provided with the
8520 // distribution.
8521 //     * Neither the name of Google Inc. nor the names of its
8522 // contributors may be used to endorse or promote products derived from
8523 // this software without specific prior written permission.
8524 //
8525 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8526 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8527 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8528 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8529 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8530 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8531 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8532 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8533 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8534 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8535 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8536 //
8537 // Author: wan@google.com (Zhanyong Wan)
8538 //
8539 // The Google C++ Testing Framework (Google Test)
8540 //
8541 // This header file defines the Message class.
8542 //
8543 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
8544 // leave some internal implementation details in this header file.
8545 // They are clearly marked by comments like this:
8546 //
8547 //   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
8548 //
8549 // Such code is NOT meant to be used by a user directly, and is subject
8550 // to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
8551 // program!
8552
8553 #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
8554 #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
8555
8556 #include <limits>
8557
8558
8559 namespace testing {
8560
8561 // The Message class works like an ostream repeater.
8562 //
8563 // Typical usage:
8564 //
8565 //   1. You stream a bunch of values to a Message object.
8566 //      It will remember the text in a stringstream.
8567 //   2. Then you stream the Message object to an ostream.
8568 //      This causes the text in the Message to be streamed
8569 //      to the ostream.
8570 //
8571 // For example;
8572 //
8573 //   testing::Message foo;
8574 //   foo << 1 << " != " << 2;
8575 //   std::cout << foo;
8576 //
8577 // will print "1 != 2".
8578 //
8579 // Message is not intended to be inherited from.  In particular, its
8580 // destructor is not virtual.
8581 //
8582 // Note that stringstream behaves differently in gcc and in MSVC.  You
8583 // can stream a NULL char pointer to it in the former, but not in the
8584 // latter (it causes an access violation if you do).  The Message
8585 // class hides this difference by treating a NULL char pointer as
8586 // "(null)".
8587 class GTEST_API_ Message {
8588  private:
8589   // The type of basic IO manipulators (endl, ends, and flush) for
8590   // narrow streams.
8591   typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
8592
8593  public:
8594   // Constructs an empty Message.
8595   // We allocate the stringstream separately because otherwise each use of
8596   // ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
8597   // stack frame leading to huge stack frames in some cases; gcc does not reuse
8598   // the stack space.
8599   Message() : ss_(new ::std::stringstream) {
8600     // By default, we want there to be enough precision when printing
8601     // a double to a Message.
8602     *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
8603   }
8604
8605   // Copy constructor.
8606   Message(const Message& msg) : ss_(new ::std::stringstream) {  // NOLINT
8607     *ss_ << msg.GetString();
8608   }
8609
8610   // Constructs a Message from a C-string.
8611   explicit Message(const char* str) : ss_(new ::std::stringstream) {
8612     *ss_ << str;
8613   }
8614
8615 #if GTEST_OS_SYMBIAN
8616   // Streams a value (either a pointer or not) to this object.
8617   template <typename T>
8618   inline Message& operator <<(const T& value) {
8619     StreamHelper(typename internal::is_pointer<T>::type(), value);
8620     return *this;
8621   }
8622 #else
8623   // Streams a non-pointer value to this object.
8624   template <typename T>
8625   inline Message& operator <<(const T& val) {
8626     ::GTestStreamToHelper(ss_.get(), val);
8627     return *this;
8628   }
8629
8630   // Streams a pointer value to this object.
8631   //
8632   // This function is an overload of the previous one.  When you
8633   // stream a pointer to a Message, this definition will be used as it
8634   // is more specialized.  (The C++ Standard, section
8635   // [temp.func.order].)  If you stream a non-pointer, then the
8636   // previous definition will be used.
8637   //
8638   // The reason for this overload is that streaming a NULL pointer to
8639   // ostream is undefined behavior.  Depending on the compiler, you
8640   // may get "0", "(nil)", "(null)", or an access violation.  To
8641   // ensure consistent result across compilers, we always treat NULL
8642   // as "(null)".
8643   template <typename T>
8644   inline Message& operator <<(T* const& pointer) {  // NOLINT
8645     if (pointer == NULL) {
8646       *ss_ << "(null)";
8647     } else {
8648       ::GTestStreamToHelper(ss_.get(), pointer);
8649     }
8650     return *this;
8651   }
8652 #endif  // GTEST_OS_SYMBIAN
8653
8654   // Since the basic IO manipulators are overloaded for both narrow
8655   // and wide streams, we have to provide this specialized definition
8656   // of operator <<, even though its body is the same as the
8657   // templatized version above.  Without this definition, streaming
8658   // endl or other basic IO manipulators to Message will confuse the
8659   // compiler.
8660   Message& operator <<(BasicNarrowIoManip val) {
8661     *ss_ << val;
8662     return *this;
8663   }
8664
8665   // Instead of 1/0, we want to see true/false for bool values.
8666   Message& operator <<(bool b) {
8667     return *this << (b ? "true" : "false");
8668   }
8669
8670   // These two overloads allow streaming a wide C string to a Message
8671   // using the UTF-8 encoding.
8672   Message& operator <<(const wchar_t* wide_c_str) {
8673     return *this << internal::String::ShowWideCString(wide_c_str);
8674   }
8675   Message& operator <<(wchar_t* wide_c_str) {
8676     return *this << internal::String::ShowWideCString(wide_c_str);
8677   }
8678
8679 #if GTEST_HAS_STD_WSTRING
8680   // Converts the given wide string to a narrow string using the UTF-8
8681   // encoding, and streams the result to this Message object.
8682   Message& operator <<(const ::std::wstring& wstr);
8683 #endif  // GTEST_HAS_STD_WSTRING
8684
8685 #if GTEST_HAS_GLOBAL_WSTRING
8686   // Converts the given wide string to a narrow string using the UTF-8
8687   // encoding, and streams the result to this Message object.
8688   Message& operator <<(const ::wstring& wstr);
8689 #endif  // GTEST_HAS_GLOBAL_WSTRING
8690
8691   // Gets the text streamed to this object so far as an std::string.
8692   // Each '\0' character in the buffer is replaced with "\\0".
8693   //
8694   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
8695   std::string GetString() const {
8696     return internal::StringStreamToString(ss_.get());
8697   }
8698
8699  private:
8700
8701 #if GTEST_OS_SYMBIAN
8702   // These are needed as the Nokia Symbian Compiler cannot decide between
8703   // const T& and const T* in a function template. The Nokia compiler _can_
8704   // decide between class template specializations for T and T*, so a
8705   // tr1::type_traits-like is_pointer works, and we can overload on that.
8706   template <typename T>
8707   inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) {
8708     if (pointer == NULL) {
8709       *ss_ << "(null)";
8710     } else {
8711       ::GTestStreamToHelper(ss_.get(), pointer);
8712     }
8713   }
8714   template <typename T>
8715   inline void StreamHelper(internal::false_type /*dummy*/, const T& value) {
8716     ::GTestStreamToHelper(ss_.get(), value);
8717   }
8718 #endif  // GTEST_OS_SYMBIAN
8719
8720   // We'll hold the text streamed to this object here.
8721   const internal::scoped_ptr< ::std::stringstream> ss_;
8722
8723   // We declare (but don't implement) this to prevent the compiler
8724   // from implementing the assignment operator.
8725   void operator=(const Message&);
8726 };
8727
8728 // Streams a Message to an ostream.
8729 inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
8730   return os << sb.GetString();
8731 }
8732
8733 }  // namespace testing
8734
8735 #endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
8736 // This file was GENERATED by command:
8737 //     pump.py gtest-param-test.h.pump
8738 // DO NOT EDIT BY HAND!!!
8739
8740 // Copyright 2008, Google Inc.
8741 // All rights reserved.
8742 //
8743 // Redistribution and use in source and binary forms, with or without
8744 // modification, are permitted provided that the following conditions are
8745 // met:
8746 //
8747 //     * Redistributions of source code must retain the above copyright
8748 // notice, this list of conditions and the following disclaimer.
8749 //     * Redistributions in binary form must reproduce the above
8750 // copyright notice, this list of conditions and the following disclaimer
8751 // in the documentation and/or other materials provided with the
8752 // distribution.
8753 //     * Neither the name of Google Inc. nor the names of its
8754 // contributors may be used to endorse or promote products derived from
8755 // this software without specific prior written permission.
8756 //
8757 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8758 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8759 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8760 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8761 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8762 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8763 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8764 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8765 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8766 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8767 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8768 //
8769 // Authors: vladl@google.com (Vlad Losev)
8770 //
8771 // Macros and functions for implementing parameterized tests
8772 // in Google C++ Testing Framework (Google Test)
8773 //
8774 // This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
8775 //
8776 #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8777 #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
8778
8779
8780 // Value-parameterized tests allow you to test your code with different
8781 // parameters without writing multiple copies of the same test.
8782 //
8783 // Here is how you use value-parameterized tests:
8784
8785 #if 0
8786
8787 // To write value-parameterized tests, first you should define a fixture
8788 // class. It is usually derived from testing::TestWithParam<T> (see below for
8789 // another inheritance scheme that's sometimes useful in more complicated
8790 // class hierarchies), where the type of your parameter values.
8791 // TestWithParam<T> is itself derived from testing::Test. T can be any
8792 // copyable type. If it's a raw pointer, you are responsible for managing the
8793 // lifespan of the pointed values.
8794
8795 class FooTest : public ::testing::TestWithParam<const char*> {
8796   // You can implement all the usual class fixture members here.
8797 };
8798
8799 // Then, use the TEST_P macro to define as many parameterized tests
8800 // for this fixture as you want. The _P suffix is for "parameterized"
8801 // or "pattern", whichever you prefer to think.
8802
8803 TEST_P(FooTest, DoesBlah) {
8804   // Inside a test, access the test parameter with the GetParam() method
8805   // of the TestWithParam<T> class:
8806   EXPECT_TRUE(foo.Blah(GetParam()));
8807   ...
8808 }
8809
8810 TEST_P(FooTest, HasBlahBlah) {
8811   ...
8812 }
8813
8814 // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
8815 // case with any set of parameters you want. Google Test defines a number
8816 // of functions for generating test parameters. They return what we call
8817 // (surprise!) parameter generators. Here is a  summary of them, which
8818 // are all in the testing namespace:
8819 //
8820 //
8821 //  Range(begin, end [, step]) - Yields values {begin, begin+step,
8822 //                               begin+step+step, ...}. The values do not
8823 //                               include end. step defaults to 1.
8824 //  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.
8825 //  ValuesIn(container)        - Yields values from a C-style array, an STL
8826 //  ValuesIn(begin,end)          container, or an iterator range [begin, end).
8827 //  Bool()                     - Yields sequence {false, true}.
8828 //  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product
8829 //                               for the math savvy) of the values generated
8830 //                               by the N generators.
8831 //
8832 // For more details, see comments at the definitions of these functions below
8833 // in this file.
8834 //
8835 // The following statement will instantiate tests from the FooTest test case
8836 // each with parameter values "meeny", "miny", and "moe".
8837
8838 INSTANTIATE_TEST_CASE_P(InstantiationName,
8839                         FooTest,
8840                         Values("meeny", "miny", "moe"));
8841
8842 // To distinguish different instances of the pattern, (yes, you
8843 // can instantiate it more then once) the first argument to the
8844 // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
8845 // actual test case name. Remember to pick unique prefixes for different
8846 // instantiations. The tests from the instantiation above will have
8847 // these names:
8848 //
8849 //    * InstantiationName/FooTest.DoesBlah/0 for "meeny"
8850 //    * InstantiationName/FooTest.DoesBlah/1 for "miny"
8851 //    * InstantiationName/FooTest.DoesBlah/2 for "moe"
8852 //    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
8853 //    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
8854 //    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
8855 //
8856 // You can use these names in --gtest_filter.
8857 //
8858 // This statement will instantiate all tests from FooTest again, each
8859 // with parameter values "cat" and "dog":
8860
8861 const char* pets[] = {"cat", "dog"};
8862 INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
8863
8864 // The tests from the instantiation above will have these names:
8865 //
8866 //    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
8867 //    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
8868 //    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
8869 //    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
8870 //
8871 // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
8872 // in the given test case, whether their definitions come before or
8873 // AFTER the INSTANTIATE_TEST_CASE_P statement.
8874 //
8875 // Please also note that generator expressions (including parameters to the
8876 // generators) are evaluated in InitGoogleTest(), after main() has started.
8877 // This allows the user on one hand, to adjust generator parameters in order
8878 // to dynamically determine a set of tests to run and on the other hand,
8879 // give the user a chance to inspect the generated tests with Google Test
8880 // reflection API before RUN_ALL_TESTS() is executed.
8881 //
8882 // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
8883 // for more examples.
8884 //
8885 // In the future, we plan to publish the API for defining new parameter
8886 // generators. But for now this interface remains part of the internal
8887 // implementation and is subject to change.
8888 //
8889 //
8890 // A parameterized test fixture must be derived from testing::Test and from
8891 // testing::WithParamInterface<T>, where T is the type of the parameter
8892 // values. Inheriting from TestWithParam<T> satisfies that requirement because
8893 // TestWithParam<T> inherits from both Test and WithParamInterface. In more
8894 // complicated hierarchies, however, it is occasionally useful to inherit
8895 // separately from Test and WithParamInterface. For example:
8896
8897 class BaseTest : public ::testing::Test {
8898   // You can inherit all the usual members for a non-parameterized test
8899   // fixture here.
8900 };
8901
8902 class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
8903   // The usual test fixture members go here too.
8904 };
8905
8906 TEST_F(BaseTest, HasFoo) {
8907   // This is an ordinary non-parameterized test.
8908 }
8909
8910 TEST_P(DerivedTest, DoesBlah) {
8911   // GetParam works just the same here as if you inherit from TestWithParam.
8912   EXPECT_TRUE(foo.Blah(GetParam()));
8913 }
8914
8915 #endif  // 0
8916
8917
8918 #if !GTEST_OS_SYMBIAN
8919 # include <utility>
8920 #endif
8921
8922 // scripts/fuse_gtest.py depends on gtest's own header being #included
8923 // *unconditionally*.  Therefore these #includes cannot be moved
8924 // inside #if GTEST_HAS_PARAM_TEST.
8925 // Copyright 2008 Google Inc.
8926 // All Rights Reserved.
8927 //
8928 // Redistribution and use in source and binary forms, with or without
8929 // modification, are permitted provided that the following conditions are
8930 // met:
8931 //
8932 //     * Redistributions of source code must retain the above copyright
8933 // notice, this list of conditions and the following disclaimer.
8934 //     * Redistributions in binary form must reproduce the above
8935 // copyright notice, this list of conditions and the following disclaimer
8936 // in the documentation and/or other materials provided with the
8937 // distribution.
8938 //     * Neither the name of Google Inc. nor the names of its
8939 // contributors may be used to endorse or promote products derived from
8940 // this software without specific prior written permission.
8941 //
8942 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8943 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8944 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8945 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8946 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8947 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8948 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8949 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8950 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8951 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8952 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8953 //
8954 // Author: vladl@google.com (Vlad Losev)
8955
8956 // Type and function utilities for implementing parameterized tests.
8957
8958 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
8959 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
8960
8961 #include <iterator>
8962 #include <utility>
8963 #include <vector>
8964
8965 // scripts/fuse_gtest.py depends on gtest's own header being #included
8966 // *unconditionally*.  Therefore these #includes cannot be moved
8967 // inside #if GTEST_HAS_PARAM_TEST.
8968 // Copyright 2003 Google Inc.
8969 // All rights reserved.
8970 //
8971 // Redistribution and use in source and binary forms, with or without
8972 // modification, are permitted provided that the following conditions are
8973 // met:
8974 //
8975 //     * Redistributions of source code must retain the above copyright
8976 // notice, this list of conditions and the following disclaimer.
8977 //     * Redistributions in binary form must reproduce the above
8978 // copyright notice, this list of conditions and the following disclaimer
8979 // in the documentation and/or other materials provided with the
8980 // distribution.
8981 //     * Neither the name of Google Inc. nor the names of its
8982 // contributors may be used to endorse or promote products derived from
8983 // this software without specific prior written permission.
8984 //
8985 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
8986 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
8987 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8988 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8989 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8990 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
8991 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
8992 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
8993 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8994 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
8995 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8996 //
8997 // Authors: Dan Egnor (egnor@google.com)
8998 //
8999 // A "smart" pointer type with reference tracking.  Every pointer to a
9000 // particular object is kept on a circular linked list.  When the last pointer
9001 // to an object is destroyed or reassigned, the object is deleted.
9002 //
9003 // Used properly, this deletes the object when the last reference goes away.
9004 // There are several caveats:
9005 // - Like all reference counting schemes, cycles lead to leaks.
9006 // - Each smart pointer is actually two pointers (8 bytes instead of 4).
9007 // - Every time a pointer is assigned, the entire list of pointers to that
9008 //   object is traversed.  This class is therefore NOT SUITABLE when there
9009 //   will often be more than two or three pointers to a particular object.
9010 // - References are only tracked as long as linked_ptr<> objects are copied.
9011 //   If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
9012 //   will happen (double deletion).
9013 //
9014 // A good use of this class is storing object references in STL containers.
9015 // You can safely put linked_ptr<> in a vector<>.
9016 // Other uses may not be as good.
9017 //
9018 // Note: If you use an incomplete type with linked_ptr<>, the class
9019 // *containing* linked_ptr<> must have a constructor and destructor (even
9020 // if they do nothing!).
9021 //
9022 // Bill Gibbons suggested we use something like this.
9023 //
9024 // Thread Safety:
9025 //   Unlike other linked_ptr implementations, in this implementation
9026 //   a linked_ptr object is thread-safe in the sense that:
9027 //     - it's safe to copy linked_ptr objects concurrently,
9028 //     - it's safe to copy *from* a linked_ptr and read its underlying
9029 //       raw pointer (e.g. via get()) concurrently, and
9030 //     - it's safe to write to two linked_ptrs that point to the same
9031 //       shared object concurrently.
9032 // TODO(wan@google.com): rename this to safe_linked_ptr to avoid
9033 // confusion with normal linked_ptr.
9034
9035 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9036 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9037
9038 #include <stdlib.h>
9039 #include <assert.h>
9040
9041
9042 namespace testing {
9043 namespace internal {
9044
9045 // Protects copying of all linked_ptr objects.
9046 GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
9047
9048 // This is used internally by all instances of linked_ptr<>.  It needs to be
9049 // a non-template class because different types of linked_ptr<> can refer to
9050 // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
9051 // So, it needs to be possible for different types of linked_ptr to participate
9052 // in the same circular linked list, so we need a single class type here.
9053 //
9054 // DO NOT USE THIS CLASS DIRECTLY YOURSELF.  Use linked_ptr<T>.
9055 class linked_ptr_internal {
9056  public:
9057   // Create a new circle that includes only this instance.
9058   void join_new() {
9059     next_ = this;
9060   }
9061
9062   // Many linked_ptr operations may change p.link_ for some linked_ptr
9063   // variable p in the same circle as this object.  Therefore we need
9064   // to prevent two such operations from occurring concurrently.
9065   //
9066   // Note that different types of linked_ptr objects can coexist in a
9067   // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
9068   // linked_ptr<Derived2>).  Therefore we must use a single mutex to
9069   // protect all linked_ptr objects.  This can create serious
9070   // contention in production code, but is acceptable in a testing
9071   // framework.
9072
9073   // Join an existing circle.
9074   void join(linked_ptr_internal const* ptr)
9075       GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
9076     MutexLock lock(&g_linked_ptr_mutex);
9077
9078     linked_ptr_internal const* p = ptr;
9079     while (p->next_ != ptr) p = p->next_;
9080     p->next_ = this;
9081     next_ = ptr;
9082   }
9083
9084   // Leave whatever circle we're part of.  Returns true if we were the
9085   // last member of the circle.  Once this is done, you can join() another.
9086   bool depart()
9087       GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
9088     MutexLock lock(&g_linked_ptr_mutex);
9089
9090     if (next_ == this) return true;
9091     linked_ptr_internal const* p = next_;
9092     while (p->next_ != this) p = p->next_;
9093     p->next_ = next_;
9094     return false;
9095   }
9096
9097  private:
9098   mutable linked_ptr_internal const* next_;
9099 };
9100
9101 template <typename T>
9102 class linked_ptr {
9103  public:
9104   typedef T element_type;
9105
9106   // Take over ownership of a raw pointer.  This should happen as soon as
9107   // possible after the object is created.
9108   explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
9109   ~linked_ptr() { depart(); }
9110
9111   // Copy an existing linked_ptr<>, adding ourselves to the list of references.
9112   template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
9113   linked_ptr(linked_ptr const& ptr) {  // NOLINT
9114     assert(&ptr != this);
9115     copy(&ptr);
9116   }
9117
9118   // Assignment releases the old value and acquires the new.
9119   template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
9120     depart();
9121     copy(&ptr);
9122     return *this;
9123   }
9124
9125   linked_ptr& operator=(linked_ptr const& ptr) {
9126     if (&ptr != this) {
9127       depart();
9128       copy(&ptr);
9129     }
9130     return *this;
9131   }
9132
9133   // Smart pointer members.
9134   void reset(T* ptr = NULL) {
9135     depart();
9136     capture(ptr);
9137   }
9138   T* get() const { return value_; }
9139   T* operator->() const { return value_; }
9140   T& operator*() const { return *value_; }
9141
9142   bool operator==(T* p) const { return value_ == p; }
9143   bool operator!=(T* p) const { return value_ != p; }
9144   template <typename U>
9145   bool operator==(linked_ptr<U> const& ptr) const {
9146     return value_ == ptr.get();
9147   }
9148   template <typename U>
9149   bool operator!=(linked_ptr<U> const& ptr) const {
9150     return value_ != ptr.get();
9151   }
9152
9153  private:
9154   template <typename U>
9155   friend class linked_ptr;
9156
9157   T* value_;
9158   linked_ptr_internal link_;
9159
9160   void depart() {
9161     if (link_.depart()) delete value_;
9162   }
9163
9164   void capture(T* ptr) {
9165     value_ = ptr;
9166     link_.join_new();
9167   }
9168
9169   template <typename U> void copy(linked_ptr<U> const* ptr) {
9170     value_ = ptr->get();
9171     if (value_)
9172       link_.join(&ptr->link_);
9173     else
9174       link_.join_new();
9175   }
9176 };
9177
9178 template<typename T> inline
9179 bool operator==(T* ptr, const linked_ptr<T>& x) {
9180   return ptr == x.get();
9181 }
9182
9183 template<typename T> inline
9184 bool operator!=(T* ptr, const linked_ptr<T>& x) {
9185   return ptr != x.get();
9186 }
9187
9188 // A function to convert T* into linked_ptr<T>
9189 // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
9190 // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
9191 template <typename T>
9192 linked_ptr<T> make_linked_ptr(T* ptr) {
9193   return linked_ptr<T>(ptr);
9194 }
9195
9196 }  // namespace internal
9197 }  // namespace testing
9198
9199 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
9200 // Copyright 2007, Google Inc.
9201 // All rights reserved.
9202 //
9203 // Redistribution and use in source and binary forms, with or without
9204 // modification, are permitted provided that the following conditions are
9205 // met:
9206 //
9207 //     * Redistributions of source code must retain the above copyright
9208 // notice, this list of conditions and the following disclaimer.
9209 //     * Redistributions in binary form must reproduce the above
9210 // copyright notice, this list of conditions and the following disclaimer
9211 // in the documentation and/or other materials provided with the
9212 // distribution.
9213 //     * Neither the name of Google Inc. nor the names of its
9214 // contributors may be used to endorse or promote products derived from
9215 // this software without specific prior written permission.
9216 //
9217 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
9218 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
9219 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
9220 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9221 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9222 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9223 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
9224 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
9225 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9226 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
9227 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9228 //
9229 // Author: wan@google.com (Zhanyong Wan)
9230
9231 // Google Test - The Google C++ Testing Framework
9232 //
9233 // This file implements a universal value printer that can print a
9234 // value of any type T:
9235 //
9236 //   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
9237 //
9238 // A user can teach this function how to print a class type T by
9239 // defining either operator<<() or PrintTo() in the namespace that
9240 // defines T.  More specifically, the FIRST defined function in the
9241 // following list will be used (assuming T is defined in namespace
9242 // foo):
9243 //
9244 //   1. foo::PrintTo(const T&, ostream*)
9245 //   2. operator<<(ostream&, const T&) defined in either foo or the
9246 //      global namespace.
9247 //
9248 // If none of the above is defined, it will print the debug string of
9249 // the value if it is a protocol buffer, or print the raw bytes in the
9250 // value otherwise.
9251 //
9252 // To aid debugging: when T is a reference type, the address of the
9253 // value is also printed; when T is a (const) char pointer, both the
9254 // pointer value and the NUL-terminated string it points to are
9255 // printed.
9256 //
9257 // We also provide some convenient wrappers:
9258 //
9259 //   // Prints a value to a string.  For a (const or not) char
9260 //   // pointer, the NUL-terminated string (but not the pointer) is
9261 //   // printed.
9262 //   std::string ::testing::PrintToString(const T& value);
9263 //
9264 //   // Prints a value tersely: for a reference type, the referenced
9265 //   // value (but not the address) is printed; for a (const or not) char
9266 //   // pointer, the NUL-terminated string (but not the pointer) is
9267 //   // printed.
9268 //   void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
9269 //
9270 //   // Prints value using the type inferred by the compiler.  The difference
9271 //   // from UniversalTersePrint() is that this function prints both the
9272 //   // pointer and the NUL-terminated string for a (const or not) char pointer.
9273 //   void ::testing::internal::UniversalPrint(const T& value, ostream*);
9274 //
9275 //   // Prints the fields of a tuple tersely to a string vector, one
9276 //   // element for each field. Tuple support must be enabled in
9277 //   // gtest-port.h.
9278 //   std::vector<string> UniversalTersePrintTupleFieldsToStrings(
9279 //       const Tuple& value);
9280 //
9281 // Known limitation:
9282 //
9283 // The print primitives print the elements of an STL-style container
9284 // using the compiler-inferred type of *iter where iter is a
9285 // const_iterator of the container.  When const_iterator is an input
9286 // iterator but not a forward iterator, this inferred type may not
9287 // match value_type, and the print output may be incorrect.  In
9288 // practice, this is rarely a problem as for most containers
9289 // const_iterator is a forward iterator.  We'll fix this if there's an
9290 // actual need for it.  Note that this fix cannot rely on value_type
9291 // being defined as many user-defined container types don't have
9292 // value_type.
9293
9294 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9295 #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
9296
9297 #include <ostream>  // NOLINT
9298 #include <sstream>
9299 #include <string>
9300 #include <utility>
9301 #include <vector>
9302
9303 namespace testing {
9304
9305 // Definitions in the 'internal' and 'internal2' name spaces are
9306 // subject to change without notice.  DO NOT USE THEM IN USER CODE!
9307 namespace internal2 {
9308
9309 // Prints the given number of bytes in the given object to the given
9310 // ostream.
9311 GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
9312                                      size_t count,
9313                                      ::std::ostream* os);
9314
9315 // For selecting which printer to use when a given type has neither <<
9316 // nor PrintTo().
9317 enum TypeKind {
9318   kProtobuf,              // a protobuf type
9319   kConvertibleToInteger,  // a type implicitly convertible to BiggestInt
9320                           // (e.g. a named or unnamed enum type)
9321   kOtherType              // anything else
9322 };
9323
9324 // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
9325 // by the universal printer to print a value of type T when neither
9326 // operator<< nor PrintTo() is defined for T, where kTypeKind is the
9327 // "kind" of T as defined by enum TypeKind.
9328 template <typename T, TypeKind kTypeKind>
9329 class TypeWithoutFormatter {
9330  public:
9331   // This default version is called when kTypeKind is kOtherType.
9332   static void PrintValue(const T& value, ::std::ostream* os) {
9333     PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
9334                          sizeof(value), os);
9335   }
9336 };
9337
9338 // We print a protobuf using its ShortDebugString() when the string
9339 // doesn't exceed this many characters; otherwise we print it using
9340 // DebugString() for better readability.
9341 const size_t kProtobufOneLinerMaxLength = 50;
9342
9343 template <typename T>
9344 class TypeWithoutFormatter<T, kProtobuf> {
9345  public:
9346   static void PrintValue(const T& value, ::std::ostream* os) {
9347     const ::testing::internal::string short_str = value.ShortDebugString();
9348     const ::testing::internal::string pretty_str =
9349         short_str.length() <= kProtobufOneLinerMaxLength ?
9350         short_str : ("\n" + value.DebugString());
9351     *os << ("<" + pretty_str + ">");
9352   }
9353 };
9354
9355 template <typename T>
9356 class TypeWithoutFormatter<T, kConvertibleToInteger> {
9357  public:
9358   // Since T has no << operator or PrintTo() but can be implicitly
9359   // converted to BiggestInt, we print it as a BiggestInt.
9360   //
9361   // Most likely T is an enum type (either named or unnamed), in which
9362   // case printing it as an integer is the desired behavior.  In case
9363   // T is not an enum, printing it as an integer is the best we can do
9364   // given that it has no user-defined printer.
9365   static void PrintValue(const T& value, ::std::ostream* os) {
9366     const internal::BiggestInt kBigInt = value;
9367     *os << kBigInt;
9368   }
9369 };
9370
9371 // Prints the given value to the given ostream.  If the value is a
9372 // protocol message, its debug string is printed; if it's an enum or
9373 // of a type implicitly convertible to BiggestInt, it's printed as an
9374 // integer; otherwise the bytes in the value are printed.  This is
9375 // what UniversalPrinter<T>::Print() does when it knows nothing about
9376 // type T and T has neither << operator nor PrintTo().
9377 //
9378 // A user can override this behavior for a class type Foo by defining
9379 // a << operator in the namespace where Foo is defined.
9380 //
9381 // We put this operator in namespace 'internal2' instead of 'internal'
9382 // to simplify the implementation, as much code in 'internal' needs to
9383 // use << in STL, which would conflict with our own << were it defined
9384 // in 'internal'.
9385 //
9386 // Note that this operator<< takes a generic std::basic_ostream<Char,
9387 // CharTraits> type instead of the more restricted std::ostream.  If
9388 // we define it to take an std::ostream instead, we'll get an
9389 // "ambiguous overloads" compiler error when trying to print a type
9390 // Foo that supports streaming to std::basic_ostream<Char,
9391 // CharTraits>, as the compiler cannot tell whether
9392 // operator<<(std::ostream&, const T&) or
9393 // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
9394 // specific.
9395 template <typename Char, typename CharTraits, typename T>
9396 ::std::basic_ostream<Char, CharTraits>& operator<<(
9397     ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
9398   TypeWithoutFormatter<T,
9399       (internal::IsAProtocolMessage<T>::value ? kProtobuf :
9400        internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
9401        kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
9402   return os;
9403 }
9404
9405 }  // namespace internal2
9406 }  // namespace testing
9407
9408 // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
9409 // magic needed for implementing UniversalPrinter won't work.
9410 namespace testing_internal {
9411
9412 // Used to print a value that is not an STL-style container when the
9413 // user doesn't define PrintTo() for it.
9414 template <typename T>
9415 void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
9416   // With the following statement, during unqualified name lookup,
9417   // testing::internal2::operator<< appears as if it was declared in
9418   // the nearest enclosing namespace that contains both
9419   // ::testing_internal and ::testing::internal2, i.e. the global
9420   // namespace.  For more details, refer to the C++ Standard section
9421   // 7.3.4-1 [namespace.udir].  This allows us to fall back onto
9422   // testing::internal2::operator<< in case T doesn't come with a <<
9423   // operator.
9424   //
9425   // We cannot write 'using ::testing::internal2::operator<<;', which
9426   // gcc 3.3 fails to compile due to a compiler bug.
9427   using namespace ::testing::internal2;  // NOLINT
9428
9429   // Assuming T is defined in namespace foo, in the next statement,
9430   // the compiler will consider all of:
9431   //
9432   //   1. foo::operator<< (thanks to Koenig look-up),
9433   //   2. ::operator<< (as the current namespace is enclosed in ::),
9434   //   3. testing::internal2::operator<< (thanks to the using statement above).
9435   //
9436   // The operator<< whose type matches T best will be picked.
9437   //
9438   // We deliberately allow #2 to be a candidate, as sometimes it's
9439   // impossible to define #1 (e.g. when foo is ::std, defining
9440   // anything in it is undefined behavior unless you are a compiler
9441   // vendor.).
9442   *os << value;
9443 }
9444
9445 }  // namespace testing_internal
9446
9447 namespace testing {
9448 namespace internal {
9449
9450 // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
9451 // value to the given ostream.  The caller must ensure that
9452 // 'ostream_ptr' is not NULL, or the behavior is undefined.
9453 //
9454 // We define UniversalPrinter as a class template (as opposed to a
9455 // function template), as we need to partially specialize it for
9456 // reference types, which cannot be done with function templates.
9457 template <typename T>
9458 class UniversalPrinter;
9459
9460 template <typename T>
9461 void UniversalPrint(const T& value, ::std::ostream* os);
9462
9463 // Used to print an STL-style container when the user doesn't define
9464 // a PrintTo() for it.
9465 template <typename C>
9466 void DefaultPrintTo(IsContainer /* dummy */,
9467                     false_type /* is not a pointer */,
9468                     const C& container, ::std::ostream* os) {
9469   const size_t kMaxCount = 32;  // The maximum number of elements to print.
9470   *os << '{';
9471   size_t count = 0;
9472   for (typename C::const_iterator it = container.begin();
9473        it != container.end(); ++it, ++count) {
9474     if (count > 0) {
9475       *os << ',';
9476       if (count == kMaxCount) {  // Enough has been printed.
9477         *os << " ...";
9478         break;
9479       }
9480     }
9481     *os << ' ';
9482     // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
9483     // handle *it being a native array.
9484     internal::UniversalPrint(*it, os);
9485   }
9486
9487   if (count > 0) {
9488     *os << ' ';
9489   }
9490   *os << '}';
9491 }
9492
9493 // Used to print a pointer that is neither a char pointer nor a member
9494 // pointer, when the user doesn't define PrintTo() for it.  (A member
9495 // variable pointer or member function pointer doesn't really point to
9496 // a location in the address space.  Their representation is
9497 // implementation-defined.  Therefore they will be printed as raw
9498 // bytes.)
9499 template <typename T>
9500 void DefaultPrintTo(IsNotContainer /* dummy */,
9501                     true_type /* is a pointer */,
9502                     T* p, ::std::ostream* os) {
9503   if (p == NULL) {
9504     *os << "NULL";
9505   } else {
9506     // C++ doesn't allow casting from a function pointer to any object
9507     // pointer.
9508     //
9509     // IsTrue() silences warnings: "Condition is always true",
9510     // "unreachable code".
9511     if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
9512       // T is not a function type.  We just call << to print p,
9513       // relying on ADL to pick up user-defined << for their pointer
9514       // types, if any.
9515       *os << p;
9516     } else {
9517       // T is a function type, so '*os << p' doesn't do what we want
9518       // (it just prints p as bool).  We want to print p as a const
9519       // void*.  However, we cannot cast it to const void* directly,
9520       // even using reinterpret_cast, as earlier versions of gcc
9521       // (e.g. 3.4.5) cannot compile the cast when p is a function
9522       // pointer.  Casting to UInt64 first solves the problem.
9523       *os << reinterpret_cast<const void*>(
9524           reinterpret_cast<internal::UInt64>(p));
9525     }
9526   }
9527 }
9528
9529 // Used to print a non-container, non-pointer value when the user
9530 // doesn't define PrintTo() for it.
9531 template <typename T>
9532 void DefaultPrintTo(IsNotContainer /* dummy */,
9533                     false_type /* is not a pointer */,
9534                     const T& value, ::std::ostream* os) {
9535   ::testing_internal::DefaultPrintNonContainerTo(value, os);
9536 }
9537
9538 // Prints the given value using the << operator if it has one;
9539 // otherwise prints the bytes in it.  This is what
9540 // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
9541 // or overloaded for type T.
9542 //
9543 // A user can override this behavior for a class type Foo by defining
9544 // an overload of PrintTo() in the namespace where Foo is defined.  We
9545 // give the user this option as sometimes defining a << operator for
9546 // Foo is not desirable (e.g. the coding style may prevent doing it,
9547 // or there is already a << operator but it doesn't do what the user
9548 // wants).
9549 template <typename T>
9550 void PrintTo(const T& value, ::std::ostream* os) {
9551   // DefaultPrintTo() is overloaded.  The type of its first two
9552   // arguments determine which version will be picked.  If T is an
9553   // STL-style container, the version for container will be called; if
9554   // T is a pointer, the pointer version will be called; otherwise the
9555   // generic version will be called.
9556   //
9557   // Note that we check for container types here, prior to we check
9558   // for protocol message types in our operator<<.  The rationale is:
9559   //
9560   // For protocol messages, we want to give people a chance to
9561   // override Google Mock's format by defining a PrintTo() or
9562   // operator<<.  For STL containers, other formats can be
9563   // incompatible with Google Mock's format for the container
9564   // elements; therefore we check for container types here to ensure
9565   // that our format is used.
9566   //
9567   // The second argument of DefaultPrintTo() is needed to bypass a bug
9568   // in Symbian's C++ compiler that prevents it from picking the right
9569   // overload between:
9570   //
9571   //   PrintTo(const T& x, ...);
9572   //   PrintTo(T* x, ...);
9573   DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
9574 }
9575
9576 // The following list of PrintTo() overloads tells
9577 // UniversalPrinter<T>::Print() how to print standard types (built-in
9578 // types, strings, plain arrays, and pointers).
9579
9580 // Overloads for various char types.
9581 GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
9582 GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
9583 inline void PrintTo(char c, ::std::ostream* os) {
9584   // When printing a plain char, we always treat it as unsigned.  This
9585   // way, the output won't be affected by whether the compiler thinks
9586   // char is signed or not.
9587   PrintTo(static_cast<unsigned char>(c), os);
9588 }
9589
9590 // Overloads for other simple built-in types.
9591 inline void PrintTo(bool x, ::std::ostream* os) {
9592   *os << (x ? "true" : "false");
9593 }
9594
9595 // Overload for wchar_t type.
9596 // Prints a wchar_t as a symbol if it is printable or as its internal
9597 // code otherwise and also as its decimal code (except for L'\0').
9598 // The L'\0' char is printed as "L'\\0'". The decimal code is printed
9599 // as signed integer when wchar_t is implemented by the compiler
9600 // as a signed type and is printed as an unsigned integer when wchar_t
9601 // is implemented as an unsigned type.
9602 GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
9603
9604 // Overloads for C strings.
9605 GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
9606 inline void PrintTo(char* s, ::std::ostream* os) {
9607   PrintTo(ImplicitCast_<const char*>(s), os);
9608 }
9609
9610 // signed/unsigned char is often used for representing binary data, so
9611 // we print pointers to it as void* to be safe.
9612 inline void PrintTo(const signed char* s, ::std::ostream* os) {
9613   PrintTo(ImplicitCast_<const void*>(s), os);
9614 }
9615 inline void PrintTo(signed char* s, ::std::ostream* os) {
9616   PrintTo(ImplicitCast_<const void*>(s), os);
9617 }
9618 inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
9619   PrintTo(ImplicitCast_<const void*>(s), os);
9620 }
9621 inline void PrintTo(unsigned char* s, ::std::ostream* os) {
9622   PrintTo(ImplicitCast_<const void*>(s), os);
9623 }
9624
9625 // MSVC can be configured to define wchar_t as a typedef of unsigned
9626 // short.  It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
9627 // type.  When wchar_t is a typedef, defining an overload for const
9628 // wchar_t* would cause unsigned short* be printed as a wide string,
9629 // possibly causing invalid memory accesses.
9630 #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
9631 // Overloads for wide C strings
9632 GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
9633 inline void PrintTo(wchar_t* s, ::std::ostream* os) {
9634   PrintTo(ImplicitCast_<const wchar_t*>(s), os);
9635 }
9636 #endif
9637
9638 // Overload for C arrays.  Multi-dimensional arrays are printed
9639 // properly.
9640
9641 // Prints the given number of elements in an array, without printing
9642 // the curly braces.
9643 template <typename T>
9644 void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
9645   UniversalPrint(a[0], os);
9646   for (size_t i = 1; i != count; i++) {
9647     *os << ", ";
9648     UniversalPrint(a[i], os);
9649   }
9650 }
9651
9652 // Overloads for ::string and ::std::string.
9653 #if GTEST_HAS_GLOBAL_STRING
9654 GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
9655 inline void PrintTo(const ::string& s, ::std::ostream* os) {
9656   PrintStringTo(s, os);
9657 }
9658 #endif  // GTEST_HAS_GLOBAL_STRING
9659
9660 GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
9661 inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
9662   PrintStringTo(s, os);
9663 }
9664
9665 // Overloads for ::wstring and ::std::wstring.
9666 #if GTEST_HAS_GLOBAL_WSTRING
9667 GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
9668 inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
9669   PrintWideStringTo(s, os);
9670 }
9671 #endif  // GTEST_HAS_GLOBAL_WSTRING
9672
9673 #if GTEST_HAS_STD_WSTRING
9674 GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
9675 inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
9676   PrintWideStringTo(s, os);
9677 }
9678 #endif  // GTEST_HAS_STD_WSTRING
9679
9680 #if GTEST_HAS_TR1_TUPLE
9681 // Overload for ::std::tr1::tuple.  Needed for printing function arguments,
9682 // which are packed as tuples.
9683
9684 // Helper function for printing a tuple.  T must be instantiated with
9685 // a tuple type.
9686 template <typename T>
9687 void PrintTupleTo(const T& t, ::std::ostream* os);
9688
9689 // Overloaded PrintTo() for tuples of various arities.  We support
9690 // tuples of up-to 10 fields.  The following implementation works
9691 // regardless of whether tr1::tuple is implemented using the
9692 // non-standard variadic template feature or not.
9693
9694 inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
9695   PrintTupleTo(t, os);
9696 }
9697
9698 template <typename T1>
9699 void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
9700   PrintTupleTo(t, os);
9701 }
9702
9703 template <typename T1, typename T2>
9704 void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
9705   PrintTupleTo(t, os);
9706 }
9707
9708 template <typename T1, typename T2, typename T3>
9709 void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
9710   PrintTupleTo(t, os);
9711 }
9712
9713 template <typename T1, typename T2, typename T3, typename T4>
9714 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
9715   PrintTupleTo(t, os);
9716 }
9717
9718 template <typename T1, typename T2, typename T3, typename T4, typename T5>
9719 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
9720              ::std::ostream* os) {
9721   PrintTupleTo(t, os);
9722 }
9723
9724 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9725           typename T6>
9726 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
9727              ::std::ostream* os) {
9728   PrintTupleTo(t, os);
9729 }
9730
9731 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9732           typename T6, typename T7>
9733 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
9734              ::std::ostream* os) {
9735   PrintTupleTo(t, os);
9736 }
9737
9738 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9739           typename T6, typename T7, typename T8>
9740 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
9741              ::std::ostream* os) {
9742   PrintTupleTo(t, os);
9743 }
9744
9745 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9746           typename T6, typename T7, typename T8, typename T9>
9747 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
9748              ::std::ostream* os) {
9749   PrintTupleTo(t, os);
9750 }
9751
9752 template <typename T1, typename T2, typename T3, typename T4, typename T5,
9753           typename T6, typename T7, typename T8, typename T9, typename T10>
9754 void PrintTo(
9755     const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
9756     ::std::ostream* os) {
9757   PrintTupleTo(t, os);
9758 }
9759 #endif  // GTEST_HAS_TR1_TUPLE
9760
9761 // Overload for std::pair.
9762 template <typename T1, typename T2>
9763 void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
9764   *os << '(';
9765   // We cannot use UniversalPrint(value.first, os) here, as T1 may be
9766   // a reference type.  The same for printing value.second.
9767   UniversalPrinter<T1>::Print(value.first, os);
9768   *os << ", ";
9769   UniversalPrinter<T2>::Print(value.second, os);
9770   *os << ')';
9771 }
9772
9773 // Implements printing a non-reference type T by letting the compiler
9774 // pick the right overload of PrintTo() for T.
9775 template <typename T>
9776 class UniversalPrinter {
9777  public:
9778   // MSVC warns about adding const to a function type, so we want to
9779   // disable the warning.
9780 #ifdef _MSC_VER
9781 # pragma warning(push)          // Saves the current warning state.
9782 # pragma warning(disable:4180)  // Temporarily disables warning 4180.
9783 #endif  // _MSC_VER
9784
9785   // Note: we deliberately don't call this PrintTo(), as that name
9786   // conflicts with ::testing::internal::PrintTo in the body of the
9787   // function.
9788   static void Print(const T& value, ::std::ostream* os) {
9789     // By default, ::testing::internal::PrintTo() is used for printing
9790     // the value.
9791     //
9792     // Thanks to Koenig look-up, if T is a class and has its own
9793     // PrintTo() function defined in its namespace, that function will
9794     // be visible here.  Since it is more specific than the generic ones
9795     // in ::testing::internal, it will be picked by the compiler in the
9796     // following statement - exactly what we want.
9797     PrintTo(value, os);
9798   }
9799
9800 #ifdef _MSC_VER
9801 # pragma warning(pop)           // Restores the warning state.
9802 #endif  // _MSC_VER
9803 };
9804
9805 // UniversalPrintArray(begin, len, os) prints an array of 'len'
9806 // elements, starting at address 'begin'.
9807 template <typename T>
9808 void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
9809   if (len == 0) {
9810     *os << "{}";
9811   } else {
9812     *os << "{ ";
9813     const size_t kThreshold = 18;
9814     const size_t kChunkSize = 8;
9815     // If the array has more than kThreshold elements, we'll have to
9816     // omit some details by printing only the first and the last
9817     // kChunkSize elements.
9818     // TODO(wan@google.com): let the user control the threshold using a flag.
9819     if (len <= kThreshold) {
9820       PrintRawArrayTo(begin, len, os);
9821     } else {
9822       PrintRawArrayTo(begin, kChunkSize, os);
9823       *os << ", ..., ";
9824       PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
9825     }
9826     *os << " }";
9827   }
9828 }
9829 // This overload prints a (const) char array compactly.
9830 GTEST_API_ void UniversalPrintArray(
9831     const char* begin, size_t len, ::std::ostream* os);
9832
9833 // This overload prints a (const) wchar_t array compactly.
9834 GTEST_API_ void UniversalPrintArray(
9835     const wchar_t* begin, size_t len, ::std::ostream* os);
9836
9837 // Implements printing an array type T[N].
9838 template <typename T, size_t N>
9839 class UniversalPrinter<T[N]> {
9840  public:
9841   // Prints the given array, omitting some elements when there are too
9842   // many.
9843   static void Print(const T (&a)[N], ::std::ostream* os) {
9844     UniversalPrintArray(a, N, os);
9845   }
9846 };
9847
9848 // Implements printing a reference type T&.
9849 template <typename T>
9850 class UniversalPrinter<T&> {
9851  public:
9852   // MSVC warns about adding const to a function type, so we want to
9853   // disable the warning.
9854 #ifdef _MSC_VER
9855 # pragma warning(push)          // Saves the current warning state.
9856 # pragma warning(disable:4180)  // Temporarily disables warning 4180.
9857 #endif  // _MSC_VER
9858
9859   static void Print(const T& value, ::std::ostream* os) {
9860     // Prints the address of the value.  We use reinterpret_cast here
9861     // as static_cast doesn't compile when T is a function type.
9862     *os << "@" << reinterpret_cast<const void*>(&value) << " ";
9863
9864     // Then prints the value itself.
9865     UniversalPrint(value, os);
9866   }
9867
9868 #ifdef _MSC_VER
9869 # pragma warning(pop)           // Restores the warning state.
9870 #endif  // _MSC_VER
9871 };
9872
9873 // Prints a value tersely: for a reference type, the referenced value
9874 // (but not the address) is printed; for a (const) char pointer, the
9875 // NUL-terminated string (but not the pointer) is printed.
9876
9877 template <typename T>
9878 class UniversalTersePrinter {
9879  public:
9880   static void Print(const T& value, ::std::ostream* os) {
9881     UniversalPrint(value, os);
9882   }
9883 };
9884 template <typename T>
9885 class UniversalTersePrinter<T&> {
9886  public:
9887   static void Print(const T& value, ::std::ostream* os) {
9888     UniversalPrint(value, os);
9889   }
9890 };
9891 template <typename T, size_t N>
9892 class UniversalTersePrinter<T[N]> {
9893  public:
9894   static void Print(const T (&value)[N], ::std::ostream* os) {
9895     UniversalPrinter<T[N]>::Print(value, os);
9896   }
9897 };
9898 template <>
9899 class UniversalTersePrinter<const char*> {
9900  public:
9901   static void Print(const char* str, ::std::ostream* os) {
9902     if (str == NULL) {
9903       *os << "NULL";
9904     } else {
9905       UniversalPrint(string(str), os);
9906     }
9907   }
9908 };
9909 template <>
9910 class UniversalTersePrinter<char*> {
9911  public:
9912   static void Print(char* str, ::std::ostream* os) {
9913     UniversalTersePrinter<const char*>::Print(str, os);
9914   }
9915 };
9916
9917 #if GTEST_HAS_STD_WSTRING
9918 template <>
9919 class UniversalTersePrinter<const wchar_t*> {
9920  public:
9921   static void Print(const wchar_t* str, ::std::ostream* os) {
9922     if (str == NULL) {
9923       *os << "NULL";
9924     } else {
9925       UniversalPrint(::std::wstring(str), os);
9926     }
9927   }
9928 };
9929 #endif
9930
9931 template <>
9932 class UniversalTersePrinter<wchar_t*> {
9933  public:
9934   static void Print(wchar_t* str, ::std::ostream* os) {
9935     UniversalTersePrinter<const wchar_t*>::Print(str, os);
9936   }
9937 };
9938
9939 template <typename T>
9940 void UniversalTersePrint(const T& value, ::std::ostream* os) {
9941   UniversalTersePrinter<T>::Print(value, os);
9942 }
9943
9944 // Prints a value using the type inferred by the compiler.  The
9945 // difference between this and UniversalTersePrint() is that for a
9946 // (const) char pointer, this prints both the pointer and the
9947 // NUL-terminated string.
9948 template <typename T>
9949 void UniversalPrint(const T& value, ::std::ostream* os) {
9950   // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
9951   // UniversalPrinter with T directly.
9952   typedef T T1;
9953   UniversalPrinter<T1>::Print(value, os);
9954 }
9955
9956 #if GTEST_HAS_TR1_TUPLE
9957 typedef ::std::vector<string> Strings;
9958
9959 // This helper template allows PrintTo() for tuples and
9960 // UniversalTersePrintTupleFieldsToStrings() to be defined by
9961 // induction on the number of tuple fields.  The idea is that
9962 // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
9963 // fields in tuple t, and can be defined in terms of
9964 // TuplePrefixPrinter<N - 1>.
9965
9966 // The inductive case.
9967 template <size_t N>
9968 struct TuplePrefixPrinter {
9969   // Prints the first N fields of a tuple.
9970   template <typename Tuple>
9971   static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
9972     TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
9973     *os << ", ";
9974     UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
9975         ::Print(::std::tr1::get<N - 1>(t), os);
9976   }
9977
9978   // Tersely prints the first N fields of a tuple to a string vector,
9979   // one element for each field.
9980   template <typename Tuple>
9981   static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
9982     TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
9983     ::std::stringstream ss;
9984     UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
9985     strings->push_back(ss.str());
9986   }
9987 };
9988
9989 // Base cases.
9990 template <>
9991 struct TuplePrefixPrinter<0> {
9992   template <typename Tuple>
9993   static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
9994
9995   template <typename Tuple>
9996   static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
9997 };
9998 // We have to specialize the entire TuplePrefixPrinter<> class
9999 // template here, even though the definition of
10000 // TersePrintPrefixToStrings() is the same as the generic version, as
10001 // Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
10002 // support specializing a method template of a class template.
10003 template <>
10004 struct TuplePrefixPrinter<1> {
10005   template <typename Tuple>
10006   static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
10007     UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
10008         Print(::std::tr1::get<0>(t), os);
10009   }
10010
10011   template <typename Tuple>
10012   static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
10013     ::std::stringstream ss;
10014     UniversalTersePrint(::std::tr1::get<0>(t), &ss);
10015     strings->push_back(ss.str());
10016   }
10017 };
10018
10019 // Helper function for printing a tuple.  T must be instantiated with
10020 // a tuple type.
10021 template <typename T>
10022 void PrintTupleTo(const T& t, ::std::ostream* os) {
10023   *os << "(";
10024   TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
10025       PrintPrefixTo(t, os);
10026   *os << ")";
10027 }
10028
10029 // Prints the fields of a tuple tersely to a string vector, one
10030 // element for each field.  See the comment before
10031 // UniversalTersePrint() for how we define "tersely".
10032 template <typename Tuple>
10033 Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
10034   Strings result;
10035   TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
10036       TersePrintPrefixToStrings(value, &result);
10037   return result;
10038 }
10039 #endif  // GTEST_HAS_TR1_TUPLE
10040
10041 }  // namespace internal
10042
10043 template <typename T>
10044 ::std::string PrintToString(const T& value) {
10045   ::std::stringstream ss;
10046   internal::UniversalTersePrinter<T>::Print(value, &ss);
10047   return ss.str();
10048 }
10049
10050 }  // namespace testing
10051
10052 #endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10053
10054 #if GTEST_HAS_PARAM_TEST
10055
10056 namespace testing {
10057 namespace internal {
10058
10059 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10060 //
10061 // Outputs a message explaining invalid registration of different
10062 // fixture class for the same test case. This may happen when
10063 // TEST_P macro is used to define two tests with the same name
10064 // but in different namespaces.
10065 GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
10066                                           const char* file, int line);
10067
10068 template <typename> class ParamGeneratorInterface;
10069 template <typename> class ParamGenerator;
10070
10071 // Interface for iterating over elements provided by an implementation
10072 // of ParamGeneratorInterface<T>.
10073 template <typename T>
10074 class ParamIteratorInterface {
10075  public:
10076   virtual ~ParamIteratorInterface() {}
10077   // A pointer to the base generator instance.
10078   // Used only for the purposes of iterator comparison
10079   // to make sure that two iterators belong to the same generator.
10080   virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
10081   // Advances iterator to point to the next element
10082   // provided by the generator. The caller is responsible
10083   // for not calling Advance() on an iterator equal to
10084   // BaseGenerator()->End().
10085   virtual void Advance() = 0;
10086   // Clones the iterator object. Used for implementing copy semantics
10087   // of ParamIterator<T>.
10088   virtual ParamIteratorInterface* Clone() const = 0;
10089   // Dereferences the current iterator and provides (read-only) access
10090   // to the pointed value. It is the caller's responsibility not to call
10091   // Current() on an iterator equal to BaseGenerator()->End().
10092   // Used for implementing ParamGenerator<T>::operator*().
10093   virtual const T* Current() const = 0;
10094   // Determines whether the given iterator and other point to the same
10095   // element in the sequence generated by the generator.
10096   // Used for implementing ParamGenerator<T>::operator==().
10097   virtual bool Equals(const ParamIteratorInterface& other) const = 0;
10098 };
10099
10100 // Class iterating over elements provided by an implementation of
10101 // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
10102 // and implements the const forward iterator concept.
10103 template <typename T>
10104 class ParamIterator {
10105  public:
10106   typedef T value_type;
10107   typedef const T& reference;
10108   typedef ptrdiff_t difference_type;
10109
10110   // ParamIterator assumes ownership of the impl_ pointer.
10111   ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
10112   ParamIterator& operator=(const ParamIterator& other) {
10113     if (this != &other)
10114       impl_.reset(other.impl_->Clone());
10115     return *this;
10116   }
10117
10118   const T& operator*() const { return *impl_->Current(); }
10119   const T* operator->() const { return impl_->Current(); }
10120   // Prefix version of operator++.
10121   ParamIterator& operator++() {
10122     impl_->Advance();
10123     return *this;
10124   }
10125   // Postfix version of operator++.
10126   ParamIterator operator++(int /*unused*/) {
10127     ParamIteratorInterface<T>* clone = impl_->Clone();
10128     impl_->Advance();
10129     return ParamIterator(clone);
10130   }
10131   bool operator==(const ParamIterator& other) const {
10132     return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
10133   }
10134   bool operator!=(const ParamIterator& other) const {
10135     return !(*this == other);
10136   }
10137
10138  private:
10139   friend class ParamGenerator<T>;
10140   explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
10141   scoped_ptr<ParamIteratorInterface<T> > impl_;
10142 };
10143
10144 // ParamGeneratorInterface<T> is the binary interface to access generators
10145 // defined in other translation units.
10146 template <typename T>
10147 class ParamGeneratorInterface {
10148  public:
10149   typedef T ParamType;
10150
10151   virtual ~ParamGeneratorInterface() {}
10152
10153   // Generator interface definition
10154   virtual ParamIteratorInterface<T>* Begin() const = 0;
10155   virtual ParamIteratorInterface<T>* End() const = 0;
10156 };
10157
10158 // Wraps ParamGeneratorInterface<T> and provides general generator syntax
10159 // compatible with the STL Container concept.
10160 // This class implements copy initialization semantics and the contained
10161 // ParamGeneratorInterface<T> instance is shared among all copies
10162 // of the original object. This is possible because that instance is immutable.
10163 template<typename T>
10164 class ParamGenerator {
10165  public:
10166   typedef ParamIterator<T> iterator;
10167
10168   explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
10169   ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
10170
10171   ParamGenerator& operator=(const ParamGenerator& other) {
10172     impl_ = other.impl_;
10173     return *this;
10174   }
10175
10176   iterator begin() const { return iterator(impl_->Begin()); }
10177   iterator end() const { return iterator(impl_->End()); }
10178
10179  private:
10180   linked_ptr<const ParamGeneratorInterface<T> > impl_;
10181 };
10182
10183 // Generates values from a range of two comparable values. Can be used to
10184 // generate sequences of user-defined types that implement operator+() and
10185 // operator<().
10186 // This class is used in the Range() function.
10187 template <typename T, typename IncrementT>
10188 class RangeGenerator : public ParamGeneratorInterface<T> {
10189  public:
10190   RangeGenerator(T begin, T end, IncrementT step)
10191       : begin_(begin), end_(end),
10192         step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
10193   virtual ~RangeGenerator() {}
10194
10195   virtual ParamIteratorInterface<T>* Begin() const {
10196     return new Iterator(this, begin_, 0, step_);
10197   }
10198   virtual ParamIteratorInterface<T>* End() const {
10199     return new Iterator(this, end_, end_index_, step_);
10200   }
10201
10202  private:
10203   class Iterator : public ParamIteratorInterface<T> {
10204    public:
10205     Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
10206              IncrementT step)
10207         : base_(base), value_(value), index_(index), step_(step) {}
10208     virtual ~Iterator() {}
10209
10210     virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10211       return base_;
10212     }
10213     virtual void Advance() {
10214       value_ = value_ + step_;
10215       index_++;
10216     }
10217     virtual ParamIteratorInterface<T>* Clone() const {
10218       return new Iterator(*this);
10219     }
10220     virtual const T* Current() const { return &value_; }
10221     virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10222       // Having the same base generator guarantees that the other
10223       // iterator is of the same type and we can downcast.
10224       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10225           << "The program attempted to compare iterators "
10226           << "from different generators." << std::endl;
10227       const int other_index =
10228           CheckedDowncastToActualType<const Iterator>(&other)->index_;
10229       return index_ == other_index;
10230     }
10231
10232    private:
10233     Iterator(const Iterator& other)
10234         : ParamIteratorInterface<T>(),
10235           base_(other.base_), value_(other.value_), index_(other.index_),
10236           step_(other.step_) {}
10237
10238     // No implementation - assignment is unsupported.
10239     void operator=(const Iterator& other);
10240
10241     const ParamGeneratorInterface<T>* const base_;
10242     T value_;
10243     int index_;
10244     const IncrementT step_;
10245   };  // class RangeGenerator::Iterator
10246
10247   static int CalculateEndIndex(const T& begin,
10248                                const T& end,
10249                                const IncrementT& step) {
10250     int end_index = 0;
10251     for (T i = begin; i < end; i = i + step)
10252       end_index++;
10253     return end_index;
10254   }
10255
10256   // No implementation - assignment is unsupported.
10257   void operator=(const RangeGenerator& other);
10258
10259   const T begin_;
10260   const T end_;
10261   const IncrementT step_;
10262   // The index for the end() iterator. All the elements in the generated
10263   // sequence are indexed (0-based) to aid iterator comparison.
10264   const int end_index_;
10265 };  // class RangeGenerator
10266
10267
10268 // Generates values from a pair of STL-style iterators. Used in the
10269 // ValuesIn() function. The elements are copied from the source range
10270 // since the source can be located on the stack, and the generator
10271 // is likely to persist beyond that stack frame.
10272 template <typename T>
10273 class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
10274  public:
10275   template <typename ForwardIterator>
10276   ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
10277       : container_(begin, end) {}
10278   virtual ~ValuesInIteratorRangeGenerator() {}
10279
10280   virtual ParamIteratorInterface<T>* Begin() const {
10281     return new Iterator(this, container_.begin());
10282   }
10283   virtual ParamIteratorInterface<T>* End() const {
10284     return new Iterator(this, container_.end());
10285   }
10286
10287  private:
10288   typedef typename ::std::vector<T> ContainerType;
10289
10290   class Iterator : public ParamIteratorInterface<T> {
10291    public:
10292     Iterator(const ParamGeneratorInterface<T>* base,
10293              typename ContainerType::const_iterator iterator)
10294         : base_(base), iterator_(iterator) {}
10295     virtual ~Iterator() {}
10296
10297     virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10298       return base_;
10299     }
10300     virtual void Advance() {
10301       ++iterator_;
10302       value_.reset();
10303     }
10304     virtual ParamIteratorInterface<T>* Clone() const {
10305       return new Iterator(*this);
10306     }
10307     // We need to use cached value referenced by iterator_ because *iterator_
10308     // can return a temporary object (and of type other then T), so just
10309     // having "return &*iterator_;" doesn't work.
10310     // value_ is updated here and not in Advance() because Advance()
10311     // can advance iterator_ beyond the end of the range, and we cannot
10312     // detect that fact. The client code, on the other hand, is
10313     // responsible for not calling Current() on an out-of-range iterator.
10314     virtual const T* Current() const {
10315       if (value_.get() == NULL)
10316         value_.reset(new T(*iterator_));
10317       return value_.get();
10318     }
10319     virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10320       // Having the same base generator guarantees that the other
10321       // iterator is of the same type and we can downcast.
10322       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10323           << "The program attempted to compare iterators "
10324           << "from different generators." << std::endl;
10325       return iterator_ ==
10326           CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
10327     }
10328
10329    private:
10330     Iterator(const Iterator& other)
10331           // The explicit constructor call suppresses a false warning
10332           // emitted by gcc when supplied with the -Wextra option.
10333         : ParamIteratorInterface<T>(),
10334           base_(other.base_),
10335           iterator_(other.iterator_) {}
10336
10337     const ParamGeneratorInterface<T>* const base_;
10338     typename ContainerType::const_iterator iterator_;
10339     // A cached value of *iterator_. We keep it here to allow access by
10340     // pointer in the wrapping iterator's operator->().
10341     // value_ needs to be mutable to be accessed in Current().
10342     // Use of scoped_ptr helps manage cached value's lifetime,
10343     // which is bound by the lifespan of the iterator itself.
10344     mutable scoped_ptr<const T> value_;
10345   };  // class ValuesInIteratorRangeGenerator::Iterator
10346
10347   // No implementation - assignment is unsupported.
10348   void operator=(const ValuesInIteratorRangeGenerator& other);
10349
10350   const ContainerType container_;
10351 };  // class ValuesInIteratorRangeGenerator
10352
10353 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10354 //
10355 // Stores a parameter value and later creates tests parameterized with that
10356 // value.
10357 template <class TestClass>
10358 class ParameterizedTestFactory : public TestFactoryBase {
10359  public:
10360   typedef typename TestClass::ParamType ParamType;
10361   explicit ParameterizedTestFactory(ParamType parameter) :
10362       parameter_(parameter) {}
10363   virtual Test* CreateTest() {
10364     TestClass::SetParam(&parameter_);
10365     return new TestClass();
10366   }
10367
10368  private:
10369   const ParamType parameter_;
10370
10371   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
10372 };
10373
10374 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10375 //
10376 // TestMetaFactoryBase is a base class for meta-factories that create
10377 // test factories for passing into MakeAndRegisterTestInfo function.
10378 template <class ParamType>
10379 class TestMetaFactoryBase {
10380  public:
10381   virtual ~TestMetaFactoryBase() {}
10382
10383   virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
10384 };
10385
10386 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10387 //
10388 // TestMetaFactory creates test factories for passing into
10389 // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
10390 // ownership of test factory pointer, same factory object cannot be passed
10391 // into that method twice. But ParameterizedTestCaseInfo is going to call
10392 // it for each Test/Parameter value combination. Thus it needs meta factory
10393 // creator class.
10394 template <class TestCase>
10395 class TestMetaFactory
10396     : public TestMetaFactoryBase<typename TestCase::ParamType> {
10397  public:
10398   typedef typename TestCase::ParamType ParamType;
10399
10400   TestMetaFactory() {}
10401
10402   virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
10403     return new ParameterizedTestFactory<TestCase>(parameter);
10404   }
10405
10406  private:
10407   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
10408 };
10409
10410 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10411 //
10412 // ParameterizedTestCaseInfoBase is a generic interface
10413 // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
10414 // accumulates test information provided by TEST_P macro invocations
10415 // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
10416 // and uses that information to register all resulting test instances
10417 // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
10418 // a collection of pointers to the ParameterizedTestCaseInfo objects
10419 // and calls RegisterTests() on each of them when asked.
10420 class ParameterizedTestCaseInfoBase {
10421  public:
10422   virtual ~ParameterizedTestCaseInfoBase() {}
10423
10424   // Base part of test case name for display purposes.
10425   virtual const string& GetTestCaseName() const = 0;
10426   // Test case id to verify identity.
10427   virtual TypeId GetTestCaseTypeId() const = 0;
10428   // UnitTest class invokes this method to register tests in this
10429   // test case right before running them in RUN_ALL_TESTS macro.
10430   // This method should not be called more then once on any single
10431   // instance of a ParameterizedTestCaseInfoBase derived class.
10432   virtual void RegisterTests() = 0;
10433
10434  protected:
10435   ParameterizedTestCaseInfoBase() {}
10436
10437  private:
10438   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
10439 };
10440
10441 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10442 //
10443 // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
10444 // macro invocations for a particular test case and generators
10445 // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
10446 // test case. It registers tests with all values generated by all
10447 // generators when asked.
10448 template <class TestCase>
10449 class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
10450  public:
10451   // ParamType and GeneratorCreationFunc are private types but are required
10452   // for declarations of public methods AddTestPattern() and
10453   // AddTestCaseInstantiation().
10454   typedef typename TestCase::ParamType ParamType;
10455   // A function that returns an instance of appropriate generator type.
10456   typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
10457
10458   explicit ParameterizedTestCaseInfo(const char* name)
10459       : test_case_name_(name) {}
10460
10461   // Test case base name for display purposes.
10462   virtual const string& GetTestCaseName() const { return test_case_name_; }
10463   // Test case id to verify identity.
10464   virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
10465   // TEST_P macro uses AddTestPattern() to record information
10466   // about a single test in a LocalTestInfo structure.
10467   // test_case_name is the base name of the test case (without invocation
10468   // prefix). test_base_name is the name of an individual test without
10469   // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
10470   // test case base name and DoBar is test base name.
10471   void AddTestPattern(const char* test_case_name,
10472                       const char* test_base_name,
10473                       TestMetaFactoryBase<ParamType>* meta_factory) {
10474     tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
10475                                                        test_base_name,
10476                                                        meta_factory)));
10477   }
10478   // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
10479   // about a generator.
10480   int AddTestCaseInstantiation(const string& instantiation_name,
10481                                GeneratorCreationFunc* func,
10482                                const char* /* file */,
10483                                int /* line */) {
10484     instantiations_.push_back(::std::make_pair(instantiation_name, func));
10485     return 0;  // Return value used only to run this method in namespace scope.
10486   }
10487   // UnitTest class invokes this method to register tests in this test case
10488   // test cases right before running tests in RUN_ALL_TESTS macro.
10489   // This method should not be called more then once on any single
10490   // instance of a ParameterizedTestCaseInfoBase derived class.
10491   // UnitTest has a guard to prevent from calling this method more then once.
10492   virtual void RegisterTests() {
10493     for (typename TestInfoContainer::iterator test_it = tests_.begin();
10494          test_it != tests_.end(); ++test_it) {
10495       linked_ptr<TestInfo> test_info = *test_it;
10496       for (typename InstantiationContainer::iterator gen_it =
10497                instantiations_.begin(); gen_it != instantiations_.end();
10498                ++gen_it) {
10499         const string& instantiation_name = gen_it->first;
10500         ParamGenerator<ParamType> generator((*gen_it->second)());
10501
10502         Message test_case_name_stream;
10503         if ( !instantiation_name.empty() )
10504           test_case_name_stream << instantiation_name << "/";
10505         test_case_name_stream << test_info->test_case_base_name;
10506
10507         int i = 0;
10508         for (typename ParamGenerator<ParamType>::iterator param_it =
10509                  generator.begin();
10510              param_it != generator.end(); ++param_it, ++i) {
10511           Message test_name_stream;
10512           test_name_stream << test_info->test_base_name << "/" << i;
10513           MakeAndRegisterTestInfo(
10514               test_case_name_stream.GetString().c_str(),
10515               test_name_stream.GetString().c_str(),
10516               NULL,  // No type parameter.
10517               PrintToString(*param_it).c_str(),
10518               GetTestCaseTypeId(),
10519               TestCase::SetUpTestCase,
10520               TestCase::TearDownTestCase,
10521               test_info->test_meta_factory->CreateTestFactory(*param_it));
10522         }  // for param_it
10523       }  // for gen_it
10524     }  // for test_it
10525   }  // RegisterTests
10526
10527  private:
10528   // LocalTestInfo structure keeps information about a single test registered
10529   // with TEST_P macro.
10530   struct TestInfo {
10531     TestInfo(const char* a_test_case_base_name,
10532              const char* a_test_base_name,
10533              TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
10534         test_case_base_name(a_test_case_base_name),
10535         test_base_name(a_test_base_name),
10536         test_meta_factory(a_test_meta_factory) {}
10537
10538     const string test_case_base_name;
10539     const string test_base_name;
10540     const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
10541   };
10542   typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
10543   // Keeps pairs of <Instantiation name, Sequence generator creation function>
10544   // received from INSTANTIATE_TEST_CASE_P macros.
10545   typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
10546       InstantiationContainer;
10547
10548   const string test_case_name_;
10549   TestInfoContainer tests_;
10550   InstantiationContainer instantiations_;
10551
10552   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
10553 };  // class ParameterizedTestCaseInfo
10554
10555 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10556 //
10557 // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
10558 // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
10559 // macros use it to locate their corresponding ParameterizedTestCaseInfo
10560 // descriptors.
10561 class ParameterizedTestCaseRegistry {
10562  public:
10563   ParameterizedTestCaseRegistry() {}
10564   ~ParameterizedTestCaseRegistry() {
10565     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10566          it != test_case_infos_.end(); ++it) {
10567       delete *it;
10568     }
10569   }
10570
10571   // Looks up or creates and returns a structure containing information about
10572   // tests and instantiations of a particular test case.
10573   template <class TestCase>
10574   ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
10575       const char* test_case_name,
10576       const char* file,
10577       int line) {
10578     ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
10579     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10580          it != test_case_infos_.end(); ++it) {
10581       if ((*it)->GetTestCaseName() == test_case_name) {
10582         if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
10583           // Complain about incorrect usage of Google Test facilities
10584           // and terminate the program since we cannot guaranty correct
10585           // test case setup and tear-down in this case.
10586           ReportInvalidTestCaseType(test_case_name,  file, line);
10587           posix::Abort();
10588         } else {
10589           // At this point we are sure that the object we found is of the same
10590           // type we are looking for, so we downcast it to that type
10591           // without further checks.
10592           typed_test_info = CheckedDowncastToActualType<
10593               ParameterizedTestCaseInfo<TestCase> >(*it);
10594         }
10595         break;
10596       }
10597     }
10598     if (typed_test_info == NULL) {
10599       typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
10600       test_case_infos_.push_back(typed_test_info);
10601     }
10602     return typed_test_info;
10603   }
10604   void RegisterTests() {
10605     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10606          it != test_case_infos_.end(); ++it) {
10607       (*it)->RegisterTests();
10608     }
10609   }
10610
10611  private:
10612   typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
10613
10614   TestCaseInfoContainer test_case_infos_;
10615
10616   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
10617 };
10618
10619 }  // namespace internal
10620 }  // namespace testing
10621
10622 #endif  //  GTEST_HAS_PARAM_TEST
10623
10624 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
10625 // This file was GENERATED by command:
10626 //     pump.py gtest-param-util-generated.h.pump
10627 // DO NOT EDIT BY HAND!!!
10628
10629 // Copyright 2008 Google Inc.
10630 // All Rights Reserved.
10631 //
10632 // Redistribution and use in source and binary forms, with or without
10633 // modification, are permitted provided that the following conditions are
10634 // met:
10635 //
10636 //     * Redistributions of source code must retain the above copyright
10637 // notice, this list of conditions and the following disclaimer.
10638 //     * Redistributions in binary form must reproduce the above
10639 // copyright notice, this list of conditions and the following disclaimer
10640 // in the documentation and/or other materials provided with the
10641 // distribution.
10642 //     * Neither the name of Google Inc. nor the names of its
10643 // contributors may be used to endorse or promote products derived from
10644 // this software without specific prior written permission.
10645 //
10646 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10647 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10648 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10649 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10650 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10651 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10652 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10653 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10654 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10655 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10656 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10657 //
10658 // Author: vladl@google.com (Vlad Losev)
10659
10660 // Type and function utilities for implementing parameterized tests.
10661 // This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
10662 //
10663 // Currently Google Test supports at most 50 arguments in Values,
10664 // and at most 10 arguments in Combine. Please contact
10665 // googletestframework@googlegroups.com if you need more.
10666 // Please note that the number of arguments to Combine is limited
10667 // by the maximum arity of the implementation of tr1::tuple which is
10668 // currently set at 10.
10669
10670 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10671 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10672
10673 // scripts/fuse_gtest.py depends on gtest's own header being #included
10674 // *unconditionally*.  Therefore these #includes cannot be moved
10675 // inside #if GTEST_HAS_PARAM_TEST.
10676
10677 #if GTEST_HAS_PARAM_TEST
10678
10679 namespace testing {
10680
10681 // Forward declarations of ValuesIn(), which is implemented in
10682 // include/gtest/gtest-param-test.h.
10683 template <typename ForwardIterator>
10684 internal::ParamGenerator<
10685   typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
10686 ValuesIn(ForwardIterator begin, ForwardIterator end);
10687
10688 template <typename T, size_t N>
10689 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
10690
10691 template <class Container>
10692 internal::ParamGenerator<typename Container::value_type> ValuesIn(
10693     const Container& container);
10694
10695 namespace internal {
10696
10697 // Used in the Values() function to provide polymorphic capabilities.
10698 template <typename T1>
10699 class ValueArray1 {
10700  public:
10701   explicit ValueArray1(T1 v1) : v1_(v1) {}
10702
10703   template <typename T>
10704   operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
10705
10706  private:
10707   // No implementation - assignment is unsupported.
10708   void operator=(const ValueArray1& other);
10709
10710   const T1 v1_;
10711 };
10712
10713 template <typename T1, typename T2>
10714 class ValueArray2 {
10715  public:
10716   ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
10717
10718   template <typename T>
10719   operator ParamGenerator<T>() const {
10720     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
10721     return ValuesIn(array);
10722   }
10723
10724  private:
10725   // No implementation - assignment is unsupported.
10726   void operator=(const ValueArray2& other);
10727
10728   const T1 v1_;
10729   const T2 v2_;
10730 };
10731
10732 template <typename T1, typename T2, typename T3>
10733 class ValueArray3 {
10734  public:
10735   ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
10736
10737   template <typename T>
10738   operator ParamGenerator<T>() const {
10739     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10740         static_cast<T>(v3_)};
10741     return ValuesIn(array);
10742   }
10743
10744  private:
10745   // No implementation - assignment is unsupported.
10746   void operator=(const ValueArray3& other);
10747
10748   const T1 v1_;
10749   const T2 v2_;
10750   const T3 v3_;
10751 };
10752
10753 template <typename T1, typename T2, typename T3, typename T4>
10754 class ValueArray4 {
10755  public:
10756   ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
10757       v4_(v4) {}
10758
10759   template <typename T>
10760   operator ParamGenerator<T>() const {
10761     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10762         static_cast<T>(v3_), static_cast<T>(v4_)};
10763     return ValuesIn(array);
10764   }
10765
10766  private:
10767   // No implementation - assignment is unsupported.
10768   void operator=(const ValueArray4& other);
10769
10770   const T1 v1_;
10771   const T2 v2_;
10772   const T3 v3_;
10773   const T4 v4_;
10774 };
10775
10776 template <typename T1, typename T2, typename T3, typename T4, typename T5>
10777 class ValueArray5 {
10778  public:
10779   ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
10780       v4_(v4), v5_(v5) {}
10781
10782   template <typename T>
10783   operator ParamGenerator<T>() const {
10784     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10785         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
10786     return ValuesIn(array);
10787   }
10788
10789  private:
10790   // No implementation - assignment is unsupported.
10791   void operator=(const ValueArray5& other);
10792
10793   const T1 v1_;
10794   const T2 v2_;
10795   const T3 v3_;
10796   const T4 v4_;
10797   const T5 v5_;
10798 };
10799
10800 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10801     typename T6>
10802 class ValueArray6 {
10803  public:
10804   ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
10805       v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
10806
10807   template <typename T>
10808   operator ParamGenerator<T>() const {
10809     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10810         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10811         static_cast<T>(v6_)};
10812     return ValuesIn(array);
10813   }
10814
10815  private:
10816   // No implementation - assignment is unsupported.
10817   void operator=(const ValueArray6& other);
10818
10819   const T1 v1_;
10820   const T2 v2_;
10821   const T3 v3_;
10822   const T4 v4_;
10823   const T5 v5_;
10824   const T6 v6_;
10825 };
10826
10827 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10828     typename T6, typename T7>
10829 class ValueArray7 {
10830  public:
10831   ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
10832       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
10833
10834   template <typename T>
10835   operator ParamGenerator<T>() const {
10836     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10837         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10838         static_cast<T>(v6_), static_cast<T>(v7_)};
10839     return ValuesIn(array);
10840   }
10841
10842  private:
10843   // No implementation - assignment is unsupported.
10844   void operator=(const ValueArray7& other);
10845
10846   const T1 v1_;
10847   const T2 v2_;
10848   const T3 v3_;
10849   const T4 v4_;
10850   const T5 v5_;
10851   const T6 v6_;
10852   const T7 v7_;
10853 };
10854
10855 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10856     typename T6, typename T7, typename T8>
10857 class ValueArray8 {
10858  public:
10859   ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
10860       T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10861       v8_(v8) {}
10862
10863   template <typename T>
10864   operator ParamGenerator<T>() const {
10865     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10866         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10867         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
10868     return ValuesIn(array);
10869   }
10870
10871  private:
10872   // No implementation - assignment is unsupported.
10873   void operator=(const ValueArray8& other);
10874
10875   const T1 v1_;
10876   const T2 v2_;
10877   const T3 v3_;
10878   const T4 v4_;
10879   const T5 v5_;
10880   const T6 v6_;
10881   const T7 v7_;
10882   const T8 v8_;
10883 };
10884
10885 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10886     typename T6, typename T7, typename T8, typename T9>
10887 class ValueArray9 {
10888  public:
10889   ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
10890       T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10891       v8_(v8), v9_(v9) {}
10892
10893   template <typename T>
10894   operator ParamGenerator<T>() const {
10895     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10896         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10897         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10898         static_cast<T>(v9_)};
10899     return ValuesIn(array);
10900   }
10901
10902  private:
10903   // No implementation - assignment is unsupported.
10904   void operator=(const ValueArray9& other);
10905
10906   const T1 v1_;
10907   const T2 v2_;
10908   const T3 v3_;
10909   const T4 v4_;
10910   const T5 v5_;
10911   const T6 v6_;
10912   const T7 v7_;
10913   const T8 v8_;
10914   const T9 v9_;
10915 };
10916
10917 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10918     typename T6, typename T7, typename T8, typename T9, typename T10>
10919 class ValueArray10 {
10920  public:
10921   ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10922       T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10923       v8_(v8), v9_(v9), v10_(v10) {}
10924
10925   template <typename T>
10926   operator ParamGenerator<T>() const {
10927     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10928         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10929         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10930         static_cast<T>(v9_), static_cast<T>(v10_)};
10931     return ValuesIn(array);
10932   }
10933
10934  private:
10935   // No implementation - assignment is unsupported.
10936   void operator=(const ValueArray10& other);
10937
10938   const T1 v1_;
10939   const T2 v2_;
10940   const T3 v3_;
10941   const T4 v4_;
10942   const T5 v5_;
10943   const T6 v6_;
10944   const T7 v7_;
10945   const T8 v8_;
10946   const T9 v9_;
10947   const T10 v10_;
10948 };
10949
10950 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10951     typename T6, typename T7, typename T8, typename T9, typename T10,
10952     typename T11>
10953 class ValueArray11 {
10954  public:
10955   ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10956       T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
10957       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
10958
10959   template <typename T>
10960   operator ParamGenerator<T>() const {
10961     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10962         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10963         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10964         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
10965     return ValuesIn(array);
10966   }
10967
10968  private:
10969   // No implementation - assignment is unsupported.
10970   void operator=(const ValueArray11& other);
10971
10972   const T1 v1_;
10973   const T2 v2_;
10974   const T3 v3_;
10975   const T4 v4_;
10976   const T5 v5_;
10977   const T6 v6_;
10978   const T7 v7_;
10979   const T8 v8_;
10980   const T9 v9_;
10981   const T10 v10_;
10982   const T11 v11_;
10983 };
10984
10985 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10986     typename T6, typename T7, typename T8, typename T9, typename T10,
10987     typename T11, typename T12>
10988 class ValueArray12 {
10989  public:
10990   ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10991       T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
10992       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
10993
10994   template <typename T>
10995   operator ParamGenerator<T>() const {
10996     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10997         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10998         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10999         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11000         static_cast<T>(v12_)};
11001     return ValuesIn(array);
11002   }
11003
11004  private:
11005   // No implementation - assignment is unsupported.
11006   void operator=(const ValueArray12& other);
11007
11008   const T1 v1_;
11009   const T2 v2_;
11010   const T3 v3_;
11011   const T4 v4_;
11012   const T5 v5_;
11013   const T6 v6_;
11014   const T7 v7_;
11015   const T8 v8_;
11016   const T9 v9_;
11017   const T10 v10_;
11018   const T11 v11_;
11019   const T12 v12_;
11020 };
11021
11022 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11023     typename T6, typename T7, typename T8, typename T9, typename T10,
11024     typename T11, typename T12, typename T13>
11025 class ValueArray13 {
11026  public:
11027   ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11028       T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11029       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11030       v12_(v12), v13_(v13) {}
11031
11032   template <typename T>
11033   operator ParamGenerator<T>() const {
11034     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11035         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11036         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11037         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11038         static_cast<T>(v12_), static_cast<T>(v13_)};
11039     return ValuesIn(array);
11040   }
11041
11042  private:
11043   // No implementation - assignment is unsupported.
11044   void operator=(const ValueArray13& other);
11045
11046   const T1 v1_;
11047   const T2 v2_;
11048   const T3 v3_;
11049   const T4 v4_;
11050   const T5 v5_;
11051   const T6 v6_;
11052   const T7 v7_;
11053   const T8 v8_;
11054   const T9 v9_;
11055   const T10 v10_;
11056   const T11 v11_;
11057   const T12 v12_;
11058   const T13 v13_;
11059 };
11060
11061 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11062     typename T6, typename T7, typename T8, typename T9, typename T10,
11063     typename T11, typename T12, typename T13, typename T14>
11064 class ValueArray14 {
11065  public:
11066   ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11067       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
11068       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11069       v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
11070
11071   template <typename T>
11072   operator ParamGenerator<T>() const {
11073     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11074         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11075         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11076         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11077         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
11078     return ValuesIn(array);
11079   }
11080
11081  private:
11082   // No implementation - assignment is unsupported.
11083   void operator=(const ValueArray14& other);
11084
11085   const T1 v1_;
11086   const T2 v2_;
11087   const T3 v3_;
11088   const T4 v4_;
11089   const T5 v5_;
11090   const T6 v6_;
11091   const T7 v7_;
11092   const T8 v8_;
11093   const T9 v9_;
11094   const T10 v10_;
11095   const T11 v11_;
11096   const T12 v12_;
11097   const T13 v13_;
11098   const T14 v14_;
11099 };
11100
11101 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11102     typename T6, typename T7, typename T8, typename T9, typename T10,
11103     typename T11, typename T12, typename T13, typename T14, typename T15>
11104 class ValueArray15 {
11105  public:
11106   ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11107       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
11108       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11109       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
11110
11111   template <typename T>
11112   operator ParamGenerator<T>() const {
11113     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11114         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11115         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11116         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11117         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11118         static_cast<T>(v15_)};
11119     return ValuesIn(array);
11120   }
11121
11122  private:
11123   // No implementation - assignment is unsupported.
11124   void operator=(const ValueArray15& other);
11125
11126   const T1 v1_;
11127   const T2 v2_;
11128   const T3 v3_;
11129   const T4 v4_;
11130   const T5 v5_;
11131   const T6 v6_;
11132   const T7 v7_;
11133   const T8 v8_;
11134   const T9 v9_;
11135   const T10 v10_;
11136   const T11 v11_;
11137   const T12 v12_;
11138   const T13 v13_;
11139   const T14 v14_;
11140   const T15 v15_;
11141 };
11142
11143 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11144     typename T6, typename T7, typename T8, typename T9, typename T10,
11145     typename T11, typename T12, typename T13, typename T14, typename T15,
11146     typename T16>
11147 class ValueArray16 {
11148  public:
11149   ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11150       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
11151       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11152       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11153       v16_(v16) {}
11154
11155   template <typename T>
11156   operator ParamGenerator<T>() const {
11157     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11158         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11159         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11160         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11161         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11162         static_cast<T>(v15_), static_cast<T>(v16_)};
11163     return ValuesIn(array);
11164   }
11165
11166  private:
11167   // No implementation - assignment is unsupported.
11168   void operator=(const ValueArray16& other);
11169
11170   const T1 v1_;
11171   const T2 v2_;
11172   const T3 v3_;
11173   const T4 v4_;
11174   const T5 v5_;
11175   const T6 v6_;
11176   const T7 v7_;
11177   const T8 v8_;
11178   const T9 v9_;
11179   const T10 v10_;
11180   const T11 v11_;
11181   const T12 v12_;
11182   const T13 v13_;
11183   const T14 v14_;
11184   const T15 v15_;
11185   const T16 v16_;
11186 };
11187
11188 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11189     typename T6, typename T7, typename T8, typename T9, typename T10,
11190     typename T11, typename T12, typename T13, typename T14, typename T15,
11191     typename T16, typename T17>
11192 class ValueArray17 {
11193  public:
11194   ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11195       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
11196       T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11197       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11198       v15_(v15), v16_(v16), v17_(v17) {}
11199
11200   template <typename T>
11201   operator ParamGenerator<T>() const {
11202     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11203         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11204         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11205         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11206         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11207         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
11208     return ValuesIn(array);
11209   }
11210
11211  private:
11212   // No implementation - assignment is unsupported.
11213   void operator=(const ValueArray17& other);
11214
11215   const T1 v1_;
11216   const T2 v2_;
11217   const T3 v3_;
11218   const T4 v4_;
11219   const T5 v5_;
11220   const T6 v6_;
11221   const T7 v7_;
11222   const T8 v8_;
11223   const T9 v9_;
11224   const T10 v10_;
11225   const T11 v11_;
11226   const T12 v12_;
11227   const T13 v13_;
11228   const T14 v14_;
11229   const T15 v15_;
11230   const T16 v16_;
11231   const T17 v17_;
11232 };
11233
11234 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11235     typename T6, typename T7, typename T8, typename T9, typename T10,
11236     typename T11, typename T12, typename T13, typename T14, typename T15,
11237     typename T16, typename T17, typename T18>
11238 class ValueArray18 {
11239  public:
11240   ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11241       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11242       T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11243       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11244       v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
11245
11246   template <typename T>
11247   operator ParamGenerator<T>() const {
11248     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11249         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11250         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11251         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11252         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11253         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11254         static_cast<T>(v18_)};
11255     return ValuesIn(array);
11256   }
11257
11258  private:
11259   // No implementation - assignment is unsupported.
11260   void operator=(const ValueArray18& other);
11261
11262   const T1 v1_;
11263   const T2 v2_;
11264   const T3 v3_;
11265   const T4 v4_;
11266   const T5 v5_;
11267   const T6 v6_;
11268   const T7 v7_;
11269   const T8 v8_;
11270   const T9 v9_;
11271   const T10 v10_;
11272   const T11 v11_;
11273   const T12 v12_;
11274   const T13 v13_;
11275   const T14 v14_;
11276   const T15 v15_;
11277   const T16 v16_;
11278   const T17 v17_;
11279   const T18 v18_;
11280 };
11281
11282 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11283     typename T6, typename T7, typename T8, typename T9, typename T10,
11284     typename T11, typename T12, typename T13, typename T14, typename T15,
11285     typename T16, typename T17, typename T18, typename T19>
11286 class ValueArray19 {
11287  public:
11288   ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11289       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11290       T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11291       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11292       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
11293
11294   template <typename T>
11295   operator ParamGenerator<T>() const {
11296     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11297         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11298         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11299         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11300         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11301         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11302         static_cast<T>(v18_), static_cast<T>(v19_)};
11303     return ValuesIn(array);
11304   }
11305
11306  private:
11307   // No implementation - assignment is unsupported.
11308   void operator=(const ValueArray19& other);
11309
11310   const T1 v1_;
11311   const T2 v2_;
11312   const T3 v3_;
11313   const T4 v4_;
11314   const T5 v5_;
11315   const T6 v6_;
11316   const T7 v7_;
11317   const T8 v8_;
11318   const T9 v9_;
11319   const T10 v10_;
11320   const T11 v11_;
11321   const T12 v12_;
11322   const T13 v13_;
11323   const T14 v14_;
11324   const T15 v15_;
11325   const T16 v16_;
11326   const T17 v17_;
11327   const T18 v18_;
11328   const T19 v19_;
11329 };
11330
11331 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11332     typename T6, typename T7, typename T8, typename T9, typename T10,
11333     typename T11, typename T12, typename T13, typename T14, typename T15,
11334     typename T16, typename T17, typename T18, typename T19, typename T20>
11335 class ValueArray20 {
11336  public:
11337   ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11338       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11339       T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11340       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11341       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11342       v19_(v19), v20_(v20) {}
11343
11344   template <typename T>
11345   operator ParamGenerator<T>() const {
11346     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11347         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11348         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11349         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11350         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11351         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11352         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
11353     return ValuesIn(array);
11354   }
11355
11356  private:
11357   // No implementation - assignment is unsupported.
11358   void operator=(const ValueArray20& other);
11359
11360   const T1 v1_;
11361   const T2 v2_;
11362   const T3 v3_;
11363   const T4 v4_;
11364   const T5 v5_;
11365   const T6 v6_;
11366   const T7 v7_;
11367   const T8 v8_;
11368   const T9 v9_;
11369   const T10 v10_;
11370   const T11 v11_;
11371   const T12 v12_;
11372   const T13 v13_;
11373   const T14 v14_;
11374   const T15 v15_;
11375   const T16 v16_;
11376   const T17 v17_;
11377   const T18 v18_;
11378   const T19 v19_;
11379   const T20 v20_;
11380 };
11381
11382 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11383     typename T6, typename T7, typename T8, typename T9, typename T10,
11384     typename T11, typename T12, typename T13, typename T14, typename T15,
11385     typename T16, typename T17, typename T18, typename T19, typename T20,
11386     typename T21>
11387 class ValueArray21 {
11388  public:
11389   ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11390       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11391       T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11392       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11393       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11394       v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
11395
11396   template <typename T>
11397   operator ParamGenerator<T>() const {
11398     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11399         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11400         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11401         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11402         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11403         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11404         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11405         static_cast<T>(v21_)};
11406     return ValuesIn(array);
11407   }
11408
11409  private:
11410   // No implementation - assignment is unsupported.
11411   void operator=(const ValueArray21& other);
11412
11413   const T1 v1_;
11414   const T2 v2_;
11415   const T3 v3_;
11416   const T4 v4_;
11417   const T5 v5_;
11418   const T6 v6_;
11419   const T7 v7_;
11420   const T8 v8_;
11421   const T9 v9_;
11422   const T10 v10_;
11423   const T11 v11_;
11424   const T12 v12_;
11425   const T13 v13_;
11426   const T14 v14_;
11427   const T15 v15_;
11428   const T16 v16_;
11429   const T17 v17_;
11430   const T18 v18_;
11431   const T19 v19_;
11432   const T20 v20_;
11433   const T21 v21_;
11434 };
11435
11436 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11437     typename T6, typename T7, typename T8, typename T9, typename T10,
11438     typename T11, typename T12, typename T13, typename T14, typename T15,
11439     typename T16, typename T17, typename T18, typename T19, typename T20,
11440     typename T21, typename T22>
11441 class ValueArray22 {
11442  public:
11443   ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11444       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11445       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
11446       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11447       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11448       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
11449
11450   template <typename T>
11451   operator ParamGenerator<T>() const {
11452     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11453         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11454         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11455         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11456         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11457         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11458         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11459         static_cast<T>(v21_), static_cast<T>(v22_)};
11460     return ValuesIn(array);
11461   }
11462
11463  private:
11464   // No implementation - assignment is unsupported.
11465   void operator=(const ValueArray22& other);
11466
11467   const T1 v1_;
11468   const T2 v2_;
11469   const T3 v3_;
11470   const T4 v4_;
11471   const T5 v5_;
11472   const T6 v6_;
11473   const T7 v7_;
11474   const T8 v8_;
11475   const T9 v9_;
11476   const T10 v10_;
11477   const T11 v11_;
11478   const T12 v12_;
11479   const T13 v13_;
11480   const T14 v14_;
11481   const T15 v15_;
11482   const T16 v16_;
11483   const T17 v17_;
11484   const T18 v18_;
11485   const T19 v19_;
11486   const T20 v20_;
11487   const T21 v21_;
11488   const T22 v22_;
11489 };
11490
11491 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11492     typename T6, typename T7, typename T8, typename T9, typename T10,
11493     typename T11, typename T12, typename T13, typename T14, typename T15,
11494     typename T16, typename T17, typename T18, typename T19, typename T20,
11495     typename T21, typename T22, typename T23>
11496 class ValueArray23 {
11497  public:
11498   ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11499       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11500       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
11501       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11502       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11503       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11504       v23_(v23) {}
11505
11506   template <typename T>
11507   operator ParamGenerator<T>() const {
11508     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11509         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11510         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11511         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11512         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11513         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11514         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11515         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
11516     return ValuesIn(array);
11517   }
11518
11519  private:
11520   // No implementation - assignment is unsupported.
11521   void operator=(const ValueArray23& other);
11522
11523   const T1 v1_;
11524   const T2 v2_;
11525   const T3 v3_;
11526   const T4 v4_;
11527   const T5 v5_;
11528   const T6 v6_;
11529   const T7 v7_;
11530   const T8 v8_;
11531   const T9 v9_;
11532   const T10 v10_;
11533   const T11 v11_;
11534   const T12 v12_;
11535   const T13 v13_;
11536   const T14 v14_;
11537   const T15 v15_;
11538   const T16 v16_;
11539   const T17 v17_;
11540   const T18 v18_;
11541   const T19 v19_;
11542   const T20 v20_;
11543   const T21 v21_;
11544   const T22 v22_;
11545   const T23 v23_;
11546 };
11547
11548 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11549     typename T6, typename T7, typename T8, typename T9, typename T10,
11550     typename T11, typename T12, typename T13, typename T14, typename T15,
11551     typename T16, typename T17, typename T18, typename T19, typename T20,
11552     typename T21, typename T22, typename T23, typename T24>
11553 class ValueArray24 {
11554  public:
11555   ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11556       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11557       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
11558       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11559       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11560       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
11561       v22_(v22), v23_(v23), v24_(v24) {}
11562
11563   template <typename T>
11564   operator ParamGenerator<T>() const {
11565     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11566         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11567         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11568         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11569         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11570         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11571         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11572         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11573         static_cast<T>(v24_)};
11574     return ValuesIn(array);
11575   }
11576
11577  private:
11578   // No implementation - assignment is unsupported.
11579   void operator=(const ValueArray24& other);
11580
11581   const T1 v1_;
11582   const T2 v2_;
11583   const T3 v3_;
11584   const T4 v4_;
11585   const T5 v5_;
11586   const T6 v6_;
11587   const T7 v7_;
11588   const T8 v8_;
11589   const T9 v9_;
11590   const T10 v10_;
11591   const T11 v11_;
11592   const T12 v12_;
11593   const T13 v13_;
11594   const T14 v14_;
11595   const T15 v15_;
11596   const T16 v16_;
11597   const T17 v17_;
11598   const T18 v18_;
11599   const T19 v19_;
11600   const T20 v20_;
11601   const T21 v21_;
11602   const T22 v22_;
11603   const T23 v23_;
11604   const T24 v24_;
11605 };
11606
11607 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11608     typename T6, typename T7, typename T8, typename T9, typename T10,
11609     typename T11, typename T12, typename T13, typename T14, typename T15,
11610     typename T16, typename T17, typename T18, typename T19, typename T20,
11611     typename T21, typename T22, typename T23, typename T24, typename T25>
11612 class ValueArray25 {
11613  public:
11614   ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11615       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11616       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
11617       T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11618       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11619       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11620       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
11621
11622   template <typename T>
11623   operator ParamGenerator<T>() const {
11624     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11625         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11626         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11627         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11628         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11629         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11630         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11631         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11632         static_cast<T>(v24_), static_cast<T>(v25_)};
11633     return ValuesIn(array);
11634   }
11635
11636  private:
11637   // No implementation - assignment is unsupported.
11638   void operator=(const ValueArray25& other);
11639
11640   const T1 v1_;
11641   const T2 v2_;
11642   const T3 v3_;
11643   const T4 v4_;
11644   const T5 v5_;
11645   const T6 v6_;
11646   const T7 v7_;
11647   const T8 v8_;
11648   const T9 v9_;
11649   const T10 v10_;
11650   const T11 v11_;
11651   const T12 v12_;
11652   const T13 v13_;
11653   const T14 v14_;
11654   const T15 v15_;
11655   const T16 v16_;
11656   const T17 v17_;
11657   const T18 v18_;
11658   const T19 v19_;
11659   const T20 v20_;
11660   const T21 v21_;
11661   const T22 v22_;
11662   const T23 v23_;
11663   const T24 v24_;
11664   const T25 v25_;
11665 };
11666
11667 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11668     typename T6, typename T7, typename T8, typename T9, typename T10,
11669     typename T11, typename T12, typename T13, typename T14, typename T15,
11670     typename T16, typename T17, typename T18, typename T19, typename T20,
11671     typename T21, typename T22, typename T23, typename T24, typename T25,
11672     typename T26>
11673 class ValueArray26 {
11674  public:
11675   ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11676       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11677       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11678       T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11679       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11680       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11681       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
11682
11683   template <typename T>
11684   operator ParamGenerator<T>() const {
11685     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11686         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11687         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11688         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11689         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11690         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11691         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11692         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11693         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
11694     return ValuesIn(array);
11695   }
11696
11697  private:
11698   // No implementation - assignment is unsupported.
11699   void operator=(const ValueArray26& other);
11700
11701   const T1 v1_;
11702   const T2 v2_;
11703   const T3 v3_;
11704   const T4 v4_;
11705   const T5 v5_;
11706   const T6 v6_;
11707   const T7 v7_;
11708   const T8 v8_;
11709   const T9 v9_;
11710   const T10 v10_;
11711   const T11 v11_;
11712   const T12 v12_;
11713   const T13 v13_;
11714   const T14 v14_;
11715   const T15 v15_;
11716   const T16 v16_;
11717   const T17 v17_;
11718   const T18 v18_;
11719   const T19 v19_;
11720   const T20 v20_;
11721   const T21 v21_;
11722   const T22 v22_;
11723   const T23 v23_;
11724   const T24 v24_;
11725   const T25 v25_;
11726   const T26 v26_;
11727 };
11728
11729 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11730     typename T6, typename T7, typename T8, typename T9, typename T10,
11731     typename T11, typename T12, typename T13, typename T14, typename T15,
11732     typename T16, typename T17, typename T18, typename T19, typename T20,
11733     typename T21, typename T22, typename T23, typename T24, typename T25,
11734     typename T26, typename T27>
11735 class ValueArray27 {
11736  public:
11737   ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11738       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11739       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11740       T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11741       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11742       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
11743       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
11744       v26_(v26), v27_(v27) {}
11745
11746   template <typename T>
11747   operator ParamGenerator<T>() const {
11748     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11749         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11750         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11751         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11752         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11753         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11754         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11755         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11756         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11757         static_cast<T>(v27_)};
11758     return ValuesIn(array);
11759   }
11760
11761  private:
11762   // No implementation - assignment is unsupported.
11763   void operator=(const ValueArray27& other);
11764
11765   const T1 v1_;
11766   const T2 v2_;
11767   const T3 v3_;
11768   const T4 v4_;
11769   const T5 v5_;
11770   const T6 v6_;
11771   const T7 v7_;
11772   const T8 v8_;
11773   const T9 v9_;
11774   const T10 v10_;
11775   const T11 v11_;
11776   const T12 v12_;
11777   const T13 v13_;
11778   const T14 v14_;
11779   const T15 v15_;
11780   const T16 v16_;
11781   const T17 v17_;
11782   const T18 v18_;
11783   const T19 v19_;
11784   const T20 v20_;
11785   const T21 v21_;
11786   const T22 v22_;
11787   const T23 v23_;
11788   const T24 v24_;
11789   const T25 v25_;
11790   const T26 v26_;
11791   const T27 v27_;
11792 };
11793
11794 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11795     typename T6, typename T7, typename T8, typename T9, typename T10,
11796     typename T11, typename T12, typename T13, typename T14, typename T15,
11797     typename T16, typename T17, typename T18, typename T19, typename T20,
11798     typename T21, typename T22, typename T23, typename T24, typename T25,
11799     typename T26, typename T27, typename T28>
11800 class ValueArray28 {
11801  public:
11802   ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11803       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11804       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11805       T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11806       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11807       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11808       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
11809       v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
11810
11811   template <typename T>
11812   operator ParamGenerator<T>() const {
11813     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11814         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11815         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11816         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11817         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11818         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11819         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11820         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11821         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11822         static_cast<T>(v27_), static_cast<T>(v28_)};
11823     return ValuesIn(array);
11824   }
11825
11826  private:
11827   // No implementation - assignment is unsupported.
11828   void operator=(const ValueArray28& other);
11829
11830   const T1 v1_;
11831   const T2 v2_;
11832   const T3 v3_;
11833   const T4 v4_;
11834   const T5 v5_;
11835   const T6 v6_;
11836   const T7 v7_;
11837   const T8 v8_;
11838   const T9 v9_;
11839   const T10 v10_;
11840   const T11 v11_;
11841   const T12 v12_;
11842   const T13 v13_;
11843   const T14 v14_;
11844   const T15 v15_;
11845   const T16 v16_;
11846   const T17 v17_;
11847   const T18 v18_;
11848   const T19 v19_;
11849   const T20 v20_;
11850   const T21 v21_;
11851   const T22 v22_;
11852   const T23 v23_;
11853   const T24 v24_;
11854   const T25 v25_;
11855   const T26 v26_;
11856   const T27 v27_;
11857   const T28 v28_;
11858 };
11859
11860 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11861     typename T6, typename T7, typename T8, typename T9, typename T10,
11862     typename T11, typename T12, typename T13, typename T14, typename T15,
11863     typename T16, typename T17, typename T18, typename T19, typename T20,
11864     typename T21, typename T22, typename T23, typename T24, typename T25,
11865     typename T26, typename T27, typename T28, typename T29>
11866 class ValueArray29 {
11867  public:
11868   ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11869       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11870       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11871       T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11872       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11873       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11874       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
11875       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
11876
11877   template <typename T>
11878   operator ParamGenerator<T>() const {
11879     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11880         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11881         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11882         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11883         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11884         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11885         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11886         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11887         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11888         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
11889     return ValuesIn(array);
11890   }
11891
11892  private:
11893   // No implementation - assignment is unsupported.
11894   void operator=(const ValueArray29& other);
11895
11896   const T1 v1_;
11897   const T2 v2_;
11898   const T3 v3_;
11899   const T4 v4_;
11900   const T5 v5_;
11901   const T6 v6_;
11902   const T7 v7_;
11903   const T8 v8_;
11904   const T9 v9_;
11905   const T10 v10_;
11906   const T11 v11_;
11907   const T12 v12_;
11908   const T13 v13_;
11909   const T14 v14_;
11910   const T15 v15_;
11911   const T16 v16_;
11912   const T17 v17_;
11913   const T18 v18_;
11914   const T19 v19_;
11915   const T20 v20_;
11916   const T21 v21_;
11917   const T22 v22_;
11918   const T23 v23_;
11919   const T24 v24_;
11920   const T25 v25_;
11921   const T26 v26_;
11922   const T27 v27_;
11923   const T28 v28_;
11924   const T29 v29_;
11925 };
11926
11927 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11928     typename T6, typename T7, typename T8, typename T9, typename T10,
11929     typename T11, typename T12, typename T13, typename T14, typename T15,
11930     typename T16, typename T17, typename T18, typename T19, typename T20,
11931     typename T21, typename T22, typename T23, typename T24, typename T25,
11932     typename T26, typename T27, typename T28, typename T29, typename T30>
11933 class ValueArray30 {
11934  public:
11935   ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11936       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11937       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11938       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
11939       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11940       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11941       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11942       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
11943       v29_(v29), v30_(v30) {}
11944
11945   template <typename T>
11946   operator ParamGenerator<T>() const {
11947     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11948         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11949         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11950         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11951         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11952         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11953         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11954         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11955         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11956         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
11957         static_cast<T>(v30_)};
11958     return ValuesIn(array);
11959   }
11960
11961  private:
11962   // No implementation - assignment is unsupported.
11963   void operator=(const ValueArray30& other);
11964
11965   const T1 v1_;
11966   const T2 v2_;
11967   const T3 v3_;
11968   const T4 v4_;
11969   const T5 v5_;
11970   const T6 v6_;
11971   const T7 v7_;
11972   const T8 v8_;
11973   const T9 v9_;
11974   const T10 v10_;
11975   const T11 v11_;
11976   const T12 v12_;
11977   const T13 v13_;
11978   const T14 v14_;
11979   const T15 v15_;
11980   const T16 v16_;
11981   const T17 v17_;
11982   const T18 v18_;
11983   const T19 v19_;
11984   const T20 v20_;
11985   const T21 v21_;
11986   const T22 v22_;
11987   const T23 v23_;
11988   const T24 v24_;
11989   const T25 v25_;
11990   const T26 v26_;
11991   const T27 v27_;
11992   const T28 v28_;
11993   const T29 v29_;
11994   const T30 v30_;
11995 };
11996
11997 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11998     typename T6, typename T7, typename T8, typename T9, typename T10,
11999     typename T11, typename T12, typename T13, typename T14, typename T15,
12000     typename T16, typename T17, typename T18, typename T19, typename T20,
12001     typename T21, typename T22, typename T23, typename T24, typename T25,
12002     typename T26, typename T27, typename T28, typename T29, typename T30,
12003     typename T31>
12004 class ValueArray31 {
12005  public:
12006   ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12007       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12008       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12009       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
12010       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12011       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12012       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12013       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12014       v29_(v29), v30_(v30), v31_(v31) {}
12015
12016   template <typename T>
12017   operator ParamGenerator<T>() const {
12018     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12019         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12020         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12021         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12022         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12023         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12024         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12025         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12026         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12027         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12028         static_cast<T>(v30_), static_cast<T>(v31_)};
12029     return ValuesIn(array);
12030   }
12031
12032  private:
12033   // No implementation - assignment is unsupported.
12034   void operator=(const ValueArray31& other);
12035
12036   const T1 v1_;
12037   const T2 v2_;
12038   const T3 v3_;
12039   const T4 v4_;
12040   const T5 v5_;
12041   const T6 v6_;
12042   const T7 v7_;
12043   const T8 v8_;
12044   const T9 v9_;
12045   const T10 v10_;
12046   const T11 v11_;
12047   const T12 v12_;
12048   const T13 v13_;
12049   const T14 v14_;
12050   const T15 v15_;
12051   const T16 v16_;
12052   const T17 v17_;
12053   const T18 v18_;
12054   const T19 v19_;
12055   const T20 v20_;
12056   const T21 v21_;
12057   const T22 v22_;
12058   const T23 v23_;
12059   const T24 v24_;
12060   const T25 v25_;
12061   const T26 v26_;
12062   const T27 v27_;
12063   const T28 v28_;
12064   const T29 v29_;
12065   const T30 v30_;
12066   const T31 v31_;
12067 };
12068
12069 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12070     typename T6, typename T7, typename T8, typename T9, typename T10,
12071     typename T11, typename T12, typename T13, typename T14, typename T15,
12072     typename T16, typename T17, typename T18, typename T19, typename T20,
12073     typename T21, typename T22, typename T23, typename T24, typename T25,
12074     typename T26, typename T27, typename T28, typename T29, typename T30,
12075     typename T31, typename T32>
12076 class ValueArray32 {
12077  public:
12078   ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12079       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12080       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12081       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
12082       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12083       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12084       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12085       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12086       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
12087
12088   template <typename T>
12089   operator ParamGenerator<T>() const {
12090     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12091         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12092         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12093         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12094         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12095         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12096         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12097         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12098         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12099         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12100         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
12101     return ValuesIn(array);
12102   }
12103
12104  private:
12105   // No implementation - assignment is unsupported.
12106   void operator=(const ValueArray32& other);
12107
12108   const T1 v1_;
12109   const T2 v2_;
12110   const T3 v3_;
12111   const T4 v4_;
12112   const T5 v5_;
12113   const T6 v6_;
12114   const T7 v7_;
12115   const T8 v8_;
12116   const T9 v9_;
12117   const T10 v10_;
12118   const T11 v11_;
12119   const T12 v12_;
12120   const T13 v13_;
12121   const T14 v14_;
12122   const T15 v15_;
12123   const T16 v16_;
12124   const T17 v17_;
12125   const T18 v18_;
12126   const T19 v19_;
12127   const T20 v20_;
12128   const T21 v21_;
12129   const T22 v22_;
12130   const T23 v23_;
12131   const T24 v24_;
12132   const T25 v25_;
12133   const T26 v26_;
12134   const T27 v27_;
12135   const T28 v28_;
12136   const T29 v29_;
12137   const T30 v30_;
12138   const T31 v31_;
12139   const T32 v32_;
12140 };
12141
12142 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12143     typename T6, typename T7, typename T8, typename T9, typename T10,
12144     typename T11, typename T12, typename T13, typename T14, typename T15,
12145     typename T16, typename T17, typename T18, typename T19, typename T20,
12146     typename T21, typename T22, typename T23, typename T24, typename T25,
12147     typename T26, typename T27, typename T28, typename T29, typename T30,
12148     typename T31, typename T32, typename T33>
12149 class ValueArray33 {
12150  public:
12151   ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12152       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12153       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12154       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
12155       T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12156       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12157       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12158       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12159       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12160       v33_(v33) {}
12161
12162   template <typename T>
12163   operator ParamGenerator<T>() const {
12164     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12165         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12166         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12167         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12168         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12169         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12170         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12171         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12172         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12173         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12174         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12175         static_cast<T>(v33_)};
12176     return ValuesIn(array);
12177   }
12178
12179  private:
12180   // No implementation - assignment is unsupported.
12181   void operator=(const ValueArray33& other);
12182
12183   const T1 v1_;
12184   const T2 v2_;
12185   const T3 v3_;
12186   const T4 v4_;
12187   const T5 v5_;
12188   const T6 v6_;
12189   const T7 v7_;
12190   const T8 v8_;
12191   const T9 v9_;
12192   const T10 v10_;
12193   const T11 v11_;
12194   const T12 v12_;
12195   const T13 v13_;
12196   const T14 v14_;
12197   const T15 v15_;
12198   const T16 v16_;
12199   const T17 v17_;
12200   const T18 v18_;
12201   const T19 v19_;
12202   const T20 v20_;
12203   const T21 v21_;
12204   const T22 v22_;
12205   const T23 v23_;
12206   const T24 v24_;
12207   const T25 v25_;
12208   const T26 v26_;
12209   const T27 v27_;
12210   const T28 v28_;
12211   const T29 v29_;
12212   const T30 v30_;
12213   const T31 v31_;
12214   const T32 v32_;
12215   const T33 v33_;
12216 };
12217
12218 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12219     typename T6, typename T7, typename T8, typename T9, typename T10,
12220     typename T11, typename T12, typename T13, typename T14, typename T15,
12221     typename T16, typename T17, typename T18, typename T19, typename T20,
12222     typename T21, typename T22, typename T23, typename T24, typename T25,
12223     typename T26, typename T27, typename T28, typename T29, typename T30,
12224     typename T31, typename T32, typename T33, typename T34>
12225 class ValueArray34 {
12226  public:
12227   ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12228       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12229       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12230       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12231       T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12232       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12233       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12234       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12235       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12236       v33_(v33), v34_(v34) {}
12237
12238   template <typename T>
12239   operator ParamGenerator<T>() const {
12240     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12241         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12242         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12243         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12244         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12245         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12246         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12247         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12248         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12249         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12250         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12251         static_cast<T>(v33_), static_cast<T>(v34_)};
12252     return ValuesIn(array);
12253   }
12254
12255  private:
12256   // No implementation - assignment is unsupported.
12257   void operator=(const ValueArray34& other);
12258
12259   const T1 v1_;
12260   const T2 v2_;
12261   const T3 v3_;
12262   const T4 v4_;
12263   const T5 v5_;
12264   const T6 v6_;
12265   const T7 v7_;
12266   const T8 v8_;
12267   const T9 v9_;
12268   const T10 v10_;
12269   const T11 v11_;
12270   const T12 v12_;
12271   const T13 v13_;
12272   const T14 v14_;
12273   const T15 v15_;
12274   const T16 v16_;
12275   const T17 v17_;
12276   const T18 v18_;
12277   const T19 v19_;
12278   const T20 v20_;
12279   const T21 v21_;
12280   const T22 v22_;
12281   const T23 v23_;
12282   const T24 v24_;
12283   const T25 v25_;
12284   const T26 v26_;
12285   const T27 v27_;
12286   const T28 v28_;
12287   const T29 v29_;
12288   const T30 v30_;
12289   const T31 v31_;
12290   const T32 v32_;
12291   const T33 v33_;
12292   const T34 v34_;
12293 };
12294
12295 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12296     typename T6, typename T7, typename T8, typename T9, typename T10,
12297     typename T11, typename T12, typename T13, typename T14, typename T15,
12298     typename T16, typename T17, typename T18, typename T19, typename T20,
12299     typename T21, typename T22, typename T23, typename T24, typename T25,
12300     typename T26, typename T27, typename T28, typename T29, typename T30,
12301     typename T31, typename T32, typename T33, typename T34, typename T35>
12302 class ValueArray35 {
12303  public:
12304   ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12305       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12306       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12307       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12308       T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12309       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12310       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12311       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12312       v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12313       v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
12314
12315   template <typename T>
12316   operator ParamGenerator<T>() const {
12317     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12318         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12319         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12320         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12321         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12322         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12323         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12324         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12325         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12326         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12327         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12328         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
12329     return ValuesIn(array);
12330   }
12331
12332  private:
12333   // No implementation - assignment is unsupported.
12334   void operator=(const ValueArray35& other);
12335
12336   const T1 v1_;
12337   const T2 v2_;
12338   const T3 v3_;
12339   const T4 v4_;
12340   const T5 v5_;
12341   const T6 v6_;
12342   const T7 v7_;
12343   const T8 v8_;
12344   const T9 v9_;
12345   const T10 v10_;
12346   const T11 v11_;
12347   const T12 v12_;
12348   const T13 v13_;
12349   const T14 v14_;
12350   const T15 v15_;
12351   const T16 v16_;
12352   const T17 v17_;
12353   const T18 v18_;
12354   const T19 v19_;
12355   const T20 v20_;
12356   const T21 v21_;
12357   const T22 v22_;
12358   const T23 v23_;
12359   const T24 v24_;
12360   const T25 v25_;
12361   const T26 v26_;
12362   const T27 v27_;
12363   const T28 v28_;
12364   const T29 v29_;
12365   const T30 v30_;
12366   const T31 v31_;
12367   const T32 v32_;
12368   const T33 v33_;
12369   const T34 v34_;
12370   const T35 v35_;
12371 };
12372
12373 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12374     typename T6, typename T7, typename T8, typename T9, typename T10,
12375     typename T11, typename T12, typename T13, typename T14, typename T15,
12376     typename T16, typename T17, typename T18, typename T19, typename T20,
12377     typename T21, typename T22, typename T23, typename T24, typename T25,
12378     typename T26, typename T27, typename T28, typename T29, typename T30,
12379     typename T31, typename T32, typename T33, typename T34, typename T35,
12380     typename T36>
12381 class ValueArray36 {
12382  public:
12383   ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12384       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12385       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12386       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12387       T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12388       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12389       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12390       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
12391       v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
12392       v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
12393
12394   template <typename T>
12395   operator ParamGenerator<T>() const {
12396     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12397         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12398         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12399         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12400         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12401         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12402         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12403         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12404         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12405         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12406         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12407         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12408         static_cast<T>(v36_)};
12409     return ValuesIn(array);
12410   }
12411
12412  private:
12413   // No implementation - assignment is unsupported.
12414   void operator=(const ValueArray36& other);
12415
12416   const T1 v1_;
12417   const T2 v2_;
12418   const T3 v3_;
12419   const T4 v4_;
12420   const T5 v5_;
12421   const T6 v6_;
12422   const T7 v7_;
12423   const T8 v8_;
12424   const T9 v9_;
12425   const T10 v10_;
12426   const T11 v11_;
12427   const T12 v12_;
12428   const T13 v13_;
12429   const T14 v14_;
12430   const T15 v15_;
12431   const T16 v16_;
12432   const T17 v17_;
12433   const T18 v18_;
12434   const T19 v19_;
12435   const T20 v20_;
12436   const T21 v21_;
12437   const T22 v22_;
12438   const T23 v23_;
12439   const T24 v24_;
12440   const T25 v25_;
12441   const T26 v26_;
12442   const T27 v27_;
12443   const T28 v28_;
12444   const T29 v29_;
12445   const T30 v30_;
12446   const T31 v31_;
12447   const T32 v32_;
12448   const T33 v33_;
12449   const T34 v34_;
12450   const T35 v35_;
12451   const T36 v36_;
12452 };
12453
12454 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12455     typename T6, typename T7, typename T8, typename T9, typename T10,
12456     typename T11, typename T12, typename T13, typename T14, typename T15,
12457     typename T16, typename T17, typename T18, typename T19, typename T20,
12458     typename T21, typename T22, typename T23, typename T24, typename T25,
12459     typename T26, typename T27, typename T28, typename T29, typename T30,
12460     typename T31, typename T32, typename T33, typename T34, typename T35,
12461     typename T36, typename T37>
12462 class ValueArray37 {
12463  public:
12464   ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12465       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12466       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12467       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12468       T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12469       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12470       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
12471       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
12472       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
12473       v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
12474       v36_(v36), v37_(v37) {}
12475
12476   template <typename T>
12477   operator ParamGenerator<T>() const {
12478     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12479         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12480         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12481         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12482         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12483         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12484         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12485         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12486         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12487         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12488         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12489         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12490         static_cast<T>(v36_), static_cast<T>(v37_)};
12491     return ValuesIn(array);
12492   }
12493
12494  private:
12495   // No implementation - assignment is unsupported.
12496   void operator=(const ValueArray37& other);
12497
12498   const T1 v1_;
12499   const T2 v2_;
12500   const T3 v3_;
12501   const T4 v4_;
12502   const T5 v5_;
12503   const T6 v6_;
12504   const T7 v7_;
12505   const T8 v8_;
12506   const T9 v9_;
12507   const T10 v10_;
12508   const T11 v11_;
12509   const T12 v12_;
12510   const T13 v13_;
12511   const T14 v14_;
12512   const T15 v15_;
12513   const T16 v16_;
12514   const T17 v17_;
12515   const T18 v18_;
12516   const T19 v19_;
12517   const T20 v20_;
12518   const T21 v21_;
12519   const T22 v22_;
12520   const T23 v23_;
12521   const T24 v24_;
12522   const T25 v25_;
12523   const T26 v26_;
12524   const T27 v27_;
12525   const T28 v28_;
12526   const T29 v29_;
12527   const T30 v30_;
12528   const T31 v31_;
12529   const T32 v32_;
12530   const T33 v33_;
12531   const T34 v34_;
12532   const T35 v35_;
12533   const T36 v36_;
12534   const T37 v37_;
12535 };
12536
12537 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12538     typename T6, typename T7, typename T8, typename T9, typename T10,
12539     typename T11, typename T12, typename T13, typename T14, typename T15,
12540     typename T16, typename T17, typename T18, typename T19, typename T20,
12541     typename T21, typename T22, typename T23, typename T24, typename T25,
12542     typename T26, typename T27, typename T28, typename T29, typename T30,
12543     typename T31, typename T32, typename T33, typename T34, typename T35,
12544     typename T36, typename T37, typename T38>
12545 class ValueArray38 {
12546  public:
12547   ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12548       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12549       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12550       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12551       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
12552       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12553       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12554       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12555       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12556       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12557       v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
12558
12559   template <typename T>
12560   operator ParamGenerator<T>() const {
12561     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12562         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12563         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12564         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12565         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12566         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12567         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12568         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12569         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12570         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12571         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12572         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12573         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
12574     return ValuesIn(array);
12575   }
12576
12577  private:
12578   // No implementation - assignment is unsupported.
12579   void operator=(const ValueArray38& other);
12580
12581   const T1 v1_;
12582   const T2 v2_;
12583   const T3 v3_;
12584   const T4 v4_;
12585   const T5 v5_;
12586   const T6 v6_;
12587   const T7 v7_;
12588   const T8 v8_;
12589   const T9 v9_;
12590   const T10 v10_;
12591   const T11 v11_;
12592   const T12 v12_;
12593   const T13 v13_;
12594   const T14 v14_;
12595   const T15 v15_;
12596   const T16 v16_;
12597   const T17 v17_;
12598   const T18 v18_;
12599   const T19 v19_;
12600   const T20 v20_;
12601   const T21 v21_;
12602   const T22 v22_;
12603   const T23 v23_;
12604   const T24 v24_;
12605   const T25 v25_;
12606   const T26 v26_;
12607   const T27 v27_;
12608   const T28 v28_;
12609   const T29 v29_;
12610   const T30 v30_;
12611   const T31 v31_;
12612   const T32 v32_;
12613   const T33 v33_;
12614   const T34 v34_;
12615   const T35 v35_;
12616   const T36 v36_;
12617   const T37 v37_;
12618   const T38 v38_;
12619 };
12620
12621 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12622     typename T6, typename T7, typename T8, typename T9, typename T10,
12623     typename T11, typename T12, typename T13, typename T14, typename T15,
12624     typename T16, typename T17, typename T18, typename T19, typename T20,
12625     typename T21, typename T22, typename T23, typename T24, typename T25,
12626     typename T26, typename T27, typename T28, typename T29, typename T30,
12627     typename T31, typename T32, typename T33, typename T34, typename T35,
12628     typename T36, typename T37, typename T38, typename T39>
12629 class ValueArray39 {
12630  public:
12631   ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12632       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12633       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12634       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12635       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
12636       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12637       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12638       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12639       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12640       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12641       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
12642
12643   template <typename T>
12644   operator ParamGenerator<T>() const {
12645     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12646         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12647         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12648         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12649         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12650         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12651         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12652         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12653         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12654         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12655         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12656         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12657         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12658         static_cast<T>(v39_)};
12659     return ValuesIn(array);
12660   }
12661
12662  private:
12663   // No implementation - assignment is unsupported.
12664   void operator=(const ValueArray39& other);
12665
12666   const T1 v1_;
12667   const T2 v2_;
12668   const T3 v3_;
12669   const T4 v4_;
12670   const T5 v5_;
12671   const T6 v6_;
12672   const T7 v7_;
12673   const T8 v8_;
12674   const T9 v9_;
12675   const T10 v10_;
12676   const T11 v11_;
12677   const T12 v12_;
12678   const T13 v13_;
12679   const T14 v14_;
12680   const T15 v15_;
12681   const T16 v16_;
12682   const T17 v17_;
12683   const T18 v18_;
12684   const T19 v19_;
12685   const T20 v20_;
12686   const T21 v21_;
12687   const T22 v22_;
12688   const T23 v23_;
12689   const T24 v24_;
12690   const T25 v25_;
12691   const T26 v26_;
12692   const T27 v27_;
12693   const T28 v28_;
12694   const T29 v29_;
12695   const T30 v30_;
12696   const T31 v31_;
12697   const T32 v32_;
12698   const T33 v33_;
12699   const T34 v34_;
12700   const T35 v35_;
12701   const T36 v36_;
12702   const T37 v37_;
12703   const T38 v38_;
12704   const T39 v39_;
12705 };
12706
12707 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12708     typename T6, typename T7, typename T8, typename T9, typename T10,
12709     typename T11, typename T12, typename T13, typename T14, typename T15,
12710     typename T16, typename T17, typename T18, typename T19, typename T20,
12711     typename T21, typename T22, typename T23, typename T24, typename T25,
12712     typename T26, typename T27, typename T28, typename T29, typename T30,
12713     typename T31, typename T32, typename T33, typename T34, typename T35,
12714     typename T36, typename T37, typename T38, typename T39, typename T40>
12715 class ValueArray40 {
12716  public:
12717   ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12718       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12719       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12720       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12721       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
12722       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12723       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12724       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12725       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12726       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
12727       v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
12728       v40_(v40) {}
12729
12730   template <typename T>
12731   operator ParamGenerator<T>() const {
12732     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12733         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12734         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12735         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12736         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12737         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12738         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12739         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12740         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12741         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12742         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12743         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12744         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12745         static_cast<T>(v39_), static_cast<T>(v40_)};
12746     return ValuesIn(array);
12747   }
12748
12749  private:
12750   // No implementation - assignment is unsupported.
12751   void operator=(const ValueArray40& other);
12752
12753   const T1 v1_;
12754   const T2 v2_;
12755   const T3 v3_;
12756   const T4 v4_;
12757   const T5 v5_;
12758   const T6 v6_;
12759   const T7 v7_;
12760   const T8 v8_;
12761   const T9 v9_;
12762   const T10 v10_;
12763   const T11 v11_;
12764   const T12 v12_;
12765   const T13 v13_;
12766   const T14 v14_;
12767   const T15 v15_;
12768   const T16 v16_;
12769   const T17 v17_;
12770   const T18 v18_;
12771   const T19 v19_;
12772   const T20 v20_;
12773   const T21 v21_;
12774   const T22 v22_;
12775   const T23 v23_;
12776   const T24 v24_;
12777   const T25 v25_;
12778   const T26 v26_;
12779   const T27 v27_;
12780   const T28 v28_;
12781   const T29 v29_;
12782   const T30 v30_;
12783   const T31 v31_;
12784   const T32 v32_;
12785   const T33 v33_;
12786   const T34 v34_;
12787   const T35 v35_;
12788   const T36 v36_;
12789   const T37 v37_;
12790   const T38 v38_;
12791   const T39 v39_;
12792   const T40 v40_;
12793 };
12794
12795 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12796     typename T6, typename T7, typename T8, typename T9, typename T10,
12797     typename T11, typename T12, typename T13, typename T14, typename T15,
12798     typename T16, typename T17, typename T18, typename T19, typename T20,
12799     typename T21, typename T22, typename T23, typename T24, typename T25,
12800     typename T26, typename T27, typename T28, typename T29, typename T30,
12801     typename T31, typename T32, typename T33, typename T34, typename T35,
12802     typename T36, typename T37, typename T38, typename T39, typename T40,
12803     typename T41>
12804 class ValueArray41 {
12805  public:
12806   ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12807       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12808       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12809       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12810       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
12811       T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12812       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12813       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12814       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12815       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12816       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12817       v39_(v39), v40_(v40), v41_(v41) {}
12818
12819   template <typename T>
12820   operator ParamGenerator<T>() const {
12821     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12822         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12823         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12824         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12825         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12826         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12827         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12828         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12829         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12830         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12831         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12832         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12833         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12834         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
12835     return ValuesIn(array);
12836   }
12837
12838  private:
12839   // No implementation - assignment is unsupported.
12840   void operator=(const ValueArray41& other);
12841
12842   const T1 v1_;
12843   const T2 v2_;
12844   const T3 v3_;
12845   const T4 v4_;
12846   const T5 v5_;
12847   const T6 v6_;
12848   const T7 v7_;
12849   const T8 v8_;
12850   const T9 v9_;
12851   const T10 v10_;
12852   const T11 v11_;
12853   const T12 v12_;
12854   const T13 v13_;
12855   const T14 v14_;
12856   const T15 v15_;
12857   const T16 v16_;
12858   const T17 v17_;
12859   const T18 v18_;
12860   const T19 v19_;
12861   const T20 v20_;
12862   const T21 v21_;
12863   const T22 v22_;
12864   const T23 v23_;
12865   const T24 v24_;
12866   const T25 v25_;
12867   const T26 v26_;
12868   const T27 v27_;
12869   const T28 v28_;
12870   const T29 v29_;
12871   const T30 v30_;
12872   const T31 v31_;
12873   const T32 v32_;
12874   const T33 v33_;
12875   const T34 v34_;
12876   const T35 v35_;
12877   const T36 v36_;
12878   const T37 v37_;
12879   const T38 v38_;
12880   const T39 v39_;
12881   const T40 v40_;
12882   const T41 v41_;
12883 };
12884
12885 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12886     typename T6, typename T7, typename T8, typename T9, typename T10,
12887     typename T11, typename T12, typename T13, typename T14, typename T15,
12888     typename T16, typename T17, typename T18, typename T19, typename T20,
12889     typename T21, typename T22, typename T23, typename T24, typename T25,
12890     typename T26, typename T27, typename T28, typename T29, typename T30,
12891     typename T31, typename T32, typename T33, typename T34, typename T35,
12892     typename T36, typename T37, typename T38, typename T39, typename T40,
12893     typename T41, typename T42>
12894 class ValueArray42 {
12895  public:
12896   ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12897       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12898       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12899       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12900       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12901       T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12902       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12903       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12904       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12905       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12906       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12907       v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
12908
12909   template <typename T>
12910   operator ParamGenerator<T>() const {
12911     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12912         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12913         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12914         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12915         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12916         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12917         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12918         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12919         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12920         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12921         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12922         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12923         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12924         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
12925         static_cast<T>(v42_)};
12926     return ValuesIn(array);
12927   }
12928
12929  private:
12930   // No implementation - assignment is unsupported.
12931   void operator=(const ValueArray42& other);
12932
12933   const T1 v1_;
12934   const T2 v2_;
12935   const T3 v3_;
12936   const T4 v4_;
12937   const T5 v5_;
12938   const T6 v6_;
12939   const T7 v7_;
12940   const T8 v8_;
12941   const T9 v9_;
12942   const T10 v10_;
12943   const T11 v11_;
12944   const T12 v12_;
12945   const T13 v13_;
12946   const T14 v14_;
12947   const T15 v15_;
12948   const T16 v16_;
12949   const T17 v17_;
12950   const T18 v18_;
12951   const T19 v19_;
12952   const T20 v20_;
12953   const T21 v21_;
12954   const T22 v22_;
12955   const T23 v23_;
12956   const T24 v24_;
12957   const T25 v25_;
12958   const T26 v26_;
12959   const T27 v27_;
12960   const T28 v28_;
12961   const T29 v29_;
12962   const T30 v30_;
12963   const T31 v31_;
12964   const T32 v32_;
12965   const T33 v33_;
12966   const T34 v34_;
12967   const T35 v35_;
12968   const T36 v36_;
12969   const T37 v37_;
12970   const T38 v38_;
12971   const T39 v39_;
12972   const T40 v40_;
12973   const T41 v41_;
12974   const T42 v42_;
12975 };
12976
12977 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12978     typename T6, typename T7, typename T8, typename T9, typename T10,
12979     typename T11, typename T12, typename T13, typename T14, typename T15,
12980     typename T16, typename T17, typename T18, typename T19, typename T20,
12981     typename T21, typename T22, typename T23, typename T24, typename T25,
12982     typename T26, typename T27, typename T28, typename T29, typename T30,
12983     typename T31, typename T32, typename T33, typename T34, typename T35,
12984     typename T36, typename T37, typename T38, typename T39, typename T40,
12985     typename T41, typename T42, typename T43>
12986 class ValueArray43 {
12987  public:
12988   ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12989       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12990       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12991       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12992       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12993       T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12994       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12995       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12996       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12997       v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12998       v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
12999       v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
13000
13001   template <typename T>
13002   operator ParamGenerator<T>() const {
13003     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13004         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13005         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13006         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13007         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13008         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13009         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13010         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13011         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13012         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13013         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13014         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13015         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13016         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13017         static_cast<T>(v42_), static_cast<T>(v43_)};
13018     return ValuesIn(array);
13019   }
13020
13021  private:
13022   // No implementation - assignment is unsupported.
13023   void operator=(const ValueArray43& other);
13024
13025   const T1 v1_;
13026   const T2 v2_;
13027   const T3 v3_;
13028   const T4 v4_;
13029   const T5 v5_;
13030   const T6 v6_;
13031   const T7 v7_;
13032   const T8 v8_;
13033   const T9 v9_;
13034   const T10 v10_;
13035   const T11 v11_;
13036   const T12 v12_;
13037   const T13 v13_;
13038   const T14 v14_;
13039   const T15 v15_;
13040   const T16 v16_;
13041   const T17 v17_;
13042   const T18 v18_;
13043   const T19 v19_;
13044   const T20 v20_;
13045   const T21 v21_;
13046   const T22 v22_;
13047   const T23 v23_;
13048   const T24 v24_;
13049   const T25 v25_;
13050   const T26 v26_;
13051   const T27 v27_;
13052   const T28 v28_;
13053   const T29 v29_;
13054   const T30 v30_;
13055   const T31 v31_;
13056   const T32 v32_;
13057   const T33 v33_;
13058   const T34 v34_;
13059   const T35 v35_;
13060   const T36 v36_;
13061   const T37 v37_;
13062   const T38 v38_;
13063   const T39 v39_;
13064   const T40 v40_;
13065   const T41 v41_;
13066   const T42 v42_;
13067   const T43 v43_;
13068 };
13069
13070 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13071     typename T6, typename T7, typename T8, typename T9, typename T10,
13072     typename T11, typename T12, typename T13, typename T14, typename T15,
13073     typename T16, typename T17, typename T18, typename T19, typename T20,
13074     typename T21, typename T22, typename T23, typename T24, typename T25,
13075     typename T26, typename T27, typename T28, typename T29, typename T30,
13076     typename T31, typename T32, typename T33, typename T34, typename T35,
13077     typename T36, typename T37, typename T38, typename T39, typename T40,
13078     typename T41, typename T42, typename T43, typename T44>
13079 class ValueArray44 {
13080  public:
13081   ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13082       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13083       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13084       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13085       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13086       T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
13087       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
13088       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
13089       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
13090       v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
13091       v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
13092       v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
13093       v43_(v43), v44_(v44) {}
13094
13095   template <typename T>
13096   operator ParamGenerator<T>() const {
13097     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13098         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13099         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13100         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13101         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13102         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13103         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13104         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13105         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13106         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13107         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13108         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13109         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13110         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13111         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
13112     return ValuesIn(array);
13113   }
13114
13115  private:
13116   // No implementation - assignment is unsupported.
13117   void operator=(const ValueArray44& other);
13118
13119   const T1 v1_;
13120   const T2 v2_;
13121   const T3 v3_;
13122   const T4 v4_;
13123   const T5 v5_;
13124   const T6 v6_;
13125   const T7 v7_;
13126   const T8 v8_;
13127   const T9 v9_;
13128   const T10 v10_;
13129   const T11 v11_;
13130   const T12 v12_;
13131   const T13 v13_;
13132   const T14 v14_;
13133   const T15 v15_;
13134   const T16 v16_;
13135   const T17 v17_;
13136   const T18 v18_;
13137   const T19 v19_;
13138   const T20 v20_;
13139   const T21 v21_;
13140   const T22 v22_;
13141   const T23 v23_;
13142   const T24 v24_;
13143   const T25 v25_;
13144   const T26 v26_;
13145   const T27 v27_;
13146   const T28 v28_;
13147   const T29 v29_;
13148   const T30 v30_;
13149   const T31 v31_;
13150   const T32 v32_;
13151   const T33 v33_;
13152   const T34 v34_;
13153   const T35 v35_;
13154   const T36 v36_;
13155   const T37 v37_;
13156   const T38 v38_;
13157   const T39 v39_;
13158   const T40 v40_;
13159   const T41 v41_;
13160   const T42 v42_;
13161   const T43 v43_;
13162   const T44 v44_;
13163 };
13164
13165 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13166     typename T6, typename T7, typename T8, typename T9, typename T10,
13167     typename T11, typename T12, typename T13, typename T14, typename T15,
13168     typename T16, typename T17, typename T18, typename T19, typename T20,
13169     typename T21, typename T22, typename T23, typename T24, typename T25,
13170     typename T26, typename T27, typename T28, typename T29, typename T30,
13171     typename T31, typename T32, typename T33, typename T34, typename T35,
13172     typename T36, typename T37, typename T38, typename T39, typename T40,
13173     typename T41, typename T42, typename T43, typename T44, typename T45>
13174 class ValueArray45 {
13175  public:
13176   ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13177       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13178       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13179       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13180       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13181       T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
13182       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
13183       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
13184       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
13185       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
13186       v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
13187       v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
13188       v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
13189
13190   template <typename T>
13191   operator ParamGenerator<T>() const {
13192     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13193         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13194         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13195         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13196         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13197         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13198         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13199         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13200         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13201         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13202         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13203         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13204         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13205         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13206         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13207         static_cast<T>(v45_)};
13208     return ValuesIn(array);
13209   }
13210
13211  private:
13212   // No implementation - assignment is unsupported.
13213   void operator=(const ValueArray45& other);
13214
13215   const T1 v1_;
13216   const T2 v2_;
13217   const T3 v3_;
13218   const T4 v4_;
13219   const T5 v5_;
13220   const T6 v6_;
13221   const T7 v7_;
13222   const T8 v8_;
13223   const T9 v9_;
13224   const T10 v10_;
13225   const T11 v11_;
13226   const T12 v12_;
13227   const T13 v13_;
13228   const T14 v14_;
13229   const T15 v15_;
13230   const T16 v16_;
13231   const T17 v17_;
13232   const T18 v18_;
13233   const T19 v19_;
13234   const T20 v20_;
13235   const T21 v21_;
13236   const T22 v22_;
13237   const T23 v23_;
13238   const T24 v24_;
13239   const T25 v25_;
13240   const T26 v26_;
13241   const T27 v27_;
13242   const T28 v28_;
13243   const T29 v29_;
13244   const T30 v30_;
13245   const T31 v31_;
13246   const T32 v32_;
13247   const T33 v33_;
13248   const T34 v34_;
13249   const T35 v35_;
13250   const T36 v36_;
13251   const T37 v37_;
13252   const T38 v38_;
13253   const T39 v39_;
13254   const T40 v40_;
13255   const T41 v41_;
13256   const T42 v42_;
13257   const T43 v43_;
13258   const T44 v44_;
13259   const T45 v45_;
13260 };
13261
13262 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13263     typename T6, typename T7, typename T8, typename T9, typename T10,
13264     typename T11, typename T12, typename T13, typename T14, typename T15,
13265     typename T16, typename T17, typename T18, typename T19, typename T20,
13266     typename T21, typename T22, typename T23, typename T24, typename T25,
13267     typename T26, typename T27, typename T28, typename T29, typename T30,
13268     typename T31, typename T32, typename T33, typename T34, typename T35,
13269     typename T36, typename T37, typename T38, typename T39, typename T40,
13270     typename T41, typename T42, typename T43, typename T44, typename T45,
13271     typename T46>
13272 class ValueArray46 {
13273  public:
13274   ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13275       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13276       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13277       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13278       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13279       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
13280       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13281       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13282       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13283       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13284       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13285       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13286       v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
13287
13288   template <typename T>
13289   operator ParamGenerator<T>() const {
13290     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13291         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13292         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13293         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13294         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13295         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13296         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13297         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13298         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13299         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13300         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13301         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13302         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13303         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13304         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13305         static_cast<T>(v45_), static_cast<T>(v46_)};
13306     return ValuesIn(array);
13307   }
13308
13309  private:
13310   // No implementation - assignment is unsupported.
13311   void operator=(const ValueArray46& other);
13312
13313   const T1 v1_;
13314   const T2 v2_;
13315   const T3 v3_;
13316   const T4 v4_;
13317   const T5 v5_;
13318   const T6 v6_;
13319   const T7 v7_;
13320   const T8 v8_;
13321   const T9 v9_;
13322   const T10 v10_;
13323   const T11 v11_;
13324   const T12 v12_;
13325   const T13 v13_;
13326   const T14 v14_;
13327   const T15 v15_;
13328   const T16 v16_;
13329   const T17 v17_;
13330   const T18 v18_;
13331   const T19 v19_;
13332   const T20 v20_;
13333   const T21 v21_;
13334   const T22 v22_;
13335   const T23 v23_;
13336   const T24 v24_;
13337   const T25 v25_;
13338   const T26 v26_;
13339   const T27 v27_;
13340   const T28 v28_;
13341   const T29 v29_;
13342   const T30 v30_;
13343   const T31 v31_;
13344   const T32 v32_;
13345   const T33 v33_;
13346   const T34 v34_;
13347   const T35 v35_;
13348   const T36 v36_;
13349   const T37 v37_;
13350   const T38 v38_;
13351   const T39 v39_;
13352   const T40 v40_;
13353   const T41 v41_;
13354   const T42 v42_;
13355   const T43 v43_;
13356   const T44 v44_;
13357   const T45 v45_;
13358   const T46 v46_;
13359 };
13360
13361 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13362     typename T6, typename T7, typename T8, typename T9, typename T10,
13363     typename T11, typename T12, typename T13, typename T14, typename T15,
13364     typename T16, typename T17, typename T18, typename T19, typename T20,
13365     typename T21, typename T22, typename T23, typename T24, typename T25,
13366     typename T26, typename T27, typename T28, typename T29, typename T30,
13367     typename T31, typename T32, typename T33, typename T34, typename T35,
13368     typename T36, typename T37, typename T38, typename T39, typename T40,
13369     typename T41, typename T42, typename T43, typename T44, typename T45,
13370     typename T46, typename T47>
13371 class ValueArray47 {
13372  public:
13373   ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13374       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13375       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13376       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13377       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13378       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
13379       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13380       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13381       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13382       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13383       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13384       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13385       v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
13386       v47_(v47) {}
13387
13388   template <typename T>
13389   operator ParamGenerator<T>() const {
13390     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13391         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13392         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13393         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13394         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13395         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13396         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13397         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13398         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13399         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13400         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13401         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13402         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13403         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13404         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13405         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
13406     return ValuesIn(array);
13407   }
13408
13409  private:
13410   // No implementation - assignment is unsupported.
13411   void operator=(const ValueArray47& other);
13412
13413   const T1 v1_;
13414   const T2 v2_;
13415   const T3 v3_;
13416   const T4 v4_;
13417   const T5 v5_;
13418   const T6 v6_;
13419   const T7 v7_;
13420   const T8 v8_;
13421   const T9 v9_;
13422   const T10 v10_;
13423   const T11 v11_;
13424   const T12 v12_;
13425   const T13 v13_;
13426   const T14 v14_;
13427   const T15 v15_;
13428   const T16 v16_;
13429   const T17 v17_;
13430   const T18 v18_;
13431   const T19 v19_;
13432   const T20 v20_;
13433   const T21 v21_;
13434   const T22 v22_;
13435   const T23 v23_;
13436   const T24 v24_;
13437   const T25 v25_;
13438   const T26 v26_;
13439   const T27 v27_;
13440   const T28 v28_;
13441   const T29 v29_;
13442   const T30 v30_;
13443   const T31 v31_;
13444   const T32 v32_;
13445   const T33 v33_;
13446   const T34 v34_;
13447   const T35 v35_;
13448   const T36 v36_;
13449   const T37 v37_;
13450   const T38 v38_;
13451   const T39 v39_;
13452   const T40 v40_;
13453   const T41 v41_;
13454   const T42 v42_;
13455   const T43 v43_;
13456   const T44 v44_;
13457   const T45 v45_;
13458   const T46 v46_;
13459   const T47 v47_;
13460 };
13461
13462 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13463     typename T6, typename T7, typename T8, typename T9, typename T10,
13464     typename T11, typename T12, typename T13, typename T14, typename T15,
13465     typename T16, typename T17, typename T18, typename T19, typename T20,
13466     typename T21, typename T22, typename T23, typename T24, typename T25,
13467     typename T26, typename T27, typename T28, typename T29, typename T30,
13468     typename T31, typename T32, typename T33, typename T34, typename T35,
13469     typename T36, typename T37, typename T38, typename T39, typename T40,
13470     typename T41, typename T42, typename T43, typename T44, typename T45,
13471     typename T46, typename T47, typename T48>
13472 class ValueArray48 {
13473  public:
13474   ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13475       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13476       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13477       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13478       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13479       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
13480       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13481       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13482       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13483       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
13484       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
13485       v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
13486       v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
13487       v46_(v46), v47_(v47), v48_(v48) {}
13488
13489   template <typename T>
13490   operator ParamGenerator<T>() const {
13491     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13492         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13493         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13494         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13495         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13496         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13497         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13498         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13499         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13500         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13501         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13502         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13503         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13504         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13505         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13506         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13507         static_cast<T>(v48_)};
13508     return ValuesIn(array);
13509   }
13510
13511  private:
13512   // No implementation - assignment is unsupported.
13513   void operator=(const ValueArray48& other);
13514
13515   const T1 v1_;
13516   const T2 v2_;
13517   const T3 v3_;
13518   const T4 v4_;
13519   const T5 v5_;
13520   const T6 v6_;
13521   const T7 v7_;
13522   const T8 v8_;
13523   const T9 v9_;
13524   const T10 v10_;
13525   const T11 v11_;
13526   const T12 v12_;
13527   const T13 v13_;
13528   const T14 v14_;
13529   const T15 v15_;
13530   const T16 v16_;
13531   const T17 v17_;
13532   const T18 v18_;
13533   const T19 v19_;
13534   const T20 v20_;
13535   const T21 v21_;
13536   const T22 v22_;
13537   const T23 v23_;
13538   const T24 v24_;
13539   const T25 v25_;
13540   const T26 v26_;
13541   const T27 v27_;
13542   const T28 v28_;
13543   const T29 v29_;
13544   const T30 v30_;
13545   const T31 v31_;
13546   const T32 v32_;
13547   const T33 v33_;
13548   const T34 v34_;
13549   const T35 v35_;
13550   const T36 v36_;
13551   const T37 v37_;
13552   const T38 v38_;
13553   const T39 v39_;
13554   const T40 v40_;
13555   const T41 v41_;
13556   const T42 v42_;
13557   const T43 v43_;
13558   const T44 v44_;
13559   const T45 v45_;
13560   const T46 v46_;
13561   const T47 v47_;
13562   const T48 v48_;
13563 };
13564
13565 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13566     typename T6, typename T7, typename T8, typename T9, typename T10,
13567     typename T11, typename T12, typename T13, typename T14, typename T15,
13568     typename T16, typename T17, typename T18, typename T19, typename T20,
13569     typename T21, typename T22, typename T23, typename T24, typename T25,
13570     typename T26, typename T27, typename T28, typename T29, typename T30,
13571     typename T31, typename T32, typename T33, typename T34, typename T35,
13572     typename T36, typename T37, typename T38, typename T39, typename T40,
13573     typename T41, typename T42, typename T43, typename T44, typename T45,
13574     typename T46, typename T47, typename T48, typename T49>
13575 class ValueArray49 {
13576  public:
13577   ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13578       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13579       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13580       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13581       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13582       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
13583       T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13584       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13585       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13586       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13587       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13588       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13589       v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13590       v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
13591
13592   template <typename T>
13593   operator ParamGenerator<T>() const {
13594     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13595         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13596         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13597         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13598         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13599         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13600         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13601         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13602         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13603         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13604         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13605         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13606         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13607         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13608         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13609         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13610         static_cast<T>(v48_), static_cast<T>(v49_)};
13611     return ValuesIn(array);
13612   }
13613
13614  private:
13615   // No implementation - assignment is unsupported.
13616   void operator=(const ValueArray49& other);
13617
13618   const T1 v1_;
13619   const T2 v2_;
13620   const T3 v3_;
13621   const T4 v4_;
13622   const T5 v5_;
13623   const T6 v6_;
13624   const T7 v7_;
13625   const T8 v8_;
13626   const T9 v9_;
13627   const T10 v10_;
13628   const T11 v11_;
13629   const T12 v12_;
13630   const T13 v13_;
13631   const T14 v14_;
13632   const T15 v15_;
13633   const T16 v16_;
13634   const T17 v17_;
13635   const T18 v18_;
13636   const T19 v19_;
13637   const T20 v20_;
13638   const T21 v21_;
13639   const T22 v22_;
13640   const T23 v23_;
13641   const T24 v24_;
13642   const T25 v25_;
13643   const T26 v26_;
13644   const T27 v27_;
13645   const T28 v28_;
13646   const T29 v29_;
13647   const T30 v30_;
13648   const T31 v31_;
13649   const T32 v32_;
13650   const T33 v33_;
13651   const T34 v34_;
13652   const T35 v35_;
13653   const T36 v36_;
13654   const T37 v37_;
13655   const T38 v38_;
13656   const T39 v39_;
13657   const T40 v40_;
13658   const T41 v41_;
13659   const T42 v42_;
13660   const T43 v43_;
13661   const T44 v44_;
13662   const T45 v45_;
13663   const T46 v46_;
13664   const T47 v47_;
13665   const T48 v48_;
13666   const T49 v49_;
13667 };
13668
13669 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13670     typename T6, typename T7, typename T8, typename T9, typename T10,
13671     typename T11, typename T12, typename T13, typename T14, typename T15,
13672     typename T16, typename T17, typename T18, typename T19, typename T20,
13673     typename T21, typename T22, typename T23, typename T24, typename T25,
13674     typename T26, typename T27, typename T28, typename T29, typename T30,
13675     typename T31, typename T32, typename T33, typename T34, typename T35,
13676     typename T36, typename T37, typename T38, typename T39, typename T40,
13677     typename T41, typename T42, typename T43, typename T44, typename T45,
13678     typename T46, typename T47, typename T48, typename T49, typename T50>
13679 class ValueArray50 {
13680  public:
13681   ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13682       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13683       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13684       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13685       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13686       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
13687       T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13688       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13689       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13690       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13691       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13692       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13693       v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13694       v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
13695
13696   template <typename T>
13697   operator ParamGenerator<T>() const {
13698     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13699         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13700         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13701         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13702         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13703         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13704         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13705         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13706         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13707         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13708         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13709         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13710         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13711         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13712         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13713         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13714         static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
13715     return ValuesIn(array);
13716   }
13717
13718  private:
13719   // No implementation - assignment is unsupported.
13720   void operator=(const ValueArray50& other);
13721
13722   const T1 v1_;
13723   const T2 v2_;
13724   const T3 v3_;
13725   const T4 v4_;
13726   const T5 v5_;
13727   const T6 v6_;
13728   const T7 v7_;
13729   const T8 v8_;
13730   const T9 v9_;
13731   const T10 v10_;
13732   const T11 v11_;
13733   const T12 v12_;
13734   const T13 v13_;
13735   const T14 v14_;
13736   const T15 v15_;
13737   const T16 v16_;
13738   const T17 v17_;
13739   const T18 v18_;
13740   const T19 v19_;
13741   const T20 v20_;
13742   const T21 v21_;
13743   const T22 v22_;
13744   const T23 v23_;
13745   const T24 v24_;
13746   const T25 v25_;
13747   const T26 v26_;
13748   const T27 v27_;
13749   const T28 v28_;
13750   const T29 v29_;
13751   const T30 v30_;
13752   const T31 v31_;
13753   const T32 v32_;
13754   const T33 v33_;
13755   const T34 v34_;
13756   const T35 v35_;
13757   const T36 v36_;
13758   const T37 v37_;
13759   const T38 v38_;
13760   const T39 v39_;
13761   const T40 v40_;
13762   const T41 v41_;
13763   const T42 v42_;
13764   const T43 v43_;
13765   const T44 v44_;
13766   const T45 v45_;
13767   const T46 v46_;
13768   const T47 v47_;
13769   const T48 v48_;
13770   const T49 v49_;
13771   const T50 v50_;
13772 };
13773
13774 # if GTEST_HAS_COMBINE
13775 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
13776 //
13777 // Generates values from the Cartesian product of values produced
13778 // by the argument generators.
13779 //
13780 template <typename T1, typename T2>
13781 class CartesianProductGenerator2
13782     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
13783  public:
13784   typedef ::std::tr1::tuple<T1, T2> ParamType;
13785
13786   CartesianProductGenerator2(const ParamGenerator<T1>& g1,
13787       const ParamGenerator<T2>& g2)
13788       : g1_(g1), g2_(g2) {}
13789   virtual ~CartesianProductGenerator2() {}
13790
13791   virtual ParamIteratorInterface<ParamType>* Begin() const {
13792     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
13793   }
13794   virtual ParamIteratorInterface<ParamType>* End() const {
13795     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
13796   }
13797
13798  private:
13799   class Iterator : public ParamIteratorInterface<ParamType> {
13800    public:
13801     Iterator(const ParamGeneratorInterface<ParamType>* base,
13802       const ParamGenerator<T1>& g1,
13803       const typename ParamGenerator<T1>::iterator& current1,
13804       const ParamGenerator<T2>& g2,
13805       const typename ParamGenerator<T2>::iterator& current2)
13806         : base_(base),
13807           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13808           begin2_(g2.begin()), end2_(g2.end()), current2_(current2)    {
13809       ComputeCurrentValue();
13810     }
13811     virtual ~Iterator() {}
13812
13813     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13814       return base_;
13815     }
13816     // Advance should not be called on beyond-of-range iterators
13817     // so no component iterators must be beyond end of range, either.
13818     virtual void Advance() {
13819       assert(!AtEnd());
13820       ++current2_;
13821       if (current2_ == end2_) {
13822         current2_ = begin2_;
13823         ++current1_;
13824       }
13825       ComputeCurrentValue();
13826     }
13827     virtual ParamIteratorInterface<ParamType>* Clone() const {
13828       return new Iterator(*this);
13829     }
13830     virtual const ParamType* Current() const { return &current_value_; }
13831     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13832       // Having the same base generator guarantees that the other
13833       // iterator is of the same type and we can downcast.
13834       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13835           << "The program attempted to compare iterators "
13836           << "from different generators." << std::endl;
13837       const Iterator* typed_other =
13838           CheckedDowncastToActualType<const Iterator>(&other);
13839       // We must report iterators equal if they both point beyond their
13840       // respective ranges. That can happen in a variety of fashions,
13841       // so we have to consult AtEnd().
13842       return (AtEnd() && typed_other->AtEnd()) ||
13843          (
13844           current1_ == typed_other->current1_ &&
13845           current2_ == typed_other->current2_);
13846     }
13847
13848    private:
13849     Iterator(const Iterator& other)
13850         : base_(other.base_),
13851         begin1_(other.begin1_),
13852         end1_(other.end1_),
13853         current1_(other.current1_),
13854         begin2_(other.begin2_),
13855         end2_(other.end2_),
13856         current2_(other.current2_) {
13857       ComputeCurrentValue();
13858     }
13859
13860     void ComputeCurrentValue() {
13861       if (!AtEnd())
13862         current_value_ = ParamType(*current1_, *current2_);
13863     }
13864     bool AtEnd() const {
13865       // We must report iterator past the end of the range when either of the
13866       // component iterators has reached the end of its range.
13867       return
13868           current1_ == end1_ ||
13869           current2_ == end2_;
13870     }
13871
13872     // No implementation - assignment is unsupported.
13873     void operator=(const Iterator& other);
13874
13875     const ParamGeneratorInterface<ParamType>* const base_;
13876     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13877     // current[i]_ is the actual traversing iterator.
13878     const typename ParamGenerator<T1>::iterator begin1_;
13879     const typename ParamGenerator<T1>::iterator end1_;
13880     typename ParamGenerator<T1>::iterator current1_;
13881     const typename ParamGenerator<T2>::iterator begin2_;
13882     const typename ParamGenerator<T2>::iterator end2_;
13883     typename ParamGenerator<T2>::iterator current2_;
13884     ParamType current_value_;
13885   };  // class CartesianProductGenerator2::Iterator
13886
13887   // No implementation - assignment is unsupported.
13888   void operator=(const CartesianProductGenerator2& other);
13889
13890   const ParamGenerator<T1> g1_;
13891   const ParamGenerator<T2> g2_;
13892 };  // class CartesianProductGenerator2
13893
13894
13895 template <typename T1, typename T2, typename T3>
13896 class CartesianProductGenerator3
13897     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
13898  public:
13899   typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
13900
13901   CartesianProductGenerator3(const ParamGenerator<T1>& g1,
13902       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
13903       : g1_(g1), g2_(g2), g3_(g3) {}
13904   virtual ~CartesianProductGenerator3() {}
13905
13906   virtual ParamIteratorInterface<ParamType>* Begin() const {
13907     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
13908         g3_.begin());
13909   }
13910   virtual ParamIteratorInterface<ParamType>* End() const {
13911     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
13912   }
13913
13914  private:
13915   class Iterator : public ParamIteratorInterface<ParamType> {
13916    public:
13917     Iterator(const ParamGeneratorInterface<ParamType>* base,
13918       const ParamGenerator<T1>& g1,
13919       const typename ParamGenerator<T1>::iterator& current1,
13920       const ParamGenerator<T2>& g2,
13921       const typename ParamGenerator<T2>::iterator& current2,
13922       const ParamGenerator<T3>& g3,
13923       const typename ParamGenerator<T3>::iterator& current3)
13924         : base_(base),
13925           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13926           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
13927           begin3_(g3.begin()), end3_(g3.end()), current3_(current3)    {
13928       ComputeCurrentValue();
13929     }
13930     virtual ~Iterator() {}
13931
13932     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13933       return base_;
13934     }
13935     // Advance should not be called on beyond-of-range iterators
13936     // so no component iterators must be beyond end of range, either.
13937     virtual void Advance() {
13938       assert(!AtEnd());
13939       ++current3_;
13940       if (current3_ == end3_) {
13941         current3_ = begin3_;
13942         ++current2_;
13943       }
13944       if (current2_ == end2_) {
13945         current2_ = begin2_;
13946         ++current1_;
13947       }
13948       ComputeCurrentValue();
13949     }
13950     virtual ParamIteratorInterface<ParamType>* Clone() const {
13951       return new Iterator(*this);
13952     }
13953     virtual const ParamType* Current() const { return &current_value_; }
13954     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13955       // Having the same base generator guarantees that the other
13956       // iterator is of the same type and we can downcast.
13957       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13958           << "The program attempted to compare iterators "
13959           << "from different generators." << std::endl;
13960       const Iterator* typed_other =
13961           CheckedDowncastToActualType<const Iterator>(&other);
13962       // We must report iterators equal if they both point beyond their
13963       // respective ranges. That can happen in a variety of fashions,
13964       // so we have to consult AtEnd().
13965       return (AtEnd() && typed_other->AtEnd()) ||
13966          (
13967           current1_ == typed_other->current1_ &&
13968           current2_ == typed_other->current2_ &&
13969           current3_ == typed_other->current3_);
13970     }
13971
13972    private:
13973     Iterator(const Iterator& other)
13974         : base_(other.base_),
13975         begin1_(other.begin1_),
13976         end1_(other.end1_),
13977         current1_(other.current1_),
13978         begin2_(other.begin2_),
13979         end2_(other.end2_),
13980         current2_(other.current2_),
13981         begin3_(other.begin3_),
13982         end3_(other.end3_),
13983         current3_(other.current3_) {
13984       ComputeCurrentValue();
13985     }
13986
13987     void ComputeCurrentValue() {
13988       if (!AtEnd())
13989         current_value_ = ParamType(*current1_, *current2_, *current3_);
13990     }
13991     bool AtEnd() const {
13992       // We must report iterator past the end of the range when either of the
13993       // component iterators has reached the end of its range.
13994       return
13995           current1_ == end1_ ||
13996           current2_ == end2_ ||
13997           current3_ == end3_;
13998     }
13999
14000     // No implementation - assignment is unsupported.
14001     void operator=(const Iterator& other);
14002
14003     const ParamGeneratorInterface<ParamType>* const base_;
14004     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14005     // current[i]_ is the actual traversing iterator.
14006     const typename ParamGenerator<T1>::iterator begin1_;
14007     const typename ParamGenerator<T1>::iterator end1_;
14008     typename ParamGenerator<T1>::iterator current1_;
14009     const typename ParamGenerator<T2>::iterator begin2_;
14010     const typename ParamGenerator<T2>::iterator end2_;
14011     typename ParamGenerator<T2>::iterator current2_;
14012     const typename ParamGenerator<T3>::iterator begin3_;
14013     const typename ParamGenerator<T3>::iterator end3_;
14014     typename ParamGenerator<T3>::iterator current3_;
14015     ParamType current_value_;
14016   };  // class CartesianProductGenerator3::Iterator
14017
14018   // No implementation - assignment is unsupported.
14019   void operator=(const CartesianProductGenerator3& other);
14020
14021   const ParamGenerator<T1> g1_;
14022   const ParamGenerator<T2> g2_;
14023   const ParamGenerator<T3> g3_;
14024 };  // class CartesianProductGenerator3
14025
14026
14027 template <typename T1, typename T2, typename T3, typename T4>
14028 class CartesianProductGenerator4
14029     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
14030  public:
14031   typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
14032
14033   CartesianProductGenerator4(const ParamGenerator<T1>& g1,
14034       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14035       const ParamGenerator<T4>& g4)
14036       : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
14037   virtual ~CartesianProductGenerator4() {}
14038
14039   virtual ParamIteratorInterface<ParamType>* Begin() const {
14040     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14041         g3_.begin(), g4_, g4_.begin());
14042   }
14043   virtual ParamIteratorInterface<ParamType>* End() const {
14044     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14045         g4_, g4_.end());
14046   }
14047
14048  private:
14049   class Iterator : public ParamIteratorInterface<ParamType> {
14050    public:
14051     Iterator(const ParamGeneratorInterface<ParamType>* base,
14052       const ParamGenerator<T1>& g1,
14053       const typename ParamGenerator<T1>::iterator& current1,
14054       const ParamGenerator<T2>& g2,
14055       const typename ParamGenerator<T2>::iterator& current2,
14056       const ParamGenerator<T3>& g3,
14057       const typename ParamGenerator<T3>::iterator& current3,
14058       const ParamGenerator<T4>& g4,
14059       const typename ParamGenerator<T4>::iterator& current4)
14060         : base_(base),
14061           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14062           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14063           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14064           begin4_(g4.begin()), end4_(g4.end()), current4_(current4)    {
14065       ComputeCurrentValue();
14066     }
14067     virtual ~Iterator() {}
14068
14069     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14070       return base_;
14071     }
14072     // Advance should not be called on beyond-of-range iterators
14073     // so no component iterators must be beyond end of range, either.
14074     virtual void Advance() {
14075       assert(!AtEnd());
14076       ++current4_;
14077       if (current4_ == end4_) {
14078         current4_ = begin4_;
14079         ++current3_;
14080       }
14081       if (current3_ == end3_) {
14082         current3_ = begin3_;
14083         ++current2_;
14084       }
14085       if (current2_ == end2_) {
14086         current2_ = begin2_;
14087         ++current1_;
14088       }
14089       ComputeCurrentValue();
14090     }
14091     virtual ParamIteratorInterface<ParamType>* Clone() const {
14092       return new Iterator(*this);
14093     }
14094     virtual const ParamType* Current() const { return &current_value_; }
14095     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14096       // Having the same base generator guarantees that the other
14097       // iterator is of the same type and we can downcast.
14098       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14099           << "The program attempted to compare iterators "
14100           << "from different generators." << std::endl;
14101       const Iterator* typed_other =
14102           CheckedDowncastToActualType<const Iterator>(&other);
14103       // We must report iterators equal if they both point beyond their
14104       // respective ranges. That can happen in a variety of fashions,
14105       // so we have to consult AtEnd().
14106       return (AtEnd() && typed_other->AtEnd()) ||
14107          (
14108           current1_ == typed_other->current1_ &&
14109           current2_ == typed_other->current2_ &&
14110           current3_ == typed_other->current3_ &&
14111           current4_ == typed_other->current4_);
14112     }
14113
14114    private:
14115     Iterator(const Iterator& other)
14116         : base_(other.base_),
14117         begin1_(other.begin1_),
14118         end1_(other.end1_),
14119         current1_(other.current1_),
14120         begin2_(other.begin2_),
14121         end2_(other.end2_),
14122         current2_(other.current2_),
14123         begin3_(other.begin3_),
14124         end3_(other.end3_),
14125         current3_(other.current3_),
14126         begin4_(other.begin4_),
14127         end4_(other.end4_),
14128         current4_(other.current4_) {
14129       ComputeCurrentValue();
14130     }
14131
14132     void ComputeCurrentValue() {
14133       if (!AtEnd())
14134         current_value_ = ParamType(*current1_, *current2_, *current3_,
14135             *current4_);
14136     }
14137     bool AtEnd() const {
14138       // We must report iterator past the end of the range when either of the
14139       // component iterators has reached the end of its range.
14140       return
14141           current1_ == end1_ ||
14142           current2_ == end2_ ||
14143           current3_ == end3_ ||
14144           current4_ == end4_;
14145     }
14146
14147     // No implementation - assignment is unsupported.
14148     void operator=(const Iterator& other);
14149
14150     const ParamGeneratorInterface<ParamType>* const base_;
14151     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14152     // current[i]_ is the actual traversing iterator.
14153     const typename ParamGenerator<T1>::iterator begin1_;
14154     const typename ParamGenerator<T1>::iterator end1_;
14155     typename ParamGenerator<T1>::iterator current1_;
14156     const typename ParamGenerator<T2>::iterator begin2_;
14157     const typename ParamGenerator<T2>::iterator end2_;
14158     typename ParamGenerator<T2>::iterator current2_;
14159     const typename ParamGenerator<T3>::iterator begin3_;
14160     const typename ParamGenerator<T3>::iterator end3_;
14161     typename ParamGenerator<T3>::iterator current3_;
14162     const typename ParamGenerator<T4>::iterator begin4_;
14163     const typename ParamGenerator<T4>::iterator end4_;
14164     typename ParamGenerator<T4>::iterator current4_;
14165     ParamType current_value_;
14166   };  // class CartesianProductGenerator4::Iterator
14167
14168   // No implementation - assignment is unsupported.
14169   void operator=(const CartesianProductGenerator4& other);
14170
14171   const ParamGenerator<T1> g1_;
14172   const ParamGenerator<T2> g2_;
14173   const ParamGenerator<T3> g3_;
14174   const ParamGenerator<T4> g4_;
14175 };  // class CartesianProductGenerator4
14176
14177
14178 template <typename T1, typename T2, typename T3, typename T4, typename T5>
14179 class CartesianProductGenerator5
14180     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
14181  public:
14182   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
14183
14184   CartesianProductGenerator5(const ParamGenerator<T1>& g1,
14185       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14186       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
14187       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
14188   virtual ~CartesianProductGenerator5() {}
14189
14190   virtual ParamIteratorInterface<ParamType>* Begin() const {
14191     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14192         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
14193   }
14194   virtual ParamIteratorInterface<ParamType>* End() const {
14195     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14196         g4_, g4_.end(), g5_, g5_.end());
14197   }
14198
14199  private:
14200   class Iterator : public ParamIteratorInterface<ParamType> {
14201    public:
14202     Iterator(const ParamGeneratorInterface<ParamType>* base,
14203       const ParamGenerator<T1>& g1,
14204       const typename ParamGenerator<T1>::iterator& current1,
14205       const ParamGenerator<T2>& g2,
14206       const typename ParamGenerator<T2>::iterator& current2,
14207       const ParamGenerator<T3>& g3,
14208       const typename ParamGenerator<T3>::iterator& current3,
14209       const ParamGenerator<T4>& g4,
14210       const typename ParamGenerator<T4>::iterator& current4,
14211       const ParamGenerator<T5>& g5,
14212       const typename ParamGenerator<T5>::iterator& current5)
14213         : base_(base),
14214           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14215           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14216           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14217           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14218           begin5_(g5.begin()), end5_(g5.end()), current5_(current5)    {
14219       ComputeCurrentValue();
14220     }
14221     virtual ~Iterator() {}
14222
14223     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14224       return base_;
14225     }
14226     // Advance should not be called on beyond-of-range iterators
14227     // so no component iterators must be beyond end of range, either.
14228     virtual void Advance() {
14229       assert(!AtEnd());
14230       ++current5_;
14231       if (current5_ == end5_) {
14232         current5_ = begin5_;
14233         ++current4_;
14234       }
14235       if (current4_ == end4_) {
14236         current4_ = begin4_;
14237         ++current3_;
14238       }
14239       if (current3_ == end3_) {
14240         current3_ = begin3_;
14241         ++current2_;
14242       }
14243       if (current2_ == end2_) {
14244         current2_ = begin2_;
14245         ++current1_;
14246       }
14247       ComputeCurrentValue();
14248     }
14249     virtual ParamIteratorInterface<ParamType>* Clone() const {
14250       return new Iterator(*this);
14251     }
14252     virtual const ParamType* Current() const { return &current_value_; }
14253     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14254       // Having the same base generator guarantees that the other
14255       // iterator is of the same type and we can downcast.
14256       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14257           << "The program attempted to compare iterators "
14258           << "from different generators." << std::endl;
14259       const Iterator* typed_other =
14260           CheckedDowncastToActualType<const Iterator>(&other);
14261       // We must report iterators equal if they both point beyond their
14262       // respective ranges. That can happen in a variety of fashions,
14263       // so we have to consult AtEnd().
14264       return (AtEnd() && typed_other->AtEnd()) ||
14265          (
14266           current1_ == typed_other->current1_ &&
14267           current2_ == typed_other->current2_ &&
14268           current3_ == typed_other->current3_ &&
14269           current4_ == typed_other->current4_ &&
14270           current5_ == typed_other->current5_);
14271     }
14272
14273    private:
14274     Iterator(const Iterator& other)
14275         : base_(other.base_),
14276         begin1_(other.begin1_),
14277         end1_(other.end1_),
14278         current1_(other.current1_),
14279         begin2_(other.begin2_),
14280         end2_(other.end2_),
14281         current2_(other.current2_),
14282         begin3_(other.begin3_),
14283         end3_(other.end3_),
14284         current3_(other.current3_),
14285         begin4_(other.begin4_),
14286         end4_(other.end4_),
14287         current4_(other.current4_),
14288         begin5_(other.begin5_),
14289         end5_(other.end5_),
14290         current5_(other.current5_) {
14291       ComputeCurrentValue();
14292     }
14293
14294     void ComputeCurrentValue() {
14295       if (!AtEnd())
14296         current_value_ = ParamType(*current1_, *current2_, *current3_,
14297             *current4_, *current5_);
14298     }
14299     bool AtEnd() const {
14300       // We must report iterator past the end of the range when either of the
14301       // component iterators has reached the end of its range.
14302       return
14303           current1_ == end1_ ||
14304           current2_ == end2_ ||
14305           current3_ == end3_ ||
14306           current4_ == end4_ ||
14307           current5_ == end5_;
14308     }
14309
14310     // No implementation - assignment is unsupported.
14311     void operator=(const Iterator& other);
14312
14313     const ParamGeneratorInterface<ParamType>* const base_;
14314     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14315     // current[i]_ is the actual traversing iterator.
14316     const typename ParamGenerator<T1>::iterator begin1_;
14317     const typename ParamGenerator<T1>::iterator end1_;
14318     typename ParamGenerator<T1>::iterator current1_;
14319     const typename ParamGenerator<T2>::iterator begin2_;
14320     const typename ParamGenerator<T2>::iterator end2_;
14321     typename ParamGenerator<T2>::iterator current2_;
14322     const typename ParamGenerator<T3>::iterator begin3_;
14323     const typename ParamGenerator<T3>::iterator end3_;
14324     typename ParamGenerator<T3>::iterator current3_;
14325     const typename ParamGenerator<T4>::iterator begin4_;
14326     const typename ParamGenerator<T4>::iterator end4_;
14327     typename ParamGenerator<T4>::iterator current4_;
14328     const typename ParamGenerator<T5>::iterator begin5_;
14329     const typename ParamGenerator<T5>::iterator end5_;
14330     typename ParamGenerator<T5>::iterator current5_;
14331     ParamType current_value_;
14332   };  // class CartesianProductGenerator5::Iterator
14333
14334   // No implementation - assignment is unsupported.
14335   void operator=(const CartesianProductGenerator5& other);
14336
14337   const ParamGenerator<T1> g1_;
14338   const ParamGenerator<T2> g2_;
14339   const ParamGenerator<T3> g3_;
14340   const ParamGenerator<T4> g4_;
14341   const ParamGenerator<T5> g5_;
14342 };  // class CartesianProductGenerator5
14343
14344
14345 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14346     typename T6>
14347 class CartesianProductGenerator6
14348     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
14349         T6> > {
14350  public:
14351   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
14352
14353   CartesianProductGenerator6(const ParamGenerator<T1>& g1,
14354       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14355       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14356       const ParamGenerator<T6>& g6)
14357       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
14358   virtual ~CartesianProductGenerator6() {}
14359
14360   virtual ParamIteratorInterface<ParamType>* Begin() const {
14361     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14362         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
14363   }
14364   virtual ParamIteratorInterface<ParamType>* End() const {
14365     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14366         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
14367   }
14368
14369  private:
14370   class Iterator : public ParamIteratorInterface<ParamType> {
14371    public:
14372     Iterator(const ParamGeneratorInterface<ParamType>* base,
14373       const ParamGenerator<T1>& g1,
14374       const typename ParamGenerator<T1>::iterator& current1,
14375       const ParamGenerator<T2>& g2,
14376       const typename ParamGenerator<T2>::iterator& current2,
14377       const ParamGenerator<T3>& g3,
14378       const typename ParamGenerator<T3>::iterator& current3,
14379       const ParamGenerator<T4>& g4,
14380       const typename ParamGenerator<T4>::iterator& current4,
14381       const ParamGenerator<T5>& g5,
14382       const typename ParamGenerator<T5>::iterator& current5,
14383       const ParamGenerator<T6>& g6,
14384       const typename ParamGenerator<T6>::iterator& current6)
14385         : base_(base),
14386           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14387           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14388           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14389           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14390           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14391           begin6_(g6.begin()), end6_(g6.end()), current6_(current6)    {
14392       ComputeCurrentValue();
14393     }
14394     virtual ~Iterator() {}
14395
14396     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14397       return base_;
14398     }
14399     // Advance should not be called on beyond-of-range iterators
14400     // so no component iterators must be beyond end of range, either.
14401     virtual void Advance() {
14402       assert(!AtEnd());
14403       ++current6_;
14404       if (current6_ == end6_) {
14405         current6_ = begin6_;
14406         ++current5_;
14407       }
14408       if (current5_ == end5_) {
14409         current5_ = begin5_;
14410         ++current4_;
14411       }
14412       if (current4_ == end4_) {
14413         current4_ = begin4_;
14414         ++current3_;
14415       }
14416       if (current3_ == end3_) {
14417         current3_ = begin3_;
14418         ++current2_;
14419       }
14420       if (current2_ == end2_) {
14421         current2_ = begin2_;
14422         ++current1_;
14423       }
14424       ComputeCurrentValue();
14425     }
14426     virtual ParamIteratorInterface<ParamType>* Clone() const {
14427       return new Iterator(*this);
14428     }
14429     virtual const ParamType* Current() const { return &current_value_; }
14430     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14431       // Having the same base generator guarantees that the other
14432       // iterator is of the same type and we can downcast.
14433       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14434           << "The program attempted to compare iterators "
14435           << "from different generators." << std::endl;
14436       const Iterator* typed_other =
14437           CheckedDowncastToActualType<const Iterator>(&other);
14438       // We must report iterators equal if they both point beyond their
14439       // respective ranges. That can happen in a variety of fashions,
14440       // so we have to consult AtEnd().
14441       return (AtEnd() && typed_other->AtEnd()) ||
14442          (
14443           current1_ == typed_other->current1_ &&
14444           current2_ == typed_other->current2_ &&
14445           current3_ == typed_other->current3_ &&
14446           current4_ == typed_other->current4_ &&
14447           current5_ == typed_other->current5_ &&
14448           current6_ == typed_other->current6_);
14449     }
14450
14451    private:
14452     Iterator(const Iterator& other)
14453         : base_(other.base_),
14454         begin1_(other.begin1_),
14455         end1_(other.end1_),
14456         current1_(other.current1_),
14457         begin2_(other.begin2_),
14458         end2_(other.end2_),
14459         current2_(other.current2_),
14460         begin3_(other.begin3_),
14461         end3_(other.end3_),
14462         current3_(other.current3_),
14463         begin4_(other.begin4_),
14464         end4_(other.end4_),
14465         current4_(other.current4_),
14466         begin5_(other.begin5_),
14467         end5_(other.end5_),
14468         current5_(other.current5_),
14469         begin6_(other.begin6_),
14470         end6_(other.end6_),
14471         current6_(other.current6_) {
14472       ComputeCurrentValue();
14473     }
14474
14475     void ComputeCurrentValue() {
14476       if (!AtEnd())
14477         current_value_ = ParamType(*current1_, *current2_, *current3_,
14478             *current4_, *current5_, *current6_);
14479     }
14480     bool AtEnd() const {
14481       // We must report iterator past the end of the range when either of the
14482       // component iterators has reached the end of its range.
14483       return
14484           current1_ == end1_ ||
14485           current2_ == end2_ ||
14486           current3_ == end3_ ||
14487           current4_ == end4_ ||
14488           current5_ == end5_ ||
14489           current6_ == end6_;
14490     }
14491
14492     // No implementation - assignment is unsupported.
14493     void operator=(const Iterator& other);
14494
14495     const ParamGeneratorInterface<ParamType>* const base_;
14496     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14497     // current[i]_ is the actual traversing iterator.
14498     const typename ParamGenerator<T1>::iterator begin1_;
14499     const typename ParamGenerator<T1>::iterator end1_;
14500     typename ParamGenerator<T1>::iterator current1_;
14501     const typename ParamGenerator<T2>::iterator begin2_;
14502     const typename ParamGenerator<T2>::iterator end2_;
14503     typename ParamGenerator<T2>::iterator current2_;
14504     const typename ParamGenerator<T3>::iterator begin3_;
14505     const typename ParamGenerator<T3>::iterator end3_;
14506     typename ParamGenerator<T3>::iterator current3_;
14507     const typename ParamGenerator<T4>::iterator begin4_;
14508     const typename ParamGenerator<T4>::iterator end4_;
14509     typename ParamGenerator<T4>::iterator current4_;
14510     const typename ParamGenerator<T5>::iterator begin5_;
14511     const typename ParamGenerator<T5>::iterator end5_;
14512     typename ParamGenerator<T5>::iterator current5_;
14513     const typename ParamGenerator<T6>::iterator begin6_;
14514     const typename ParamGenerator<T6>::iterator end6_;
14515     typename ParamGenerator<T6>::iterator current6_;
14516     ParamType current_value_;
14517   };  // class CartesianProductGenerator6::Iterator
14518
14519   // No implementation - assignment is unsupported.
14520   void operator=(const CartesianProductGenerator6& other);
14521
14522   const ParamGenerator<T1> g1_;
14523   const ParamGenerator<T2> g2_;
14524   const ParamGenerator<T3> g3_;
14525   const ParamGenerator<T4> g4_;
14526   const ParamGenerator<T5> g5_;
14527   const ParamGenerator<T6> g6_;
14528 };  // class CartesianProductGenerator6
14529
14530
14531 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14532     typename T6, typename T7>
14533 class CartesianProductGenerator7
14534     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14535         T7> > {
14536  public:
14537   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
14538
14539   CartesianProductGenerator7(const ParamGenerator<T1>& g1,
14540       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14541       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14542       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
14543       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
14544   virtual ~CartesianProductGenerator7() {}
14545
14546   virtual ParamIteratorInterface<ParamType>* Begin() const {
14547     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14548         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14549         g7_.begin());
14550   }
14551   virtual ParamIteratorInterface<ParamType>* End() const {
14552     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14553         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
14554   }
14555
14556  private:
14557   class Iterator : public ParamIteratorInterface<ParamType> {
14558    public:
14559     Iterator(const ParamGeneratorInterface<ParamType>* base,
14560       const ParamGenerator<T1>& g1,
14561       const typename ParamGenerator<T1>::iterator& current1,
14562       const ParamGenerator<T2>& g2,
14563       const typename ParamGenerator<T2>::iterator& current2,
14564       const ParamGenerator<T3>& g3,
14565       const typename ParamGenerator<T3>::iterator& current3,
14566       const ParamGenerator<T4>& g4,
14567       const typename ParamGenerator<T4>::iterator& current4,
14568       const ParamGenerator<T5>& g5,
14569       const typename ParamGenerator<T5>::iterator& current5,
14570       const ParamGenerator<T6>& g6,
14571       const typename ParamGenerator<T6>::iterator& current6,
14572       const ParamGenerator<T7>& g7,
14573       const typename ParamGenerator<T7>::iterator& current7)
14574         : base_(base),
14575           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14576           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14577           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14578           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14579           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14580           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14581           begin7_(g7.begin()), end7_(g7.end()), current7_(current7)    {
14582       ComputeCurrentValue();
14583     }
14584     virtual ~Iterator() {}
14585
14586     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14587       return base_;
14588     }
14589     // Advance should not be called on beyond-of-range iterators
14590     // so no component iterators must be beyond end of range, either.
14591     virtual void Advance() {
14592       assert(!AtEnd());
14593       ++current7_;
14594       if (current7_ == end7_) {
14595         current7_ = begin7_;
14596         ++current6_;
14597       }
14598       if (current6_ == end6_) {
14599         current6_ = begin6_;
14600         ++current5_;
14601       }
14602       if (current5_ == end5_) {
14603         current5_ = begin5_;
14604         ++current4_;
14605       }
14606       if (current4_ == end4_) {
14607         current4_ = begin4_;
14608         ++current3_;
14609       }
14610       if (current3_ == end3_) {
14611         current3_ = begin3_;
14612         ++current2_;
14613       }
14614       if (current2_ == end2_) {
14615         current2_ = begin2_;
14616         ++current1_;
14617       }
14618       ComputeCurrentValue();
14619     }
14620     virtual ParamIteratorInterface<ParamType>* Clone() const {
14621       return new Iterator(*this);
14622     }
14623     virtual const ParamType* Current() const { return &current_value_; }
14624     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14625       // Having the same base generator guarantees that the other
14626       // iterator is of the same type and we can downcast.
14627       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14628           << "The program attempted to compare iterators "
14629           << "from different generators." << std::endl;
14630       const Iterator* typed_other =
14631           CheckedDowncastToActualType<const Iterator>(&other);
14632       // We must report iterators equal if they both point beyond their
14633       // respective ranges. That can happen in a variety of fashions,
14634       // so we have to consult AtEnd().
14635       return (AtEnd() && typed_other->AtEnd()) ||
14636          (
14637           current1_ == typed_other->current1_ &&
14638           current2_ == typed_other->current2_ &&
14639           current3_ == typed_other->current3_ &&
14640           current4_ == typed_other->current4_ &&
14641           current5_ == typed_other->current5_ &&
14642           current6_ == typed_other->current6_ &&
14643           current7_ == typed_other->current7_);
14644     }
14645
14646    private:
14647     Iterator(const Iterator& other)
14648         : base_(other.base_),
14649         begin1_(other.begin1_),
14650         end1_(other.end1_),
14651         current1_(other.current1_),
14652         begin2_(other.begin2_),
14653         end2_(other.end2_),
14654         current2_(other.current2_),
14655         begin3_(other.begin3_),
14656         end3_(other.end3_),
14657         current3_(other.current3_),
14658         begin4_(other.begin4_),
14659         end4_(other.end4_),
14660         current4_(other.current4_),
14661         begin5_(other.begin5_),
14662         end5_(other.end5_),
14663         current5_(other.current5_),
14664         begin6_(other.begin6_),
14665         end6_(other.end6_),
14666         current6_(other.current6_),
14667         begin7_(other.begin7_),
14668         end7_(other.end7_),
14669         current7_(other.current7_) {
14670       ComputeCurrentValue();
14671     }
14672
14673     void ComputeCurrentValue() {
14674       if (!AtEnd())
14675         current_value_ = ParamType(*current1_, *current2_, *current3_,
14676             *current4_, *current5_, *current6_, *current7_);
14677     }
14678     bool AtEnd() const {
14679       // We must report iterator past the end of the range when either of the
14680       // component iterators has reached the end of its range.
14681       return
14682           current1_ == end1_ ||
14683           current2_ == end2_ ||
14684           current3_ == end3_ ||
14685           current4_ == end4_ ||
14686           current5_ == end5_ ||
14687           current6_ == end6_ ||
14688           current7_ == end7_;
14689     }
14690
14691     // No implementation - assignment is unsupported.
14692     void operator=(const Iterator& other);
14693
14694     const ParamGeneratorInterface<ParamType>* const base_;
14695     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14696     // current[i]_ is the actual traversing iterator.
14697     const typename ParamGenerator<T1>::iterator begin1_;
14698     const typename ParamGenerator<T1>::iterator end1_;
14699     typename ParamGenerator<T1>::iterator current1_;
14700     const typename ParamGenerator<T2>::iterator begin2_;
14701     const typename ParamGenerator<T2>::iterator end2_;
14702     typename ParamGenerator<T2>::iterator current2_;
14703     const typename ParamGenerator<T3>::iterator begin3_;
14704     const typename ParamGenerator<T3>::iterator end3_;
14705     typename ParamGenerator<T3>::iterator current3_;
14706     const typename ParamGenerator<T4>::iterator begin4_;
14707     const typename ParamGenerator<T4>::iterator end4_;
14708     typename ParamGenerator<T4>::iterator current4_;
14709     const typename ParamGenerator<T5>::iterator begin5_;
14710     const typename ParamGenerator<T5>::iterator end5_;
14711     typename ParamGenerator<T5>::iterator current5_;
14712     const typename ParamGenerator<T6>::iterator begin6_;
14713     const typename ParamGenerator<T6>::iterator end6_;
14714     typename ParamGenerator<T6>::iterator current6_;
14715     const typename ParamGenerator<T7>::iterator begin7_;
14716     const typename ParamGenerator<T7>::iterator end7_;
14717     typename ParamGenerator<T7>::iterator current7_;
14718     ParamType current_value_;
14719   };  // class CartesianProductGenerator7::Iterator
14720
14721   // No implementation - assignment is unsupported.
14722   void operator=(const CartesianProductGenerator7& other);
14723
14724   const ParamGenerator<T1> g1_;
14725   const ParamGenerator<T2> g2_;
14726   const ParamGenerator<T3> g3_;
14727   const ParamGenerator<T4> g4_;
14728   const ParamGenerator<T5> g5_;
14729   const ParamGenerator<T6> g6_;
14730   const ParamGenerator<T7> g7_;
14731 };  // class CartesianProductGenerator7
14732
14733
14734 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14735     typename T6, typename T7, typename T8>
14736 class CartesianProductGenerator8
14737     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14738         T7, T8> > {
14739  public:
14740   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
14741
14742   CartesianProductGenerator8(const ParamGenerator<T1>& g1,
14743       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14744       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14745       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14746       const ParamGenerator<T8>& g8)
14747       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
14748           g8_(g8) {}
14749   virtual ~CartesianProductGenerator8() {}
14750
14751   virtual ParamIteratorInterface<ParamType>* Begin() const {
14752     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14753         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14754         g7_.begin(), g8_, g8_.begin());
14755   }
14756   virtual ParamIteratorInterface<ParamType>* End() const {
14757     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14758         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14759         g8_.end());
14760   }
14761
14762  private:
14763   class Iterator : public ParamIteratorInterface<ParamType> {
14764    public:
14765     Iterator(const ParamGeneratorInterface<ParamType>* base,
14766       const ParamGenerator<T1>& g1,
14767       const typename ParamGenerator<T1>::iterator& current1,
14768       const ParamGenerator<T2>& g2,
14769       const typename ParamGenerator<T2>::iterator& current2,
14770       const ParamGenerator<T3>& g3,
14771       const typename ParamGenerator<T3>::iterator& current3,
14772       const ParamGenerator<T4>& g4,
14773       const typename ParamGenerator<T4>::iterator& current4,
14774       const ParamGenerator<T5>& g5,
14775       const typename ParamGenerator<T5>::iterator& current5,
14776       const ParamGenerator<T6>& g6,
14777       const typename ParamGenerator<T6>::iterator& current6,
14778       const ParamGenerator<T7>& g7,
14779       const typename ParamGenerator<T7>::iterator& current7,
14780       const ParamGenerator<T8>& g8,
14781       const typename ParamGenerator<T8>::iterator& current8)
14782         : base_(base),
14783           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14784           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14785           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14786           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14787           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14788           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14789           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
14790           begin8_(g8.begin()), end8_(g8.end()), current8_(current8)    {
14791       ComputeCurrentValue();
14792     }
14793     virtual ~Iterator() {}
14794
14795     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14796       return base_;
14797     }
14798     // Advance should not be called on beyond-of-range iterators
14799     // so no component iterators must be beyond end of range, either.
14800     virtual void Advance() {
14801       assert(!AtEnd());
14802       ++current8_;
14803       if (current8_ == end8_) {
14804         current8_ = begin8_;
14805         ++current7_;
14806       }
14807       if (current7_ == end7_) {
14808         current7_ = begin7_;
14809         ++current6_;
14810       }
14811       if (current6_ == end6_) {
14812         current6_ = begin6_;
14813         ++current5_;
14814       }
14815       if (current5_ == end5_) {
14816         current5_ = begin5_;
14817         ++current4_;
14818       }
14819       if (current4_ == end4_) {
14820         current4_ = begin4_;
14821         ++current3_;
14822       }
14823       if (current3_ == end3_) {
14824         current3_ = begin3_;
14825         ++current2_;
14826       }
14827       if (current2_ == end2_) {
14828         current2_ = begin2_;
14829         ++current1_;
14830       }
14831       ComputeCurrentValue();
14832     }
14833     virtual ParamIteratorInterface<ParamType>* Clone() const {
14834       return new Iterator(*this);
14835     }
14836     virtual const ParamType* Current() const { return &current_value_; }
14837     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14838       // Having the same base generator guarantees that the other
14839       // iterator is of the same type and we can downcast.
14840       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14841           << "The program attempted to compare iterators "
14842           << "from different generators." << std::endl;
14843       const Iterator* typed_other =
14844           CheckedDowncastToActualType<const Iterator>(&other);
14845       // We must report iterators equal if they both point beyond their
14846       // respective ranges. That can happen in a variety of fashions,
14847       // so we have to consult AtEnd().
14848       return (AtEnd() && typed_other->AtEnd()) ||
14849          (
14850           current1_ == typed_other->current1_ &&
14851           current2_ == typed_other->current2_ &&
14852           current3_ == typed_other->current3_ &&
14853           current4_ == typed_other->current4_ &&
14854           current5_ == typed_other->current5_ &&
14855           current6_ == typed_other->current6_ &&
14856           current7_ == typed_other->current7_ &&
14857           current8_ == typed_other->current8_);
14858     }
14859
14860    private:
14861     Iterator(const Iterator& other)
14862         : base_(other.base_),
14863         begin1_(other.begin1_),
14864         end1_(other.end1_),
14865         current1_(other.current1_),
14866         begin2_(other.begin2_),
14867         end2_(other.end2_),
14868         current2_(other.current2_),
14869         begin3_(other.begin3_),
14870         end3_(other.end3_),
14871         current3_(other.current3_),
14872         begin4_(other.begin4_),
14873         end4_(other.end4_),
14874         current4_(other.current4_),
14875         begin5_(other.begin5_),
14876         end5_(other.end5_),
14877         current5_(other.current5_),
14878         begin6_(other.begin6_),
14879         end6_(other.end6_),
14880         current6_(other.current6_),
14881         begin7_(other.begin7_),
14882         end7_(other.end7_),
14883         current7_(other.current7_),
14884         begin8_(other.begin8_),
14885         end8_(other.end8_),
14886         current8_(other.current8_) {
14887       ComputeCurrentValue();
14888     }
14889
14890     void ComputeCurrentValue() {
14891       if (!AtEnd())
14892         current_value_ = ParamType(*current1_, *current2_, *current3_,
14893             *current4_, *current5_, *current6_, *current7_, *current8_);
14894     }
14895     bool AtEnd() const {
14896       // We must report iterator past the end of the range when either of the
14897       // component iterators has reached the end of its range.
14898       return
14899           current1_ == end1_ ||
14900           current2_ == end2_ ||
14901           current3_ == end3_ ||
14902           current4_ == end4_ ||
14903           current5_ == end5_ ||
14904           current6_ == end6_ ||
14905           current7_ == end7_ ||
14906           current8_ == end8_;
14907     }
14908
14909     // No implementation - assignment is unsupported.
14910     void operator=(const Iterator& other);
14911
14912     const ParamGeneratorInterface<ParamType>* const base_;
14913     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14914     // current[i]_ is the actual traversing iterator.
14915     const typename ParamGenerator<T1>::iterator begin1_;
14916     const typename ParamGenerator<T1>::iterator end1_;
14917     typename ParamGenerator<T1>::iterator current1_;
14918     const typename ParamGenerator<T2>::iterator begin2_;
14919     const typename ParamGenerator<T2>::iterator end2_;
14920     typename ParamGenerator<T2>::iterator current2_;
14921     const typename ParamGenerator<T3>::iterator begin3_;
14922     const typename ParamGenerator<T3>::iterator end3_;
14923     typename ParamGenerator<T3>::iterator current3_;
14924     const typename ParamGenerator<T4>::iterator begin4_;
14925     const typename ParamGenerator<T4>::iterator end4_;
14926     typename ParamGenerator<T4>::iterator current4_;
14927     const typename ParamGenerator<T5>::iterator begin5_;
14928     const typename ParamGenerator<T5>::iterator end5_;
14929     typename ParamGenerator<T5>::iterator current5_;
14930     const typename ParamGenerator<T6>::iterator begin6_;
14931     const typename ParamGenerator<T6>::iterator end6_;
14932     typename ParamGenerator<T6>::iterator current6_;
14933     const typename ParamGenerator<T7>::iterator begin7_;
14934     const typename ParamGenerator<T7>::iterator end7_;
14935     typename ParamGenerator<T7>::iterator current7_;
14936     const typename ParamGenerator<T8>::iterator begin8_;
14937     const typename ParamGenerator<T8>::iterator end8_;
14938     typename ParamGenerator<T8>::iterator current8_;
14939     ParamType current_value_;
14940   };  // class CartesianProductGenerator8::Iterator
14941
14942   // No implementation - assignment is unsupported.
14943   void operator=(const CartesianProductGenerator8& other);
14944
14945   const ParamGenerator<T1> g1_;
14946   const ParamGenerator<T2> g2_;
14947   const ParamGenerator<T3> g3_;
14948   const ParamGenerator<T4> g4_;
14949   const ParamGenerator<T5> g5_;
14950   const ParamGenerator<T6> g6_;
14951   const ParamGenerator<T7> g7_;
14952   const ParamGenerator<T8> g8_;
14953 };  // class CartesianProductGenerator8
14954
14955
14956 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14957     typename T6, typename T7, typename T8, typename T9>
14958 class CartesianProductGenerator9
14959     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14960         T7, T8, T9> > {
14961  public:
14962   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
14963
14964   CartesianProductGenerator9(const ParamGenerator<T1>& g1,
14965       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14966       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14967       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14968       const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
14969       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
14970           g9_(g9) {}
14971   virtual ~CartesianProductGenerator9() {}
14972
14973   virtual ParamIteratorInterface<ParamType>* Begin() const {
14974     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14975         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14976         g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
14977   }
14978   virtual ParamIteratorInterface<ParamType>* End() const {
14979     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14980         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14981         g8_.end(), g9_, g9_.end());
14982   }
14983
14984  private:
14985   class Iterator : public ParamIteratorInterface<ParamType> {
14986    public:
14987     Iterator(const ParamGeneratorInterface<ParamType>* base,
14988       const ParamGenerator<T1>& g1,
14989       const typename ParamGenerator<T1>::iterator& current1,
14990       const ParamGenerator<T2>& g2,
14991       const typename ParamGenerator<T2>::iterator& current2,
14992       const ParamGenerator<T3>& g3,
14993       const typename ParamGenerator<T3>::iterator& current3,
14994       const ParamGenerator<T4>& g4,
14995       const typename ParamGenerator<T4>::iterator& current4,
14996       const ParamGenerator<T5>& g5,
14997       const typename ParamGenerator<T5>::iterator& current5,
14998       const ParamGenerator<T6>& g6,
14999       const typename ParamGenerator<T6>::iterator& current6,
15000       const ParamGenerator<T7>& g7,
15001       const typename ParamGenerator<T7>::iterator& current7,
15002       const ParamGenerator<T8>& g8,
15003       const typename ParamGenerator<T8>::iterator& current8,
15004       const ParamGenerator<T9>& g9,
15005       const typename ParamGenerator<T9>::iterator& current9)
15006         : base_(base),
15007           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15008           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15009           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15010           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15011           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15012           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15013           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15014           begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15015           begin9_(g9.begin()), end9_(g9.end()), current9_(current9)    {
15016       ComputeCurrentValue();
15017     }
15018     virtual ~Iterator() {}
15019
15020     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15021       return base_;
15022     }
15023     // Advance should not be called on beyond-of-range iterators
15024     // so no component iterators must be beyond end of range, either.
15025     virtual void Advance() {
15026       assert(!AtEnd());
15027       ++current9_;
15028       if (current9_ == end9_) {
15029         current9_ = begin9_;
15030         ++current8_;
15031       }
15032       if (current8_ == end8_) {
15033         current8_ = begin8_;
15034         ++current7_;
15035       }
15036       if (current7_ == end7_) {
15037         current7_ = begin7_;
15038         ++current6_;
15039       }
15040       if (current6_ == end6_) {
15041         current6_ = begin6_;
15042         ++current5_;
15043       }
15044       if (current5_ == end5_) {
15045         current5_ = begin5_;
15046         ++current4_;
15047       }
15048       if (current4_ == end4_) {
15049         current4_ = begin4_;
15050         ++current3_;
15051       }
15052       if (current3_ == end3_) {
15053         current3_ = begin3_;
15054         ++current2_;
15055       }
15056       if (current2_ == end2_) {
15057         current2_ = begin2_;
15058         ++current1_;
15059       }
15060       ComputeCurrentValue();
15061     }
15062     virtual ParamIteratorInterface<ParamType>* Clone() const {
15063       return new Iterator(*this);
15064     }
15065     virtual const ParamType* Current() const { return &current_value_; }
15066     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15067       // Having the same base generator guarantees that the other
15068       // iterator is of the same type and we can downcast.
15069       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15070           << "The program attempted to compare iterators "
15071           << "from different generators." << std::endl;
15072       const Iterator* typed_other =
15073           CheckedDowncastToActualType<const Iterator>(&other);
15074       // We must report iterators equal if they both point beyond their
15075       // respective ranges. That can happen in a variety of fashions,
15076       // so we have to consult AtEnd().
15077       return (AtEnd() && typed_other->AtEnd()) ||
15078          (
15079           current1_ == typed_other->current1_ &&
15080           current2_ == typed_other->current2_ &&
15081           current3_ == typed_other->current3_ &&
15082           current4_ == typed_other->current4_ &&
15083           current5_ == typed_other->current5_ &&
15084           current6_ == typed_other->current6_ &&
15085           current7_ == typed_other->current7_ &&
15086           current8_ == typed_other->current8_ &&
15087           current9_ == typed_other->current9_);
15088     }
15089
15090    private:
15091     Iterator(const Iterator& other)
15092         : base_(other.base_),
15093         begin1_(other.begin1_),
15094         end1_(other.end1_),
15095         current1_(other.current1_),
15096         begin2_(other.begin2_),
15097         end2_(other.end2_),
15098         current2_(other.current2_),
15099         begin3_(other.begin3_),
15100         end3_(other.end3_),
15101         current3_(other.current3_),
15102         begin4_(other.begin4_),
15103         end4_(other.end4_),
15104         current4_(other.current4_),
15105         begin5_(other.begin5_),
15106         end5_(other.end5_),
15107         current5_(other.current5_),
15108         begin6_(other.begin6_),
15109         end6_(other.end6_),
15110         current6_(other.current6_),
15111         begin7_(other.begin7_),
15112         end7_(other.end7_),
15113         current7_(other.current7_),
15114         begin8_(other.begin8_),
15115         end8_(other.end8_),
15116         current8_(other.current8_),
15117         begin9_(other.begin9_),
15118         end9_(other.end9_),
15119         current9_(other.current9_) {
15120       ComputeCurrentValue();
15121     }
15122
15123     void ComputeCurrentValue() {
15124       if (!AtEnd())
15125         current_value_ = ParamType(*current1_, *current2_, *current3_,
15126             *current4_, *current5_, *current6_, *current7_, *current8_,
15127             *current9_);
15128     }
15129     bool AtEnd() const {
15130       // We must report iterator past the end of the range when either of the
15131       // component iterators has reached the end of its range.
15132       return
15133           current1_ == end1_ ||
15134           current2_ == end2_ ||
15135           current3_ == end3_ ||
15136           current4_ == end4_ ||
15137           current5_ == end5_ ||
15138           current6_ == end6_ ||
15139           current7_ == end7_ ||
15140           current8_ == end8_ ||
15141           current9_ == end9_;
15142     }
15143
15144     // No implementation - assignment is unsupported.
15145     void operator=(const Iterator& other);
15146
15147     const ParamGeneratorInterface<ParamType>* const base_;
15148     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15149     // current[i]_ is the actual traversing iterator.
15150     const typename ParamGenerator<T1>::iterator begin1_;
15151     const typename ParamGenerator<T1>::iterator end1_;
15152     typename ParamGenerator<T1>::iterator current1_;
15153     const typename ParamGenerator<T2>::iterator begin2_;
15154     const typename ParamGenerator<T2>::iterator end2_;
15155     typename ParamGenerator<T2>::iterator current2_;
15156     const typename ParamGenerator<T3>::iterator begin3_;
15157     const typename ParamGenerator<T3>::iterator end3_;
15158     typename ParamGenerator<T3>::iterator current3_;
15159     const typename ParamGenerator<T4>::iterator begin4_;
15160     const typename ParamGenerator<T4>::iterator end4_;
15161     typename ParamGenerator<T4>::iterator current4_;
15162     const typename ParamGenerator<T5>::iterator begin5_;
15163     const typename ParamGenerator<T5>::iterator end5_;
15164     typename ParamGenerator<T5>::iterator current5_;
15165     const typename ParamGenerator<T6>::iterator begin6_;
15166     const typename ParamGenerator<T6>::iterator end6_;
15167     typename ParamGenerator<T6>::iterator current6_;
15168     const typename ParamGenerator<T7>::iterator begin7_;
15169     const typename ParamGenerator<T7>::iterator end7_;
15170     typename ParamGenerator<T7>::iterator current7_;
15171     const typename ParamGenerator<T8>::iterator begin8_;
15172     const typename ParamGenerator<T8>::iterator end8_;
15173     typename ParamGenerator<T8>::iterator current8_;
15174     const typename ParamGenerator<T9>::iterator begin9_;
15175     const typename ParamGenerator<T9>::iterator end9_;
15176     typename ParamGenerator<T9>::iterator current9_;
15177     ParamType current_value_;
15178   };  // class CartesianProductGenerator9::Iterator
15179
15180   // No implementation - assignment is unsupported.
15181   void operator=(const CartesianProductGenerator9& other);
15182
15183   const ParamGenerator<T1> g1_;
15184   const ParamGenerator<T2> g2_;
15185   const ParamGenerator<T3> g3_;
15186   const ParamGenerator<T4> g4_;
15187   const ParamGenerator<T5> g5_;
15188   const ParamGenerator<T6> g6_;
15189   const ParamGenerator<T7> g7_;
15190   const ParamGenerator<T8> g8_;
15191   const ParamGenerator<T9> g9_;
15192 };  // class CartesianProductGenerator9
15193
15194
15195 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15196     typename T6, typename T7, typename T8, typename T9, typename T10>
15197 class CartesianProductGenerator10
15198     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15199         T7, T8, T9, T10> > {
15200  public:
15201   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
15202
15203   CartesianProductGenerator10(const ParamGenerator<T1>& g1,
15204       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15205       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15206       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
15207       const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
15208       const ParamGenerator<T10>& g10)
15209       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15210           g9_(g9), g10_(g10) {}
15211   virtual ~CartesianProductGenerator10() {}
15212
15213   virtual ParamIteratorInterface<ParamType>* Begin() const {
15214     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15215         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
15216         g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
15217   }
15218   virtual ParamIteratorInterface<ParamType>* End() const {
15219     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15220         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
15221         g8_.end(), g9_, g9_.end(), g10_, g10_.end());
15222   }
15223
15224  private:
15225   class Iterator : public ParamIteratorInterface<ParamType> {
15226    public:
15227     Iterator(const ParamGeneratorInterface<ParamType>* base,
15228       const ParamGenerator<T1>& g1,
15229       const typename ParamGenerator<T1>::iterator& current1,
15230       const ParamGenerator<T2>& g2,
15231       const typename ParamGenerator<T2>::iterator& current2,
15232       const ParamGenerator<T3>& g3,
15233       const typename ParamGenerator<T3>::iterator& current3,
15234       const ParamGenerator<T4>& g4,
15235       const typename ParamGenerator<T4>::iterator& current4,
15236       const ParamGenerator<T5>& g5,
15237       const typename ParamGenerator<T5>::iterator& current5,
15238       const ParamGenerator<T6>& g6,
15239       const typename ParamGenerator<T6>::iterator& current6,
15240       const ParamGenerator<T7>& g7,
15241       const typename ParamGenerator<T7>::iterator& current7,
15242       const ParamGenerator<T8>& g8,
15243       const typename ParamGenerator<T8>::iterator& current8,
15244       const ParamGenerator<T9>& g9,
15245       const typename ParamGenerator<T9>::iterator& current9,
15246       const ParamGenerator<T10>& g10,
15247       const typename ParamGenerator<T10>::iterator& current10)
15248         : base_(base),
15249           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15250           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15251           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15252           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15253           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15254           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15255           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15256           begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15257           begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
15258           begin10_(g10.begin()), end10_(g10.end()), current10_(current10)    {
15259       ComputeCurrentValue();
15260     }
15261     virtual ~Iterator() {}
15262
15263     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15264       return base_;
15265     }
15266     // Advance should not be called on beyond-of-range iterators
15267     // so no component iterators must be beyond end of range, either.
15268     virtual void Advance() {
15269       assert(!AtEnd());
15270       ++current10_;
15271       if (current10_ == end10_) {
15272         current10_ = begin10_;
15273         ++current9_;
15274       }
15275       if (current9_ == end9_) {
15276         current9_ = begin9_;
15277         ++current8_;
15278       }
15279       if (current8_ == end8_) {
15280         current8_ = begin8_;
15281         ++current7_;
15282       }
15283       if (current7_ == end7_) {
15284         current7_ = begin7_;
15285         ++current6_;
15286       }
15287       if (current6_ == end6_) {
15288         current6_ = begin6_;
15289         ++current5_;
15290       }
15291       if (current5_ == end5_) {
15292         current5_ = begin5_;
15293         ++current4_;
15294       }
15295       if (current4_ == end4_) {
15296         current4_ = begin4_;
15297         ++current3_;
15298       }
15299       if (current3_ == end3_) {
15300         current3_ = begin3_;
15301         ++current2_;
15302       }
15303       if (current2_ == end2_) {
15304         current2_ = begin2_;
15305         ++current1_;
15306       }
15307       ComputeCurrentValue();
15308     }
15309     virtual ParamIteratorInterface<ParamType>* Clone() const {
15310       return new Iterator(*this);
15311     }
15312     virtual const ParamType* Current() const { return &current_value_; }
15313     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15314       // Having the same base generator guarantees that the other
15315       // iterator is of the same type and we can downcast.
15316       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15317           << "The program attempted to compare iterators "
15318           << "from different generators." << std::endl;
15319       const Iterator* typed_other =
15320           CheckedDowncastToActualType<const Iterator>(&other);
15321       // We must report iterators equal if they both point beyond their
15322       // respective ranges. That can happen in a variety of fashions,
15323       // so we have to consult AtEnd().
15324       return (AtEnd() && typed_other->AtEnd()) ||
15325          (
15326           current1_ == typed_other->current1_ &&
15327           current2_ == typed_other->current2_ &&
15328           current3_ == typed_other->current3_ &&
15329           current4_ == typed_other->current4_ &&
15330           current5_ == typed_other->current5_ &&
15331           current6_ == typed_other->current6_ &&
15332           current7_ == typed_other->current7_ &&
15333           current8_ == typed_other->current8_ &&
15334           current9_ == typed_other->current9_ &&
15335           current10_ == typed_other->current10_);
15336     }
15337
15338    private:
15339     Iterator(const Iterator& other)
15340         : base_(other.base_),
15341         begin1_(other.begin1_),
15342         end1_(other.end1_),
15343         current1_(other.current1_),
15344         begin2_(other.begin2_),
15345         end2_(other.end2_),
15346         current2_(other.current2_),
15347         begin3_(other.begin3_),
15348         end3_(other.end3_),
15349         current3_(other.current3_),
15350         begin4_(other.begin4_),
15351         end4_(other.end4_),
15352         current4_(other.current4_),
15353         begin5_(other.begin5_),
15354         end5_(other.end5_),
15355         current5_(other.current5_),
15356         begin6_(other.begin6_),
15357         end6_(other.end6_),
15358         current6_(other.current6_),
15359         begin7_(other.begin7_),
15360         end7_(other.end7_),
15361         current7_(other.current7_),
15362         begin8_(other.begin8_),
15363         end8_(other.end8_),
15364         current8_(other.current8_),
15365         begin9_(other.begin9_),
15366         end9_(other.end9_),
15367         current9_(other.current9_),
15368         begin10_(other.begin10_),
15369         end10_(other.end10_),
15370         current10_(other.current10_) {
15371       ComputeCurrentValue();
15372     }
15373
15374     void ComputeCurrentValue() {
15375       if (!AtEnd())
15376         current_value_ = ParamType(*current1_, *current2_, *current3_,
15377             *current4_, *current5_, *current6_, *current7_, *current8_,
15378             *current9_, *current10_);
15379     }
15380     bool AtEnd() const {
15381       // We must report iterator past the end of the range when either of the
15382       // component iterators has reached the end of its range.
15383       return
15384           current1_ == end1_ ||
15385           current2_ == end2_ ||
15386           current3_ == end3_ ||
15387           current4_ == end4_ ||
15388           current5_ == end5_ ||
15389           current6_ == end6_ ||
15390           current7_ == end7_ ||
15391           current8_ == end8_ ||
15392           current9_ == end9_ ||
15393           current10_ == end10_;
15394     }
15395
15396     // No implementation - assignment is unsupported.
15397     void operator=(const Iterator& other);
15398
15399     const ParamGeneratorInterface<ParamType>* const base_;
15400     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15401     // current[i]_ is the actual traversing iterator.
15402     const typename ParamGenerator<T1>::iterator begin1_;
15403     const typename ParamGenerator<T1>::iterator end1_;
15404     typename ParamGenerator<T1>::iterator current1_;
15405     const typename ParamGenerator<T2>::iterator begin2_;
15406     const typename ParamGenerator<T2>::iterator end2_;
15407     typename ParamGenerator<T2>::iterator current2_;
15408     const typename ParamGenerator<T3>::iterator begin3_;
15409     const typename ParamGenerator<T3>::iterator end3_;
15410     typename ParamGenerator<T3>::iterator current3_;
15411     const typename ParamGenerator<T4>::iterator begin4_;
15412     const typename ParamGenerator<T4>::iterator end4_;
15413     typename ParamGenerator<T4>::iterator current4_;
15414     const typename ParamGenerator<T5>::iterator begin5_;
15415     const typename ParamGenerator<T5>::iterator end5_;
15416     typename ParamGenerator<T5>::iterator current5_;
15417     const typename ParamGenerator<T6>::iterator begin6_;
15418     const typename ParamGenerator<T6>::iterator end6_;
15419     typename ParamGenerator<T6>::iterator current6_;
15420     const typename ParamGenerator<T7>::iterator begin7_;
15421     const typename ParamGenerator<T7>::iterator end7_;
15422     typename ParamGenerator<T7>::iterator current7_;
15423     const typename ParamGenerator<T8>::iterator begin8_;
15424     const typename ParamGenerator<T8>::iterator end8_;
15425     typename ParamGenerator<T8>::iterator current8_;
15426     const typename ParamGenerator<T9>::iterator begin9_;
15427     const typename ParamGenerator<T9>::iterator end9_;
15428     typename ParamGenerator<T9>::iterator current9_;
15429     const typename ParamGenerator<T10>::iterator begin10_;
15430     const typename ParamGenerator<T10>::iterator end10_;
15431     typename ParamGenerator<T10>::iterator current10_;
15432     ParamType current_value_;
15433   };  // class CartesianProductGenerator10::Iterator
15434
15435   // No implementation - assignment is unsupported.
15436   void operator=(const CartesianProductGenerator10& other);
15437
15438   const ParamGenerator<T1> g1_;
15439   const ParamGenerator<T2> g2_;
15440   const ParamGenerator<T3> g3_;
15441   const ParamGenerator<T4> g4_;
15442   const ParamGenerator<T5> g5_;
15443   const ParamGenerator<T6> g6_;
15444   const ParamGenerator<T7> g7_;
15445   const ParamGenerator<T8> g8_;
15446   const ParamGenerator<T9> g9_;
15447   const ParamGenerator<T10> g10_;
15448 };  // class CartesianProductGenerator10
15449
15450
15451 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15452 //
15453 // Helper classes providing Combine() with polymorphic features. They allow
15454 // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
15455 // convertible to U.
15456 //
15457 template <class Generator1, class Generator2>
15458 class CartesianProductHolder2 {
15459  public:
15460 CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
15461       : g1_(g1), g2_(g2) {}
15462   template <typename T1, typename T2>
15463   operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
15464     return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
15465         new CartesianProductGenerator2<T1, T2>(
15466         static_cast<ParamGenerator<T1> >(g1_),
15467         static_cast<ParamGenerator<T2> >(g2_)));
15468   }
15469
15470  private:
15471   // No implementation - assignment is unsupported.
15472   void operator=(const CartesianProductHolder2& other);
15473
15474   const Generator1 g1_;
15475   const Generator2 g2_;
15476 };  // class CartesianProductHolder2
15477
15478 template <class Generator1, class Generator2, class Generator3>
15479 class CartesianProductHolder3 {
15480  public:
15481 CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
15482     const Generator3& g3)
15483       : g1_(g1), g2_(g2), g3_(g3) {}
15484   template <typename T1, typename T2, typename T3>
15485   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
15486     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
15487         new CartesianProductGenerator3<T1, T2, T3>(
15488         static_cast<ParamGenerator<T1> >(g1_),
15489         static_cast<ParamGenerator<T2> >(g2_),
15490         static_cast<ParamGenerator<T3> >(g3_)));
15491   }
15492
15493  private:
15494   // No implementation - assignment is unsupported.
15495   void operator=(const CartesianProductHolder3& other);
15496
15497   const Generator1 g1_;
15498   const Generator2 g2_;
15499   const Generator3 g3_;
15500 };  // class CartesianProductHolder3
15501
15502 template <class Generator1, class Generator2, class Generator3,
15503     class Generator4>
15504 class CartesianProductHolder4 {
15505  public:
15506 CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
15507     const Generator3& g3, const Generator4& g4)
15508       : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
15509   template <typename T1, typename T2, typename T3, typename T4>
15510   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
15511     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
15512         new CartesianProductGenerator4<T1, T2, T3, T4>(
15513         static_cast<ParamGenerator<T1> >(g1_),
15514         static_cast<ParamGenerator<T2> >(g2_),
15515         static_cast<ParamGenerator<T3> >(g3_),
15516         static_cast<ParamGenerator<T4> >(g4_)));
15517   }
15518
15519  private:
15520   // No implementation - assignment is unsupported.
15521   void operator=(const CartesianProductHolder4& other);
15522
15523   const Generator1 g1_;
15524   const Generator2 g2_;
15525   const Generator3 g3_;
15526   const Generator4 g4_;
15527 };  // class CartesianProductHolder4
15528
15529 template <class Generator1, class Generator2, class Generator3,
15530     class Generator4, class Generator5>
15531 class CartesianProductHolder5 {
15532  public:
15533 CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
15534     const Generator3& g3, const Generator4& g4, const Generator5& g5)
15535       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
15536   template <typename T1, typename T2, typename T3, typename T4, typename T5>
15537   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
15538     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
15539         new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
15540         static_cast<ParamGenerator<T1> >(g1_),
15541         static_cast<ParamGenerator<T2> >(g2_),
15542         static_cast<ParamGenerator<T3> >(g3_),
15543         static_cast<ParamGenerator<T4> >(g4_),
15544         static_cast<ParamGenerator<T5> >(g5_)));
15545   }
15546
15547  private:
15548   // No implementation - assignment is unsupported.
15549   void operator=(const CartesianProductHolder5& other);
15550
15551   const Generator1 g1_;
15552   const Generator2 g2_;
15553   const Generator3 g3_;
15554   const Generator4 g4_;
15555   const Generator5 g5_;
15556 };  // class CartesianProductHolder5
15557
15558 template <class Generator1, class Generator2, class Generator3,
15559     class Generator4, class Generator5, class Generator6>
15560 class CartesianProductHolder6 {
15561  public:
15562 CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
15563     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15564     const Generator6& g6)
15565       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
15566   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15567       typename T6>
15568   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
15569     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
15570         new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
15571         static_cast<ParamGenerator<T1> >(g1_),
15572         static_cast<ParamGenerator<T2> >(g2_),
15573         static_cast<ParamGenerator<T3> >(g3_),
15574         static_cast<ParamGenerator<T4> >(g4_),
15575         static_cast<ParamGenerator<T5> >(g5_),
15576         static_cast<ParamGenerator<T6> >(g6_)));
15577   }
15578
15579  private:
15580   // No implementation - assignment is unsupported.
15581   void operator=(const CartesianProductHolder6& other);
15582
15583   const Generator1 g1_;
15584   const Generator2 g2_;
15585   const Generator3 g3_;
15586   const Generator4 g4_;
15587   const Generator5 g5_;
15588   const Generator6 g6_;
15589 };  // class CartesianProductHolder6
15590
15591 template <class Generator1, class Generator2, class Generator3,
15592     class Generator4, class Generator5, class Generator6, class Generator7>
15593 class CartesianProductHolder7 {
15594  public:
15595 CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
15596     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15597     const Generator6& g6, const Generator7& g7)
15598       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
15599   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15600       typename T6, typename T7>
15601   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15602       T7> >() const {
15603     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
15604         new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
15605         static_cast<ParamGenerator<T1> >(g1_),
15606         static_cast<ParamGenerator<T2> >(g2_),
15607         static_cast<ParamGenerator<T3> >(g3_),
15608         static_cast<ParamGenerator<T4> >(g4_),
15609         static_cast<ParamGenerator<T5> >(g5_),
15610         static_cast<ParamGenerator<T6> >(g6_),
15611         static_cast<ParamGenerator<T7> >(g7_)));
15612   }
15613
15614  private:
15615   // No implementation - assignment is unsupported.
15616   void operator=(const CartesianProductHolder7& other);
15617
15618   const Generator1 g1_;
15619   const Generator2 g2_;
15620   const Generator3 g3_;
15621   const Generator4 g4_;
15622   const Generator5 g5_;
15623   const Generator6 g6_;
15624   const Generator7 g7_;
15625 };  // class CartesianProductHolder7
15626
15627 template <class Generator1, class Generator2, class Generator3,
15628     class Generator4, class Generator5, class Generator6, class Generator7,
15629     class Generator8>
15630 class CartesianProductHolder8 {
15631  public:
15632 CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
15633     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15634     const Generator6& g6, const Generator7& g7, const Generator8& g8)
15635       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
15636           g8_(g8) {}
15637   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15638       typename T6, typename T7, typename T8>
15639   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
15640       T8> >() const {
15641     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
15642         new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
15643         static_cast<ParamGenerator<T1> >(g1_),
15644         static_cast<ParamGenerator<T2> >(g2_),
15645         static_cast<ParamGenerator<T3> >(g3_),
15646         static_cast<ParamGenerator<T4> >(g4_),
15647         static_cast<ParamGenerator<T5> >(g5_),
15648         static_cast<ParamGenerator<T6> >(g6_),
15649         static_cast<ParamGenerator<T7> >(g7_),
15650         static_cast<ParamGenerator<T8> >(g8_)));
15651   }
15652
15653  private:
15654   // No implementation - assignment is unsupported.
15655   void operator=(const CartesianProductHolder8& other);
15656
15657   const Generator1 g1_;
15658   const Generator2 g2_;
15659   const Generator3 g3_;
15660   const Generator4 g4_;
15661   const Generator5 g5_;
15662   const Generator6 g6_;
15663   const Generator7 g7_;
15664   const Generator8 g8_;
15665 };  // class CartesianProductHolder8
15666
15667 template <class Generator1, class Generator2, class Generator3,
15668     class Generator4, class Generator5, class Generator6, class Generator7,
15669     class Generator8, class Generator9>
15670 class CartesianProductHolder9 {
15671  public:
15672 CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
15673     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15674     const Generator6& g6, const Generator7& g7, const Generator8& g8,
15675     const Generator9& g9)
15676       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15677           g9_(g9) {}
15678   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15679       typename T6, typename T7, typename T8, typename T9>
15680   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15681       T9> >() const {
15682     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15683         T9> >(
15684         new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
15685         static_cast<ParamGenerator<T1> >(g1_),
15686         static_cast<ParamGenerator<T2> >(g2_),
15687         static_cast<ParamGenerator<T3> >(g3_),
15688         static_cast<ParamGenerator<T4> >(g4_),
15689         static_cast<ParamGenerator<T5> >(g5_),
15690         static_cast<ParamGenerator<T6> >(g6_),
15691         static_cast<ParamGenerator<T7> >(g7_),
15692         static_cast<ParamGenerator<T8> >(g8_),
15693         static_cast<ParamGenerator<T9> >(g9_)));
15694   }
15695
15696  private:
15697   // No implementation - assignment is unsupported.
15698   void operator=(const CartesianProductHolder9& other);
15699
15700   const Generator1 g1_;
15701   const Generator2 g2_;
15702   const Generator3 g3_;
15703   const Generator4 g4_;
15704   const Generator5 g5_;
15705   const Generator6 g6_;
15706   const Generator7 g7_;
15707   const Generator8 g8_;
15708   const Generator9 g9_;
15709 };  // class CartesianProductHolder9
15710
15711 template <class Generator1, class Generator2, class Generator3,
15712     class Generator4, class Generator5, class Generator6, class Generator7,
15713     class Generator8, class Generator9, class Generator10>
15714 class CartesianProductHolder10 {
15715  public:
15716 CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
15717     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15718     const Generator6& g6, const Generator7& g7, const Generator8& g8,
15719     const Generator9& g9, const Generator10& g10)
15720       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15721           g9_(g9), g10_(g10) {}
15722   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15723       typename T6, typename T7, typename T8, typename T9, typename T10>
15724   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15725       T9, T10> >() const {
15726     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15727         T9, T10> >(
15728         new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
15729             T10>(
15730         static_cast<ParamGenerator<T1> >(g1_),
15731         static_cast<ParamGenerator<T2> >(g2_),
15732         static_cast<ParamGenerator<T3> >(g3_),
15733         static_cast<ParamGenerator<T4> >(g4_),
15734         static_cast<ParamGenerator<T5> >(g5_),
15735         static_cast<ParamGenerator<T6> >(g6_),
15736         static_cast<ParamGenerator<T7> >(g7_),
15737         static_cast<ParamGenerator<T8> >(g8_),
15738         static_cast<ParamGenerator<T9> >(g9_),
15739         static_cast<ParamGenerator<T10> >(g10_)));
15740   }
15741
15742  private:
15743   // No implementation - assignment is unsupported.
15744   void operator=(const CartesianProductHolder10& other);
15745
15746   const Generator1 g1_;
15747   const Generator2 g2_;
15748   const Generator3 g3_;
15749   const Generator4 g4_;
15750   const Generator5 g5_;
15751   const Generator6 g6_;
15752   const Generator7 g7_;
15753   const Generator8 g8_;
15754   const Generator9 g9_;
15755   const Generator10 g10_;
15756 };  // class CartesianProductHolder10
15757
15758 # endif  // GTEST_HAS_COMBINE
15759
15760 }  // namespace internal
15761 }  // namespace testing
15762
15763 #endif  //  GTEST_HAS_PARAM_TEST
15764
15765 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
15766
15767 #if GTEST_HAS_PARAM_TEST
15768
15769 namespace testing {
15770
15771 // Functions producing parameter generators.
15772 //
15773 // Google Test uses these generators to produce parameters for value-
15774 // parameterized tests. When a parameterized test case is instantiated
15775 // with a particular generator, Google Test creates and runs tests
15776 // for each element in the sequence produced by the generator.
15777 //
15778 // In the following sample, tests from test case FooTest are instantiated
15779 // each three times with parameter values 3, 5, and 8:
15780 //
15781 // class FooTest : public TestWithParam<int> { ... };
15782 //
15783 // TEST_P(FooTest, TestThis) {
15784 // }
15785 // TEST_P(FooTest, TestThat) {
15786 // }
15787 // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
15788 //
15789
15790 // Range() returns generators providing sequences of values in a range.
15791 //
15792 // Synopsis:
15793 // Range(start, end)
15794 //   - returns a generator producing a sequence of values {start, start+1,
15795 //     start+2, ..., }.
15796 // Range(start, end, step)
15797 //   - returns a generator producing a sequence of values {start, start+step,
15798 //     start+step+step, ..., }.
15799 // Notes:
15800 //   * The generated sequences never include end. For example, Range(1, 5)
15801 //     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
15802 //     returns a generator producing {1, 3, 5, 7}.
15803 //   * start and end must have the same type. That type may be any integral or
15804 //     floating-point type or a user defined type satisfying these conditions:
15805 //     * It must be assignable (have operator=() defined).
15806 //     * It must have operator+() (operator+(int-compatible type) for
15807 //       two-operand version).
15808 //     * It must have operator<() defined.
15809 //     Elements in the resulting sequences will also have that type.
15810 //   * Condition start < end must be satisfied in order for resulting sequences
15811 //     to contain any elements.
15812 //
15813 template <typename T, typename IncrementT>
15814 internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
15815   return internal::ParamGenerator<T>(
15816       new internal::RangeGenerator<T, IncrementT>(start, end, step));
15817 }
15818
15819 template <typename T>
15820 internal::ParamGenerator<T> Range(T start, T end) {
15821   return Range(start, end, 1);
15822 }
15823
15824 // ValuesIn() function allows generation of tests with parameters coming from
15825 // a container.
15826 //
15827 // Synopsis:
15828 // ValuesIn(const T (&array)[N])
15829 //   - returns a generator producing sequences with elements from
15830 //     a C-style array.
15831 // ValuesIn(const Container& container)
15832 //   - returns a generator producing sequences with elements from
15833 //     an STL-style container.
15834 // ValuesIn(Iterator begin, Iterator end)
15835 //   - returns a generator producing sequences with elements from
15836 //     a range [begin, end) defined by a pair of STL-style iterators. These
15837 //     iterators can also be plain C pointers.
15838 //
15839 // Please note that ValuesIn copies the values from the containers
15840 // passed in and keeps them to generate tests in RUN_ALL_TESTS().
15841 //
15842 // Examples:
15843 //
15844 // This instantiates tests from test case StringTest
15845 // each with C-string values of "foo", "bar", and "baz":
15846 //
15847 // const char* strings[] = {"foo", "bar", "baz"};
15848 // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
15849 //
15850 // This instantiates tests from test case StlStringTest
15851 // each with STL strings with values "a" and "b":
15852 //
15853 // ::std::vector< ::std::string> GetParameterStrings() {
15854 //   ::std::vector< ::std::string> v;
15855 //   v.push_back("a");
15856 //   v.push_back("b");
15857 //   return v;
15858 // }
15859 //
15860 // INSTANTIATE_TEST_CASE_P(CharSequence,
15861 //                         StlStringTest,
15862 //                         ValuesIn(GetParameterStrings()));
15863 //
15864 //
15865 // This will also instantiate tests from CharTest
15866 // each with parameter values 'a' and 'b':
15867 //
15868 // ::std::list<char> GetParameterChars() {
15869 //   ::std::list<char> list;
15870 //   list.push_back('a');
15871 //   list.push_back('b');
15872 //   return list;
15873 // }
15874 // ::std::list<char> l = GetParameterChars();
15875 // INSTANTIATE_TEST_CASE_P(CharSequence2,
15876 //                         CharTest,
15877 //                         ValuesIn(l.begin(), l.end()));
15878 //
15879 template <typename ForwardIterator>
15880 internal::ParamGenerator<
15881   typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
15882 ValuesIn(ForwardIterator begin, ForwardIterator end) {
15883   typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
15884       ::value_type ParamType;
15885   return internal::ParamGenerator<ParamType>(
15886       new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
15887 }
15888
15889 template <typename T, size_t N>
15890 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
15891   return ValuesIn(array, array + N);
15892 }
15893
15894 template <class Container>
15895 internal::ParamGenerator<typename Container::value_type> ValuesIn(
15896     const Container& container) {
15897   return ValuesIn(container.begin(), container.end());
15898 }
15899
15900 // Values() allows generating tests from explicitly specified list of
15901 // parameters.
15902 //
15903 // Synopsis:
15904 // Values(T v1, T v2, ..., T vN)
15905 //   - returns a generator producing sequences with elements v1, v2, ..., vN.
15906 //
15907 // For example, this instantiates tests from test case BarTest each
15908 // with values "one", "two", and "three":
15909 //
15910 // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
15911 //
15912 // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
15913 // The exact type of values will depend on the type of parameter in BazTest.
15914 //
15915 // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
15916 //
15917 // Currently, Values() supports from 1 to 50 parameters.
15918 //
15919 template <typename T1>
15920 internal::ValueArray1<T1> Values(T1 v1) {
15921   return internal::ValueArray1<T1>(v1);
15922 }
15923
15924 template <typename T1, typename T2>
15925 internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
15926   return internal::ValueArray2<T1, T2>(v1, v2);
15927 }
15928
15929 template <typename T1, typename T2, typename T3>
15930 internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
15931   return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
15932 }
15933
15934 template <typename T1, typename T2, typename T3, typename T4>
15935 internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
15936   return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
15937 }
15938
15939 template <typename T1, typename T2, typename T3, typename T4, typename T5>
15940 internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
15941     T5 v5) {
15942   return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
15943 }
15944
15945 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15946     typename T6>
15947 internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
15948     T4 v4, T5 v5, T6 v6) {
15949   return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
15950 }
15951
15952 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15953     typename T6, typename T7>
15954 internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
15955     T4 v4, T5 v5, T6 v6, T7 v7) {
15956   return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
15957       v6, v7);
15958 }
15959
15960 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15961     typename T6, typename T7, typename T8>
15962 internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
15963     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
15964   return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
15965       v5, v6, v7, v8);
15966 }
15967
15968 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15969     typename T6, typename T7, typename T8, typename T9>
15970 internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
15971     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
15972   return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
15973       v4, v5, v6, v7, v8, v9);
15974 }
15975
15976 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15977     typename T6, typename T7, typename T8, typename T9, typename T10>
15978 internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
15979     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
15980   return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
15981       v2, v3, v4, v5, v6, v7, v8, v9, v10);
15982 }
15983
15984 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15985     typename T6, typename T7, typename T8, typename T9, typename T10,
15986     typename T11>
15987 internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
15988     T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15989     T10 v10, T11 v11) {
15990   return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
15991       T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
15992 }
15993
15994 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15995     typename T6, typename T7, typename T8, typename T9, typename T10,
15996     typename T11, typename T12>
15997 internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15998     T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15999     T10 v10, T11 v11, T12 v12) {
16000   return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16001       T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
16002 }
16003
16004 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16005     typename T6, typename T7, typename T8, typename T9, typename T10,
16006     typename T11, typename T12, typename T13>
16007 internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
16008     T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16009     T10 v10, T11 v11, T12 v12, T13 v13) {
16010   return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16011       T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
16012 }
16013
16014 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16015     typename T6, typename T7, typename T8, typename T9, typename T10,
16016     typename T11, typename T12, typename T13, typename T14>
16017 internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16018     T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16019     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
16020   return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16021       T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16022       v14);
16023 }
16024
16025 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16026     typename T6, typename T7, typename T8, typename T9, typename T10,
16027     typename T11, typename T12, typename T13, typename T14, typename T15>
16028 internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16029     T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16030     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
16031   return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16032       T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16033       v13, v14, v15);
16034 }
16035
16036 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16037     typename T6, typename T7, typename T8, typename T9, typename T10,
16038     typename T11, typename T12, typename T13, typename T14, typename T15,
16039     typename T16>
16040 internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16041     T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16042     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16043     T16 v16) {
16044   return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16045       T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16046       v12, v13, v14, v15, v16);
16047 }
16048
16049 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16050     typename T6, typename T7, typename T8, typename T9, typename T10,
16051     typename T11, typename T12, typename T13, typename T14, typename T15,
16052     typename T16, typename T17>
16053 internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16054     T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16055     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16056     T16 v16, T17 v17) {
16057   return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16058       T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16059       v11, v12, v13, v14, v15, v16, v17);
16060 }
16061
16062 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16063     typename T6, typename T7, typename T8, typename T9, typename T10,
16064     typename T11, typename T12, typename T13, typename T14, typename T15,
16065     typename T16, typename T17, typename T18>
16066 internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16067     T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16068     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16069     T16 v16, T17 v17, T18 v18) {
16070   return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16071       T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16072       v10, v11, v12, v13, v14, v15, v16, v17, v18);
16073 }
16074
16075 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16076     typename T6, typename T7, typename T8, typename T9, typename T10,
16077     typename T11, typename T12, typename T13, typename T14, typename T15,
16078     typename T16, typename T17, typename T18, typename T19>
16079 internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16080     T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16081     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16082     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
16083   return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16084       T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
16085       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
16086 }
16087
16088 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16089     typename T6, typename T7, typename T8, typename T9, typename T10,
16090     typename T11, typename T12, typename T13, typename T14, typename T15,
16091     typename T16, typename T17, typename T18, typename T19, typename T20>
16092 internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16093     T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16094     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16095     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
16096   return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16097       T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
16098       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
16099 }
16100
16101 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16102     typename T6, typename T7, typename T8, typename T9, typename T10,
16103     typename T11, typename T12, typename T13, typename T14, typename T15,
16104     typename T16, typename T17, typename T18, typename T19, typename T20,
16105     typename T21>
16106 internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16107     T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16108     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16109     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
16110   return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16111       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
16112       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
16113 }
16114
16115 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16116     typename T6, typename T7, typename T8, typename T9, typename T10,
16117     typename T11, typename T12, typename T13, typename T14, typename T15,
16118     typename T16, typename T17, typename T18, typename T19, typename T20,
16119     typename T21, typename T22>
16120 internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16121     T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
16122     T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16123     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16124     T21 v21, T22 v22) {
16125   return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16126       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
16127       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16128       v20, v21, v22);
16129 }
16130
16131 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16132     typename T6, typename T7, typename T8, typename T9, typename T10,
16133     typename T11, typename T12, typename T13, typename T14, typename T15,
16134     typename T16, typename T17, typename T18, typename T19, typename T20,
16135     typename T21, typename T22, typename T23>
16136 internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16137     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
16138     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16139     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16140     T21 v21, T22 v22, T23 v23) {
16141   return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16142       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
16143       v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16144       v20, v21, v22, v23);
16145 }
16146
16147 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16148     typename T6, typename T7, typename T8, typename T9, typename T10,
16149     typename T11, typename T12, typename T13, typename T14, typename T15,
16150     typename T16, typename T17, typename T18, typename T19, typename T20,
16151     typename T21, typename T22, typename T23, typename T24>
16152 internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16153     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
16154     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16155     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16156     T21 v21, T22 v22, T23 v23, T24 v24) {
16157   return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16158       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
16159       v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16160       v19, v20, v21, v22, v23, v24);
16161 }
16162
16163 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16164     typename T6, typename T7, typename T8, typename T9, typename T10,
16165     typename T11, typename T12, typename T13, typename T14, typename T15,
16166     typename T16, typename T17, typename T18, typename T19, typename T20,
16167     typename T21, typename T22, typename T23, typename T24, typename T25>
16168 internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16169     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
16170     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16171     T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16172     T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
16173   return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16174       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
16175       v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16176       v18, v19, v20, v21, v22, v23, v24, v25);
16177 }
16178
16179 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16180     typename T6, typename T7, typename T8, typename T9, typename T10,
16181     typename T11, typename T12, typename T13, typename T14, typename T15,
16182     typename T16, typename T17, typename T18, typename T19, typename T20,
16183     typename T21, typename T22, typename T23, typename T24, typename T25,
16184     typename T26>
16185 internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16186     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16187     T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16188     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16189     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16190     T26 v26) {
16191   return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16192       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16193       T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16194       v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
16195 }
16196
16197 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16198     typename T6, typename T7, typename T8, typename T9, typename T10,
16199     typename T11, typename T12, typename T13, typename T14, typename T15,
16200     typename T16, typename T17, typename T18, typename T19, typename T20,
16201     typename T21, typename T22, typename T23, typename T24, typename T25,
16202     typename T26, typename T27>
16203 internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16204     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
16205     T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16206     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16207     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16208     T26 v26, T27 v27) {
16209   return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16210       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16211       T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16212       v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
16213 }
16214
16215 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16216     typename T6, typename T7, typename T8, typename T9, typename T10,
16217     typename T11, typename T12, typename T13, typename T14, typename T15,
16218     typename T16, typename T17, typename T18, typename T19, typename T20,
16219     typename T21, typename T22, typename T23, typename T24, typename T25,
16220     typename T26, typename T27, typename T28>
16221 internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16222     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
16223     T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16224     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16225     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16226     T26 v26, T27 v27, T28 v28) {
16227   return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16228       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16229       T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16230       v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16231       v28);
16232 }
16233
16234 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16235     typename T6, typename T7, typename T8, typename T9, typename T10,
16236     typename T11, typename T12, typename T13, typename T14, typename T15,
16237     typename T16, typename T17, typename T18, typename T19, typename T20,
16238     typename T21, typename T22, typename T23, typename T24, typename T25,
16239     typename T26, typename T27, typename T28, typename T29>
16240 internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16241     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16242     T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16243     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16244     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16245     T26 v26, T27 v27, T28 v28, T29 v29) {
16246   return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16247       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16248       T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16249       v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16250       v27, v28, v29);
16251 }
16252
16253 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16254     typename T6, typename T7, typename T8, typename T9, typename T10,
16255     typename T11, typename T12, typename T13, typename T14, typename T15,
16256     typename T16, typename T17, typename T18, typename T19, typename T20,
16257     typename T21, typename T22, typename T23, typename T24, typename T25,
16258     typename T26, typename T27, typename T28, typename T29, typename T30>
16259 internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16260     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16261     T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16262     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16263     T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16264     T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
16265   return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16266       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16267       T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16268       v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16269       v26, v27, v28, v29, v30);
16270 }
16271
16272 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16273     typename T6, typename T7, typename T8, typename T9, typename T10,
16274     typename T11, typename T12, typename T13, typename T14, typename T15,
16275     typename T16, typename T17, typename T18, typename T19, typename T20,
16276     typename T21, typename T22, typename T23, typename T24, typename T25,
16277     typename T26, typename T27, typename T28, typename T29, typename T30,
16278     typename T31>
16279 internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16280     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16281     T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16282     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16283     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16284     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
16285   return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16286       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16287       T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16288       v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16289       v25, v26, v27, v28, v29, v30, v31);
16290 }
16291
16292 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16293     typename T6, typename T7, typename T8, typename T9, typename T10,
16294     typename T11, typename T12, typename T13, typename T14, typename T15,
16295     typename T16, typename T17, typename T18, typename T19, typename T20,
16296     typename T21, typename T22, typename T23, typename T24, typename T25,
16297     typename T26, typename T27, typename T28, typename T29, typename T30,
16298     typename T31, typename T32>
16299 internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16300     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16301     T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16302     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16303     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16304     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16305     T32 v32) {
16306   return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16307       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16308       T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16309       v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16310       v24, v25, v26, v27, v28, v29, v30, v31, v32);
16311 }
16312
16313 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16314     typename T6, typename T7, typename T8, typename T9, typename T10,
16315     typename T11, typename T12, typename T13, typename T14, typename T15,
16316     typename T16, typename T17, typename T18, typename T19, typename T20,
16317     typename T21, typename T22, typename T23, typename T24, typename T25,
16318     typename T26, typename T27, typename T28, typename T29, typename T30,
16319     typename T31, typename T32, typename T33>
16320 internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16321     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16322     T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16323     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16324     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16325     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16326     T32 v32, T33 v33) {
16327   return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16328       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16329       T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
16330       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16331       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
16332 }
16333
16334 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16335     typename T6, typename T7, typename T8, typename T9, typename T10,
16336     typename T11, typename T12, typename T13, typename T14, typename T15,
16337     typename T16, typename T17, typename T18, typename T19, typename T20,
16338     typename T21, typename T22, typename T23, typename T24, typename T25,
16339     typename T26, typename T27, typename T28, typename T29, typename T30,
16340     typename T31, typename T32, typename T33, typename T34>
16341 internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16342     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16343     T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16344     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16345     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16346     T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16347     T31 v31, T32 v32, T33 v33, T34 v34) {
16348   return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16349       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16350       T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
16351       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16352       v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
16353 }
16354
16355 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16356     typename T6, typename T7, typename T8, typename T9, typename T10,
16357     typename T11, typename T12, typename T13, typename T14, typename T15,
16358     typename T16, typename T17, typename T18, typename T19, typename T20,
16359     typename T21, typename T22, typename T23, typename T24, typename T25,
16360     typename T26, typename T27, typename T28, typename T29, typename T30,
16361     typename T31, typename T32, typename T33, typename T34, typename T35>
16362 internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16363     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16364     T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16365     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16366     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16367     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16368     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
16369   return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16370       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16371       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
16372       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16373       v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
16374 }
16375
16376 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16377     typename T6, typename T7, typename T8, typename T9, typename T10,
16378     typename T11, typename T12, typename T13, typename T14, typename T15,
16379     typename T16, typename T17, typename T18, typename T19, typename T20,
16380     typename T21, typename T22, typename T23, typename T24, typename T25,
16381     typename T26, typename T27, typename T28, typename T29, typename T30,
16382     typename T31, typename T32, typename T33, typename T34, typename T35,
16383     typename T36>
16384 internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16385     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16386     T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16387     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16388     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16389     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16390     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
16391   return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16392       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16393       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
16394       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16395       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16396       v34, v35, v36);
16397 }
16398
16399 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16400     typename T6, typename T7, typename T8, typename T9, typename T10,
16401     typename T11, typename T12, typename T13, typename T14, typename T15,
16402     typename T16, typename T17, typename T18, typename T19, typename T20,
16403     typename T21, typename T22, typename T23, typename T24, typename T25,
16404     typename T26, typename T27, typename T28, typename T29, typename T30,
16405     typename T31, typename T32, typename T33, typename T34, typename T35,
16406     typename T36, typename T37>
16407 internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16408     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16409     T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
16410     T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16411     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16412     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16413     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16414     T37 v37) {
16415   return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16416       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16417       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
16418       v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16419       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16420       v34, v35, v36, v37);
16421 }
16422
16423 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16424     typename T6, typename T7, typename T8, typename T9, typename T10,
16425     typename T11, typename T12, typename T13, typename T14, typename T15,
16426     typename T16, typename T17, typename T18, typename T19, typename T20,
16427     typename T21, typename T22, typename T23, typename T24, typename T25,
16428     typename T26, typename T27, typename T28, typename T29, typename T30,
16429     typename T31, typename T32, typename T33, typename T34, typename T35,
16430     typename T36, typename T37, typename T38>
16431 internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16432     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16433     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
16434     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16435     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16436     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16437     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16438     T37 v37, T38 v38) {
16439   return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16440       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16441       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
16442       v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16443       v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
16444       v33, v34, v35, v36, v37, v38);
16445 }
16446
16447 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16448     typename T6, typename T7, typename T8, typename T9, typename T10,
16449     typename T11, typename T12, typename T13, typename T14, typename T15,
16450     typename T16, typename T17, typename T18, typename T19, typename T20,
16451     typename T21, typename T22, typename T23, typename T24, typename T25,
16452     typename T26, typename T27, typename T28, typename T29, typename T30,
16453     typename T31, typename T32, typename T33, typename T34, typename T35,
16454     typename T36, typename T37, typename T38, typename T39>
16455 internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16456     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16457     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
16458     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16459     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16460     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16461     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16462     T37 v37, T38 v38, T39 v39) {
16463   return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16464       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16465       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
16466       v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16467       v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
16468       v32, v33, v34, v35, v36, v37, v38, v39);
16469 }
16470
16471 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16472     typename T6, typename T7, typename T8, typename T9, typename T10,
16473     typename T11, typename T12, typename T13, typename T14, typename T15,
16474     typename T16, typename T17, typename T18, typename T19, typename T20,
16475     typename T21, typename T22, typename T23, typename T24, typename T25,
16476     typename T26, typename T27, typename T28, typename T29, typename T30,
16477     typename T31, typename T32, typename T33, typename T34, typename T35,
16478     typename T36, typename T37, typename T38, typename T39, typename T40>
16479 internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16480     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16481     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
16482     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16483     T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16484     T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
16485     T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
16486     T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
16487   return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16488       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16489       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16490       T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16491       v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
16492       v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
16493 }
16494
16495 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16496     typename T6, typename T7, typename T8, typename T9, typename T10,
16497     typename T11, typename T12, typename T13, typename T14, typename T15,
16498     typename T16, typename T17, typename T18, typename T19, typename T20,
16499     typename T21, typename T22, typename T23, typename T24, typename T25,
16500     typename T26, typename T27, typename T28, typename T29, typename T30,
16501     typename T31, typename T32, typename T33, typename T34, typename T35,
16502     typename T36, typename T37, typename T38, typename T39, typename T40,
16503     typename T41>
16504 internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16505     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16506     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
16507     T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16508     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16509     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16510     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16511     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
16512   return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16513       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16514       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16515       T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16516       v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
16517       v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
16518 }
16519
16520 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16521     typename T6, typename T7, typename T8, typename T9, typename T10,
16522     typename T11, typename T12, typename T13, typename T14, typename T15,
16523     typename T16, typename T17, typename T18, typename T19, typename T20,
16524     typename T21, typename T22, typename T23, typename T24, typename T25,
16525     typename T26, typename T27, typename T28, typename T29, typename T30,
16526     typename T31, typename T32, typename T33, typename T34, typename T35,
16527     typename T36, typename T37, typename T38, typename T39, typename T40,
16528     typename T41, typename T42>
16529 internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16530     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16531     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
16532     T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16533     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16534     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16535     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16536     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16537     T42 v42) {
16538   return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16539       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16540       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16541       T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16542       v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16543       v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
16544       v42);
16545 }
16546
16547 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16548     typename T6, typename T7, typename T8, typename T9, typename T10,
16549     typename T11, typename T12, typename T13, typename T14, typename T15,
16550     typename T16, typename T17, typename T18, typename T19, typename T20,
16551     typename T21, typename T22, typename T23, typename T24, typename T25,
16552     typename T26, typename T27, typename T28, typename T29, typename T30,
16553     typename T31, typename T32, typename T33, typename T34, typename T35,
16554     typename T36, typename T37, typename T38, typename T39, typename T40,
16555     typename T41, typename T42, typename T43>
16556 internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16557     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16558     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
16559     T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16560     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16561     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16562     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16563     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16564     T42 v42, T43 v43) {
16565   return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16566       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16567       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16568       T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16569       v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16570       v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
16571       v41, v42, v43);
16572 }
16573
16574 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16575     typename T6, typename T7, typename T8, typename T9, typename T10,
16576     typename T11, typename T12, typename T13, typename T14, typename T15,
16577     typename T16, typename T17, typename T18, typename T19, typename T20,
16578     typename T21, typename T22, typename T23, typename T24, typename T25,
16579     typename T26, typename T27, typename T28, typename T29, typename T30,
16580     typename T31, typename T32, typename T33, typename T34, typename T35,
16581     typename T36, typename T37, typename T38, typename T39, typename T40,
16582     typename T41, typename T42, typename T43, typename T44>
16583 internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16584     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16585     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16586     T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16587     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16588     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16589     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16590     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16591     T42 v42, T43 v43, T44 v44) {
16592   return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16593       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16594       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16595       T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16596       v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16597       v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
16598       v40, v41, v42, v43, v44);
16599 }
16600
16601 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16602     typename T6, typename T7, typename T8, typename T9, typename T10,
16603     typename T11, typename T12, typename T13, typename T14, typename T15,
16604     typename T16, typename T17, typename T18, typename T19, typename T20,
16605     typename T21, typename T22, typename T23, typename T24, typename T25,
16606     typename T26, typename T27, typename T28, typename T29, typename T30,
16607     typename T31, typename T32, typename T33, typename T34, typename T35,
16608     typename T36, typename T37, typename T38, typename T39, typename T40,
16609     typename T41, typename T42, typename T43, typename T44, typename T45>
16610 internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16611     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16612     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16613     T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16614     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16615     T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16616     T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
16617     T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
16618     T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
16619   return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16620       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16621       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16622       T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16623       v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16624       v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
16625       v39, v40, v41, v42, v43, v44, v45);
16626 }
16627
16628 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16629     typename T6, typename T7, typename T8, typename T9, typename T10,
16630     typename T11, typename T12, typename T13, typename T14, typename T15,
16631     typename T16, typename T17, typename T18, typename T19, typename T20,
16632     typename T21, typename T22, typename T23, typename T24, typename T25,
16633     typename T26, typename T27, typename T28, typename T29, typename T30,
16634     typename T31, typename T32, typename T33, typename T34, typename T35,
16635     typename T36, typename T37, typename T38, typename T39, typename T40,
16636     typename T41, typename T42, typename T43, typename T44, typename T45,
16637     typename T46>
16638 internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16639     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16640     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16641     T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16642     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16643     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16644     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16645     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16646     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
16647   return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16648       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16649       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16650       T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16651       v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16652       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16653       v38, v39, v40, v41, v42, v43, v44, v45, v46);
16654 }
16655
16656 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16657     typename T6, typename T7, typename T8, typename T9, typename T10,
16658     typename T11, typename T12, typename T13, typename T14, typename T15,
16659     typename T16, typename T17, typename T18, typename T19, typename T20,
16660     typename T21, typename T22, typename T23, typename T24, typename T25,
16661     typename T26, typename T27, typename T28, typename T29, typename T30,
16662     typename T31, typename T32, typename T33, typename T34, typename T35,
16663     typename T36, typename T37, typename T38, typename T39, typename T40,
16664     typename T41, typename T42, typename T43, typename T44, typename T45,
16665     typename T46, typename T47>
16666 internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16667     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16668     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16669     T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16670     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16671     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16672     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16673     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16674     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
16675   return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16676       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16677       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16678       T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
16679       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16680       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16681       v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
16682 }
16683
16684 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16685     typename T6, typename T7, typename T8, typename T9, typename T10,
16686     typename T11, typename T12, typename T13, typename T14, typename T15,
16687     typename T16, typename T17, typename T18, typename T19, typename T20,
16688     typename T21, typename T22, typename T23, typename T24, typename T25,
16689     typename T26, typename T27, typename T28, typename T29, typename T30,
16690     typename T31, typename T32, typename T33, typename T34, typename T35,
16691     typename T36, typename T37, typename T38, typename T39, typename T40,
16692     typename T41, typename T42, typename T43, typename T44, typename T45,
16693     typename T46, typename T47, typename T48>
16694 internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16695     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16696     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16697     T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16698     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16699     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16700     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16701     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16702     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
16703     T48 v48) {
16704   return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16705       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16706       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16707       T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
16708       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16709       v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
16710       v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
16711 }
16712
16713 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16714     typename T6, typename T7, typename T8, typename T9, typename T10,
16715     typename T11, typename T12, typename T13, typename T14, typename T15,
16716     typename T16, typename T17, typename T18, typename T19, typename T20,
16717     typename T21, typename T22, typename T23, typename T24, typename T25,
16718     typename T26, typename T27, typename T28, typename T29, typename T30,
16719     typename T31, typename T32, typename T33, typename T34, typename T35,
16720     typename T36, typename T37, typename T38, typename T39, typename T40,
16721     typename T41, typename T42, typename T43, typename T44, typename T45,
16722     typename T46, typename T47, typename T48, typename T49>
16723 internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16724     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16725     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16726     T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16727     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16728     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16729     T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16730     T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
16731     T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
16732     T47 v47, T48 v48, T49 v49) {
16733   return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16734       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16735       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16736       T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
16737       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16738       v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
16739       v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
16740 }
16741
16742 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16743     typename T6, typename T7, typename T8, typename T9, typename T10,
16744     typename T11, typename T12, typename T13, typename T14, typename T15,
16745     typename T16, typename T17, typename T18, typename T19, typename T20,
16746     typename T21, typename T22, typename T23, typename T24, typename T25,
16747     typename T26, typename T27, typename T28, typename T29, typename T30,
16748     typename T31, typename T32, typename T33, typename T34, typename T35,
16749     typename T36, typename T37, typename T38, typename T39, typename T40,
16750     typename T41, typename T42, typename T43, typename T44, typename T45,
16751     typename T46, typename T47, typename T48, typename T49, typename T50>
16752 internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16753     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16754     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16755     T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16756     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16757     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16758     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16759     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
16760     T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
16761     T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
16762   return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16763       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16764       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16765       T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
16766       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16767       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16768       v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
16769       v48, v49, v50);
16770 }
16771
16772 // Bool() allows generating tests with parameters in a set of (false, true).
16773 //
16774 // Synopsis:
16775 // Bool()
16776 //   - returns a generator producing sequences with elements {false, true}.
16777 //
16778 // It is useful when testing code that depends on Boolean flags. Combinations
16779 // of multiple flags can be tested when several Bool()'s are combined using
16780 // Combine() function.
16781 //
16782 // In the following example all tests in the test case FlagDependentTest
16783 // will be instantiated twice with parameters false and true.
16784 //
16785 // class FlagDependentTest : public testing::TestWithParam<bool> {
16786 //   virtual void SetUp() {
16787 //     external_flag = GetParam();
16788 //   }
16789 // }
16790 // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
16791 //
16792 inline internal::ParamGenerator<bool> Bool() {
16793   return Values(false, true);
16794 }
16795
16796 # if GTEST_HAS_COMBINE
16797 // Combine() allows the user to combine two or more sequences to produce
16798 // values of a Cartesian product of those sequences' elements.
16799 //
16800 // Synopsis:
16801 // Combine(gen1, gen2, ..., genN)
16802 //   - returns a generator producing sequences with elements coming from
16803 //     the Cartesian product of elements from the sequences generated by
16804 //     gen1, gen2, ..., genN. The sequence elements will have a type of
16805 //     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
16806 //     of elements from sequences produces by gen1, gen2, ..., genN.
16807 //
16808 // Combine can have up to 10 arguments. This number is currently limited
16809 // by the maximum number of elements in the tuple implementation used by Google
16810 // Test.
16811 //
16812 // Example:
16813 //
16814 // This will instantiate tests in test case AnimalTest each one with
16815 // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
16816 // tuple("dog", BLACK), and tuple("dog", WHITE):
16817 //
16818 // enum Color { BLACK, GRAY, WHITE };
16819 // class AnimalTest
16820 //     : public testing::TestWithParam<tuple<const char*, Color> > {...};
16821 //
16822 // TEST_P(AnimalTest, AnimalLooksNice) {...}
16823 //
16824 // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
16825 //                         Combine(Values("cat", "dog"),
16826 //                                 Values(BLACK, WHITE)));
16827 //
16828 // This will instantiate tests in FlagDependentTest with all variations of two
16829 // Boolean flags:
16830 //
16831 // class FlagDependentTest
16832 //     : public testing::TestWithParam<tuple<bool, bool> > {
16833 //   virtual void SetUp() {
16834 //     // Assigns external_flag_1 and external_flag_2 values from the tuple.
16835 //     tie(external_flag_1, external_flag_2) = GetParam();
16836 //   }
16837 // };
16838 //
16839 // TEST_P(FlagDependentTest, TestFeature1) {
16840 //   // Test your code using external_flag_1 and external_flag_2 here.
16841 // }
16842 // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
16843 //                         Combine(Bool(), Bool()));
16844 //
16845 template <typename Generator1, typename Generator2>
16846 internal::CartesianProductHolder2<Generator1, Generator2> Combine(
16847     const Generator1& g1, const Generator2& g2) {
16848   return internal::CartesianProductHolder2<Generator1, Generator2>(
16849       g1, g2);
16850 }
16851
16852 template <typename Generator1, typename Generator2, typename Generator3>
16853 internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
16854     const Generator1& g1, const Generator2& g2, const Generator3& g3) {
16855   return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
16856       g1, g2, g3);
16857 }
16858
16859 template <typename Generator1, typename Generator2, typename Generator3,
16860     typename Generator4>
16861 internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16862     Generator4> Combine(
16863     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16864         const Generator4& g4) {
16865   return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16866       Generator4>(
16867       g1, g2, g3, g4);
16868 }
16869
16870 template <typename Generator1, typename Generator2, typename Generator3,
16871     typename Generator4, typename Generator5>
16872 internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16873     Generator4, Generator5> Combine(
16874     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16875         const Generator4& g4, const Generator5& g5) {
16876   return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16877       Generator4, Generator5>(
16878       g1, g2, g3, g4, g5);
16879 }
16880
16881 template <typename Generator1, typename Generator2, typename Generator3,
16882     typename Generator4, typename Generator5, typename Generator6>
16883 internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16884     Generator4, Generator5, Generator6> Combine(
16885     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16886         const Generator4& g4, const Generator5& g5, const Generator6& g6) {
16887   return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16888       Generator4, Generator5, Generator6>(
16889       g1, g2, g3, g4, g5, g6);
16890 }
16891
16892 template <typename Generator1, typename Generator2, typename Generator3,
16893     typename Generator4, typename Generator5, typename Generator6,
16894     typename Generator7>
16895 internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16896     Generator4, Generator5, Generator6, Generator7> Combine(
16897     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16898         const Generator4& g4, const Generator5& g5, const Generator6& g6,
16899         const Generator7& g7) {
16900   return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16901       Generator4, Generator5, Generator6, Generator7>(
16902       g1, g2, g3, g4, g5, g6, g7);
16903 }
16904
16905 template <typename Generator1, typename Generator2, typename Generator3,
16906     typename Generator4, typename Generator5, typename Generator6,
16907     typename Generator7, typename Generator8>
16908 internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16909     Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
16910     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16911         const Generator4& g4, const Generator5& g5, const Generator6& g6,
16912         const Generator7& g7, const Generator8& g8) {
16913   return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16914       Generator4, Generator5, Generator6, Generator7, Generator8>(
16915       g1, g2, g3, g4, g5, g6, g7, g8);
16916 }
16917
16918 template <typename Generator1, typename Generator2, typename Generator3,
16919     typename Generator4, typename Generator5, typename Generator6,
16920     typename Generator7, typename Generator8, typename Generator9>
16921 internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16922     Generator4, Generator5, Generator6, Generator7, Generator8,
16923     Generator9> Combine(
16924     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16925         const Generator4& g4, const Generator5& g5, const Generator6& g6,
16926         const Generator7& g7, const Generator8& g8, const Generator9& g9) {
16927   return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16928       Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
16929       g1, g2, g3, g4, g5, g6, g7, g8, g9);
16930 }
16931
16932 template <typename Generator1, typename Generator2, typename Generator3,
16933     typename Generator4, typename Generator5, typename Generator6,
16934     typename Generator7, typename Generator8, typename Generator9,
16935     typename Generator10>
16936 internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16937     Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16938     Generator10> Combine(
16939     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16940         const Generator4& g4, const Generator5& g5, const Generator6& g6,
16941         const Generator7& g7, const Generator8& g8, const Generator9& g9,
16942         const Generator10& g10) {
16943   return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16944       Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16945       Generator10>(
16946       g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
16947 }
16948 # endif  // GTEST_HAS_COMBINE
16949
16950
16951
16952 # define TEST_P(test_case_name, test_name) \
16953   class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
16954       : public test_case_name { \
16955    public: \
16956     GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
16957     virtual void TestBody(); \
16958    private: \
16959     static int AddToRegistry() { \
16960       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
16961           GetTestCasePatternHolder<test_case_name>(\
16962               #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
16963                   #test_case_name, \
16964                   #test_name, \
16965                   new ::testing::internal::TestMetaFactory< \
16966                       GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
16967       return 0; \
16968     } \
16969     static int gtest_registering_dummy_; \
16970     GTEST_DISALLOW_COPY_AND_ASSIGN_(\
16971         GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
16972   }; \
16973   int GTEST_TEST_CLASS_NAME_(test_case_name, \
16974                              test_name)::gtest_registering_dummy_ = \
16975       GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
16976   void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
16977
16978 # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
16979   ::testing::internal::ParamGenerator<test_case_name::ParamType> \
16980       gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
16981   int gtest_##prefix##test_case_name##_dummy_ = \
16982       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
16983           GetTestCasePatternHolder<test_case_name>(\
16984               #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
16985                   #prefix, \
16986                   &gtest_##prefix##test_case_name##_EvalGenerator_, \
16987                   __FILE__, __LINE__)
16988
16989 }  // namespace testing
16990
16991 #endif  // GTEST_HAS_PARAM_TEST
16992
16993 #endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
16994 // Copyright 2006, Google Inc.
16995 // All rights reserved.
16996 //
16997 // Redistribution and use in source and binary forms, with or without
16998 // modification, are permitted provided that the following conditions are
16999 // met:
17000 //
17001 //     * Redistributions of source code must retain the above copyright
17002 // notice, this list of conditions and the following disclaimer.
17003 //     * Redistributions in binary form must reproduce the above
17004 // copyright notice, this list of conditions and the following disclaimer
17005 // in the documentation and/or other materials provided with the
17006 // distribution.
17007 //     * Neither the name of Google Inc. nor the names of its
17008 // contributors may be used to endorse or promote products derived from
17009 // this software without specific prior written permission.
17010 //
17011 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17012 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17013 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17014 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17015 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17016 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17017 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17018 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17019 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17020 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17021 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17022 //
17023 // Author: wan@google.com (Zhanyong Wan)
17024 //
17025 // Google C++ Testing Framework definitions useful in production code.
17026
17027 #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17028 #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17029
17030 // When you need to test the private or protected members of a class,
17031 // use the FRIEND_TEST macro to declare your tests as friends of the
17032 // class.  For example:
17033 //
17034 // class MyClass {
17035 //  private:
17036 //   void MyMethod();
17037 //   FRIEND_TEST(MyClassTest, MyMethod);
17038 // };
17039 //
17040 // class MyClassTest : public testing::Test {
17041 //   // ...
17042 // };
17043 //
17044 // TEST_F(MyClassTest, MyMethod) {
17045 //   // Can call MyClass::MyMethod() here.
17046 // }
17047
17048 #define FRIEND_TEST(test_case_name, test_name)\
17049 friend class test_case_name##_##test_name##_Test
17050
17051 #endif  // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17052 // Copyright 2008, Google Inc.
17053 // All rights reserved.
17054 //
17055 // Redistribution and use in source and binary forms, with or without
17056 // modification, are permitted provided that the following conditions are
17057 // met:
17058 //
17059 //     * Redistributions of source code must retain the above copyright
17060 // notice, this list of conditions and the following disclaimer.
17061 //     * Redistributions in binary form must reproduce the above
17062 // copyright notice, this list of conditions and the following disclaimer
17063 // in the documentation and/or other materials provided with the
17064 // distribution.
17065 //     * Neither the name of Google Inc. nor the names of its
17066 // contributors may be used to endorse or promote products derived from
17067 // this software without specific prior written permission.
17068 //
17069 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17070 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17071 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17072 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17073 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17074 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17075 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17076 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17077 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17078 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17079 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17080 //
17081 // Author: mheule@google.com (Markus Heule)
17082 //
17083
17084 #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17085 #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17086
17087 #include <iosfwd>
17088 #include <vector>
17089
17090 namespace testing {
17091
17092 // A copyable object representing the result of a test part (i.e. an
17093 // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
17094 //
17095 // Don't inherit from TestPartResult as its destructor is not virtual.
17096 class GTEST_API_ TestPartResult {
17097  public:
17098   // The possible outcomes of a test part (i.e. an assertion or an
17099   // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
17100   enum Type {
17101     kSuccess,          // Succeeded.
17102     kNonFatalFailure,  // Failed but the test can continue.
17103     kFatalFailure      // Failed and the test should be terminated.
17104   };
17105
17106   // C'tor.  TestPartResult does NOT have a default constructor.
17107   // Always use this constructor (with parameters) to create a
17108   // TestPartResult object.
17109   TestPartResult(Type a_type,
17110                  const char* a_file_name,
17111                  int a_line_number,
17112                  const char* a_message)
17113       : type_(a_type),
17114         file_name_(a_file_name == NULL ? "" : a_file_name),
17115         line_number_(a_line_number),
17116         summary_(ExtractSummary(a_message)),
17117         message_(a_message) {
17118   }
17119
17120   // Gets the outcome of the test part.
17121   Type type() const { return type_; }
17122
17123   // Gets the name of the source file where the test part took place, or
17124   // NULL if it's unknown.
17125   const char* file_name() const {
17126     return file_name_.empty() ? NULL : file_name_.c_str();
17127   }
17128
17129   // Gets the line in the source file where the test part took place,
17130   // or -1 if it's unknown.
17131   int line_number() const { return line_number_; }
17132
17133   // Gets the summary of the failure message.
17134   const char* summary() const { return summary_.c_str(); }
17135
17136   // Gets the message associated with the test part.
17137   const char* message() const { return message_.c_str(); }
17138
17139   // Returns true iff the test part passed.
17140   bool passed() const { return type_ == kSuccess; }
17141
17142   // Returns true iff the test part failed.
17143   bool failed() const { return type_ != kSuccess; }
17144
17145   // Returns true iff the test part non-fatally failed.
17146   bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
17147
17148   // Returns true iff the test part fatally failed.
17149   bool fatally_failed() const { return type_ == kFatalFailure; }
17150
17151  private:
17152   Type type_;
17153
17154   // Gets the summary of the failure message by omitting the stack
17155   // trace in it.
17156   static std::string ExtractSummary(const char* message);
17157
17158   // The name of the source file where the test part took place, or
17159   // "" if the source file is unknown.
17160   std::string file_name_;
17161   // The line in the source file where the test part took place, or -1
17162   // if the line number is unknown.
17163   int line_number_;
17164   std::string summary_;  // The test failure summary.
17165   std::string message_;  // The test failure message.
17166 };
17167
17168 // Prints a TestPartResult object.
17169 std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
17170
17171 // An array of TestPartResult objects.
17172 //
17173 // Don't inherit from TestPartResultArray as its destructor is not
17174 // virtual.
17175 class GTEST_API_ TestPartResultArray {
17176  public:
17177   TestPartResultArray() {}
17178
17179   // Appends the given TestPartResult to the array.
17180   void Append(const TestPartResult& result);
17181
17182   // Returns the TestPartResult at the given index (0-based).
17183   const TestPartResult& GetTestPartResult(int index) const;
17184
17185   // Returns the number of TestPartResult objects in the array.
17186   int size() const;
17187
17188  private:
17189   std::vector<TestPartResult> array_;
17190
17191   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
17192 };
17193
17194 // This interface knows how to report a test part result.
17195 class TestPartResultReporterInterface {
17196  public:
17197   virtual ~TestPartResultReporterInterface() {}
17198
17199   virtual void ReportTestPartResult(const TestPartResult& result) = 0;
17200 };
17201
17202 namespace internal {
17203
17204 // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
17205 // statement generates new fatal failures. To do so it registers itself as the
17206 // current test part result reporter. Besides checking if fatal failures were
17207 // reported, it only delegates the reporting to the former result reporter.
17208 // The original result reporter is restored in the destructor.
17209 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
17210 class GTEST_API_ HasNewFatalFailureHelper
17211     : public TestPartResultReporterInterface {
17212  public:
17213   HasNewFatalFailureHelper();
17214   virtual ~HasNewFatalFailureHelper();
17215   virtual void ReportTestPartResult(const TestPartResult& result);
17216   bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
17217  private:
17218   bool has_new_fatal_failure_;
17219   TestPartResultReporterInterface* original_reporter_;
17220
17221   GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
17222 };
17223
17224 }  // namespace internal
17225
17226 }  // namespace testing
17227
17228 #endif  // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17229 // Copyright 2008 Google Inc.
17230 // All Rights Reserved.
17231 //
17232 // Redistribution and use in source and binary forms, with or without
17233 // modification, are permitted provided that the following conditions are
17234 // met:
17235 //
17236 //     * Redistributions of source code must retain the above copyright
17237 // notice, this list of conditions and the following disclaimer.
17238 //     * Redistributions in binary form must reproduce the above
17239 // copyright notice, this list of conditions and the following disclaimer
17240 // in the documentation and/or other materials provided with the
17241 // distribution.
17242 //     * Neither the name of Google Inc. nor the names of its
17243 // contributors may be used to endorse or promote products derived from
17244 // this software without specific prior written permission.
17245 //
17246 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17247 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17248 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17249 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17250 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17251 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17252 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17253 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17254 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17255 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17256 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17257 //
17258 // Author: wan@google.com (Zhanyong Wan)
17259
17260 #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17261 #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17262
17263 // This header implements typed tests and type-parameterized tests.
17264
17265 // Typed (aka type-driven) tests repeat the same test for types in a
17266 // list.  You must know which types you want to test with when writing
17267 // typed tests. Here's how you do it:
17268
17269 #if 0
17270
17271 // First, define a fixture class template.  It should be parameterized
17272 // by a type.  Remember to derive it from testing::Test.
17273 template <typename T>
17274 class FooTest : public testing::Test {
17275  public:
17276   ...
17277   typedef std::list<T> List;
17278   static T shared_;
17279   T value_;
17280 };
17281
17282 // Next, associate a list of types with the test case, which will be
17283 // repeated for each type in the list.  The typedef is necessary for
17284 // the macro to parse correctly.
17285 typedef testing::Types<char, int, unsigned int> MyTypes;
17286 TYPED_TEST_CASE(FooTest, MyTypes);
17287
17288 // If the type list contains only one type, you can write that type
17289 // directly without Types<...>:
17290 //   TYPED_TEST_CASE(FooTest, int);
17291
17292 // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
17293 // tests for this test case as you want.
17294 TYPED_TEST(FooTest, DoesBlah) {
17295   // Inside a test, refer to TypeParam to get the type parameter.
17296   // Since we are inside a derived class template, C++ requires use to
17297   // visit the members of FooTest via 'this'.
17298   TypeParam n = this->value_;
17299
17300   // To visit static members of the fixture, add the TestFixture::
17301   // prefix.
17302   n += TestFixture::shared_;
17303
17304   // To refer to typedefs in the fixture, add the "typename
17305   // TestFixture::" prefix.
17306   typename TestFixture::List values;
17307   values.push_back(n);
17308   ...
17309 }
17310
17311 TYPED_TEST(FooTest, HasPropertyA) { ... }
17312
17313 #endif  // 0
17314
17315 // Type-parameterized tests are abstract test patterns parameterized
17316 // by a type.  Compared with typed tests, type-parameterized tests
17317 // allow you to define the test pattern without knowing what the type
17318 // parameters are.  The defined pattern can be instantiated with
17319 // different types any number of times, in any number of translation
17320 // units.
17321 //
17322 // If you are designing an interface or concept, you can define a
17323 // suite of type-parameterized tests to verify properties that any
17324 // valid implementation of the interface/concept should have.  Then,
17325 // each implementation can easily instantiate the test suite to verify
17326 // that it conforms to the requirements, without having to write
17327 // similar tests repeatedly.  Here's an example:
17328
17329 #if 0
17330
17331 // First, define a fixture class template.  It should be parameterized
17332 // by a type.  Remember to derive it from testing::Test.
17333 template <typename T>
17334 class FooTest : public testing::Test {
17335   ...
17336 };
17337
17338 // Next, declare that you will define a type-parameterized test case
17339 // (the _P suffix is for "parameterized" or "pattern", whichever you
17340 // prefer):
17341 TYPED_TEST_CASE_P(FooTest);
17342
17343 // Then, use TYPED_TEST_P() to define as many type-parameterized tests
17344 // for this type-parameterized test case as you want.
17345 TYPED_TEST_P(FooTest, DoesBlah) {
17346   // Inside a test, refer to TypeParam to get the type parameter.
17347   TypeParam n = 0;
17348   ...
17349 }
17350
17351 TYPED_TEST_P(FooTest, HasPropertyA) { ... }
17352
17353 // Now the tricky part: you need to register all test patterns before
17354 // you can instantiate them.  The first argument of the macro is the
17355 // test case name; the rest are the names of the tests in this test
17356 // case.
17357 REGISTER_TYPED_TEST_CASE_P(FooTest,
17358                            DoesBlah, HasPropertyA);
17359
17360 // Finally, you are free to instantiate the pattern with the types you
17361 // want.  If you put the above code in a header file, you can #include
17362 // it in multiple C++ source files and instantiate it multiple times.
17363 //
17364 // To distinguish different instances of the pattern, the first
17365 // argument to the INSTANTIATE_* macro is a prefix that will be added
17366 // to the actual test case name.  Remember to pick unique prefixes for
17367 // different instances.
17368 typedef testing::Types<char, int, unsigned int> MyTypes;
17369 INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
17370
17371 // If the type list contains only one type, you can write that type
17372 // directly without Types<...>:
17373 //   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
17374
17375 #endif  // 0
17376
17377
17378 // Implements typed tests.
17379
17380 #if GTEST_HAS_TYPED_TEST
17381
17382 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17383 //
17384 // Expands to the name of the typedef for the type parameters of the
17385 // given test case.
17386 # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
17387
17388 // The 'Types' template argument below must have spaces around it
17389 // since some compilers may choke on '>>' when passing a template
17390 // instance (e.g. Types<int>)
17391 # define TYPED_TEST_CASE(CaseName, Types) \
17392   typedef ::testing::internal::TypeList< Types >::type \
17393       GTEST_TYPE_PARAMS_(CaseName)
17394
17395 # define TYPED_TEST(CaseName, TestName) \
17396   template <typename gtest_TypeParam_> \
17397   class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
17398       : public CaseName<gtest_TypeParam_> { \
17399    private: \
17400     typedef CaseName<gtest_TypeParam_> TestFixture; \
17401     typedef gtest_TypeParam_ TypeParam; \
17402     virtual void TestBody(); \
17403   }; \
17404   bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
17405       ::testing::internal::TypeParameterizedTest< \
17406           CaseName, \
17407           ::testing::internal::TemplateSel< \
17408               GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
17409           GTEST_TYPE_PARAMS_(CaseName)>::Register(\
17410               "", #CaseName, #TestName, 0); \
17411   template <typename gtest_TypeParam_> \
17412   void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
17413
17414 #endif  // GTEST_HAS_TYPED_TEST
17415
17416 // Implements type-parameterized tests.
17417
17418 #if GTEST_HAS_TYPED_TEST_P
17419
17420 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17421 //
17422 // Expands to the namespace name that the type-parameterized tests for
17423 // the given type-parameterized test case are defined in.  The exact
17424 // name of the namespace is subject to change without notice.
17425 # define GTEST_CASE_NAMESPACE_(TestCaseName) \
17426   gtest_case_##TestCaseName##_
17427
17428 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17429 //
17430 // Expands to the name of the variable used to remember the names of
17431 // the defined tests in the given test case.
17432 # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
17433   gtest_typed_test_case_p_state_##TestCaseName##_
17434
17435 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
17436 //
17437 // Expands to the name of the variable used to remember the names of
17438 // the registered tests in the given test case.
17439 # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
17440   gtest_registered_test_names_##TestCaseName##_
17441
17442 // The variables defined in the type-parameterized test macros are
17443 // static as typically these macros are used in a .h file that can be
17444 // #included in multiple translation units linked together.
17445 # define TYPED_TEST_CASE_P(CaseName) \
17446   static ::testing::internal::TypedTestCasePState \
17447       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
17448
17449 # define TYPED_TEST_P(CaseName, TestName) \
17450   namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17451   template <typename gtest_TypeParam_> \
17452   class TestName : public CaseName<gtest_TypeParam_> { \
17453    private: \
17454     typedef CaseName<gtest_TypeParam_> TestFixture; \
17455     typedef gtest_TypeParam_ TypeParam; \
17456     virtual void TestBody(); \
17457   }; \
17458   static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
17459       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
17460           __FILE__, __LINE__, #CaseName, #TestName); \
17461   } \
17462   template <typename gtest_TypeParam_> \
17463   void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
17464
17465 # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
17466   namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17467   typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
17468   } \
17469   static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
17470       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
17471           __FILE__, __LINE__, #__VA_ARGS__)
17472
17473 // The 'Types' template argument below must have spaces around it
17474 // since some compilers may choke on '>>' when passing a template
17475 // instance (e.g. Types<int>)
17476 # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
17477   bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
17478       ::testing::internal::TypeParameterizedTestCase<CaseName, \
17479           GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
17480           ::testing::internal::TypeList< Types >::type>::Register(\
17481               #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
17482
17483 #endif  // GTEST_HAS_TYPED_TEST_P
17484
17485 #endif  // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17486
17487 // Depending on the platform, different string classes are available.
17488 // On Linux, in addition to ::std::string, Google also makes use of
17489 // class ::string, which has the same interface as ::std::string, but
17490 // has a different implementation.
17491 //
17492 // The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
17493 // ::string is available AND is a distinct type to ::std::string, or
17494 // define it to 0 to indicate otherwise.
17495 //
17496 // If the user's ::std::string and ::string are the same class due to
17497 // aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
17498 //
17499 // If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
17500 // heuristically.
17501
17502 namespace testing {
17503
17504 // Declares the flags.
17505
17506 // This flag temporary enables the disabled tests.
17507 GTEST_DECLARE_bool_(also_run_disabled_tests);
17508
17509 // This flag brings the debugger on an assertion failure.
17510 GTEST_DECLARE_bool_(break_on_failure);
17511
17512 // This flag controls whether Google Test catches all test-thrown exceptions
17513 // and logs them as failures.
17514 GTEST_DECLARE_bool_(catch_exceptions);
17515
17516 // This flag enables using colors in terminal output. Available values are
17517 // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
17518 // to let Google Test decide.
17519 GTEST_DECLARE_string_(color);
17520
17521 // This flag sets up the filter to select by name using a glob pattern
17522 // the tests to run. If the filter is not given all tests are executed.
17523 GTEST_DECLARE_string_(filter);
17524
17525 // This flag causes the Google Test to list tests. None of the tests listed
17526 // are actually run if the flag is provided.
17527 GTEST_DECLARE_bool_(list_tests);
17528
17529 // This flag controls whether Google Test emits a detailed XML report to a file
17530 // in addition to its normal textual output.
17531 GTEST_DECLARE_string_(output);
17532
17533 // This flags control whether Google Test prints the elapsed time for each
17534 // test.
17535 GTEST_DECLARE_bool_(print_time);
17536
17537 // This flag specifies the random number seed.
17538 GTEST_DECLARE_int32_(random_seed);
17539
17540 // This flag sets how many times the tests are repeated. The default value
17541 // is 1. If the value is -1 the tests are repeating forever.
17542 GTEST_DECLARE_int32_(repeat);
17543
17544 // This flag controls whether Google Test includes Google Test internal
17545 // stack frames in failure stack traces.
17546 GTEST_DECLARE_bool_(show_internal_stack_frames);
17547
17548 // When this flag is specified, tests' order is randomized on every iteration.
17549 GTEST_DECLARE_bool_(shuffle);
17550
17551 // This flag specifies the maximum number of stack frames to be
17552 // printed in a failure message.
17553 GTEST_DECLARE_int32_(stack_trace_depth);
17554
17555 // When this flag is specified, a failed assertion will throw an
17556 // exception if exceptions are enabled, or exit the program with a
17557 // non-zero code otherwise.
17558 GTEST_DECLARE_bool_(throw_on_failure);
17559
17560 // When this flag is set with a "host:port" string, on supported
17561 // platforms test results are streamed to the specified port on
17562 // the specified host machine.
17563 GTEST_DECLARE_string_(stream_result_to);
17564
17565 // The upper limit for valid stack trace depths.
17566 const int kMaxStackTraceDepth = 100;
17567
17568 namespace internal {
17569
17570 class AssertHelper;
17571 class DefaultGlobalTestPartResultReporter;
17572 class ExecDeathTest;
17573 class NoExecDeathTest;
17574 class FinalSuccessChecker;
17575 class GTestFlagSaver;
17576 class TestResultAccessor;
17577 class TestEventListenersAccessor;
17578 class TestEventRepeater;
17579 class WindowsDeathTest;
17580 class UnitTestImpl* GetUnitTestImpl();
17581 void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
17582                                     const std::string& message);
17583
17584 // Converts a streamable value to an std::string.  A NULL pointer is
17585 // converted to "(null)".  When the input value is a ::string,
17586 // ::std::string, ::wstring, or ::std::wstring object, each NUL
17587 // character in it is replaced with "\\0".
17588 // Declared in gtest-internal.h but defined here, so that it has access
17589 // to the definition of the Message class, required by the ARM
17590 // compiler.
17591 template <typename T>
17592 std::string StreamableToString(const T& streamable) {
17593   return (Message() << streamable).GetString();
17594 }
17595
17596 }  // namespace internal
17597
17598 // The friend relationship of some of these classes is cyclic.
17599 // If we don't forward declare them the compiler might confuse the classes
17600 // in friendship clauses with same named classes on the scope.
17601 class Test;
17602 class TestCase;
17603 class TestInfo;
17604 class UnitTest;
17605
17606 // A class for indicating whether an assertion was successful.  When
17607 // the assertion wasn't successful, the AssertionResult object
17608 // remembers a non-empty message that describes how it failed.
17609 //
17610 // To create an instance of this class, use one of the factory functions
17611 // (AssertionSuccess() and AssertionFailure()).
17612 //
17613 // This class is useful for two purposes:
17614 //   1. Defining predicate functions to be used with Boolean test assertions
17615 //      EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
17616 //   2. Defining predicate-format functions to be
17617 //      used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
17618 //
17619 // For example, if you define IsEven predicate:
17620 //
17621 //   testing::AssertionResult IsEven(int n) {
17622 //     if ((n % 2) == 0)
17623 //       return testing::AssertionSuccess();
17624 //     else
17625 //       return testing::AssertionFailure() << n << " is odd";
17626 //   }
17627 //
17628 // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
17629 // will print the message
17630 //
17631 //   Value of: IsEven(Fib(5))
17632 //     Actual: false (5 is odd)
17633 //   Expected: true
17634 //
17635 // instead of a more opaque
17636 //
17637 //   Value of: IsEven(Fib(5))
17638 //     Actual: false
17639 //   Expected: true
17640 //
17641 // in case IsEven is a simple Boolean predicate.
17642 //
17643 // If you expect your predicate to be reused and want to support informative
17644 // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
17645 // about half as often as positive ones in our tests), supply messages for
17646 // both success and failure cases:
17647 //
17648 //   testing::AssertionResult IsEven(int n) {
17649 //     if ((n % 2) == 0)
17650 //       return testing::AssertionSuccess() << n << " is even";
17651 //     else
17652 //       return testing::AssertionFailure() << n << " is odd";
17653 //   }
17654 //
17655 // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
17656 //
17657 //   Value of: IsEven(Fib(6))
17658 //     Actual: true (8 is even)
17659 //   Expected: false
17660 //
17661 // NB: Predicates that support negative Boolean assertions have reduced
17662 // performance in positive ones so be careful not to use them in tests
17663 // that have lots (tens of thousands) of positive Boolean assertions.
17664 //
17665 // To use this class with EXPECT_PRED_FORMAT assertions such as:
17666 //
17667 //   // Verifies that Foo() returns an even number.
17668 //   EXPECT_PRED_FORMAT1(IsEven, Foo());
17669 //
17670 // you need to define:
17671 //
17672 //   testing::AssertionResult IsEven(const char* expr, int n) {
17673 //     if ((n % 2) == 0)
17674 //       return testing::AssertionSuccess();
17675 //     else
17676 //       return testing::AssertionFailure()
17677 //         << "Expected: " << expr << " is even\n  Actual: it's " << n;
17678 //   }
17679 //
17680 // If Foo() returns 5, you will see the following message:
17681 //
17682 //   Expected: Foo() is even
17683 //     Actual: it's 5
17684 //
17685 class GTEST_API_ AssertionResult {
17686  public:
17687   // Copy constructor.
17688   // Used in EXPECT_TRUE/FALSE(assertion_result).
17689   AssertionResult(const AssertionResult& other);
17690   // Used in the EXPECT_TRUE/FALSE(bool_expression).
17691   explicit AssertionResult(bool success) : success_(success) {}
17692
17693   // Returns true iff the assertion succeeded.
17694   operator bool() const { return success_; }  // NOLINT
17695
17696   // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
17697   AssertionResult operator!() const;
17698
17699   // Returns the text streamed into this AssertionResult. Test assertions
17700   // use it when they fail (i.e., the predicate's outcome doesn't match the
17701   // assertion's expectation). When nothing has been streamed into the
17702   // object, returns an empty string.
17703   const char* message() const {
17704     return message_.get() != NULL ?  message_->c_str() : "";
17705   }
17706   // TODO(vladl@google.com): Remove this after making sure no clients use it.
17707   // Deprecated; please use message() instead.
17708   const char* failure_message() const { return message(); }
17709
17710   // Streams a custom failure message into this object.
17711   template <typename T> AssertionResult& operator<<(const T& value) {
17712     AppendMessage(Message() << value);
17713     return *this;
17714   }
17715
17716   // Allows streaming basic output manipulators such as endl or flush into
17717   // this object.
17718   AssertionResult& operator<<(
17719       ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
17720     AppendMessage(Message() << basic_manipulator);
17721     return *this;
17722   }
17723
17724  private:
17725   // Appends the contents of message to message_.
17726   void AppendMessage(const Message& a_message) {
17727     if (message_.get() == NULL)
17728       message_.reset(new ::std::string);
17729     message_->append(a_message.GetString().c_str());
17730   }
17731
17732   // Stores result of the assertion predicate.
17733   bool success_;
17734   // Stores the message describing the condition in case the expectation
17735   // construct is not satisfied with the predicate's outcome.
17736   // Referenced via a pointer to avoid taking too much stack frame space
17737   // with test assertions.
17738   internal::scoped_ptr< ::std::string> message_;
17739
17740   GTEST_DISALLOW_ASSIGN_(AssertionResult);
17741 };
17742
17743 // Makes a successful assertion result.
17744 GTEST_API_ AssertionResult AssertionSuccess();
17745
17746 // Makes a failed assertion result.
17747 GTEST_API_ AssertionResult AssertionFailure();
17748
17749 // Makes a failed assertion result with the given failure message.
17750 // Deprecated; use AssertionFailure() << msg.
17751 GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
17752
17753 // The abstract class that all tests inherit from.
17754 //
17755 // In Google Test, a unit test program contains one or many TestCases, and
17756 // each TestCase contains one or many Tests.
17757 //
17758 // When you define a test using the TEST macro, you don't need to
17759 // explicitly derive from Test - the TEST macro automatically does
17760 // this for you.
17761 //
17762 // The only time you derive from Test is when defining a test fixture
17763 // to be used a TEST_F.  For example:
17764 //
17765 //   class FooTest : public testing::Test {
17766 //    protected:
17767 //     virtual void SetUp() { ... }
17768 //     virtual void TearDown() { ... }
17769 //     ...
17770 //   };
17771 //
17772 //   TEST_F(FooTest, Bar) { ... }
17773 //   TEST_F(FooTest, Baz) { ... }
17774 //
17775 // Test is not copyable.
17776 class GTEST_API_ Test {
17777  public:
17778   friend class TestInfo;
17779
17780   // Defines types for pointers to functions that set up and tear down
17781   // a test case.
17782   typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
17783   typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
17784
17785   // The d'tor is virtual as we intend to inherit from Test.
17786   virtual ~Test();
17787
17788   // Sets up the stuff shared by all tests in this test case.
17789   //
17790   // Google Test will call Foo::SetUpTestCase() before running the first
17791   // test in test case Foo.  Hence a sub-class can define its own
17792   // SetUpTestCase() method to shadow the one defined in the super
17793   // class.
17794   static void SetUpTestCase() {}
17795
17796   // Tears down the stuff shared by all tests in this test case.
17797   //
17798   // Google Test will call Foo::TearDownTestCase() after running the last
17799   // test in test case Foo.  Hence a sub-class can define its own
17800   // TearDownTestCase() method to shadow the one defined in the super
17801   // class.
17802   static void TearDownTestCase() {}
17803
17804   // Returns true iff the current test has a fatal failure.
17805   static bool HasFatalFailure();
17806
17807   // Returns true iff the current test has a non-fatal failure.
17808   static bool HasNonfatalFailure();
17809
17810   // Returns true iff the current test has a (either fatal or
17811   // non-fatal) failure.
17812   static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
17813
17814   // Logs a property for the current test.  Only the last value for a given
17815   // key is remembered.
17816   // These are public static so they can be called from utility functions
17817   // that are not members of the test fixture.
17818   // The arguments are const char* instead strings, as Google Test is used
17819   // on platforms where string doesn't compile.
17820   //
17821   // Note that a driving consideration for these RecordProperty methods
17822   // was to produce xml output suited to the Greenspan charting utility,
17823   // which at present will only chart values that fit in a 32-bit int. It
17824   // is the user's responsibility to restrict their values to 32-bit ints
17825   // if they intend them to be used with Greenspan.
17826   static void RecordProperty(const char* key, const char* value);
17827   static void RecordProperty(const char* key, int value);
17828
17829  protected:
17830   // Creates a Test object.
17831   Test();
17832
17833   // Sets up the test fixture.
17834   virtual void SetUp();
17835
17836   // Tears down the test fixture.
17837   virtual void TearDown();
17838
17839  private:
17840   // Returns true iff the current test has the same fixture class as
17841   // the first test in the current test case.
17842   static bool HasSameFixtureClass();
17843
17844   // Runs the test after the test fixture has been set up.
17845   //
17846   // A sub-class must implement this to define the test logic.
17847   //
17848   // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
17849   // Instead, use the TEST or TEST_F macro.
17850   virtual void TestBody() = 0;
17851
17852   // Sets up, executes, and tears down the test.
17853   void Run();
17854
17855   // Deletes self.  We deliberately pick an unusual name for this
17856   // internal method to avoid clashing with names used in user TESTs.
17857   void DeleteSelf_() { delete this; }
17858
17859   // Uses a GTestFlagSaver to save and restore all Google Test flags.
17860   const internal::GTestFlagSaver* const gtest_flag_saver_;
17861
17862   // Often a user mis-spells SetUp() as Setup() and spends a long time
17863   // wondering why it is never called by Google Test.  The declaration of
17864   // the following method is solely for catching such an error at
17865   // compile time:
17866   //
17867   //   - The return type is deliberately chosen to be not void, so it
17868   //   will be a conflict if a user declares void Setup() in his test
17869   //   fixture.
17870   //
17871   //   - This method is private, so it will be another compiler error
17872   //   if a user calls it from his test fixture.
17873   //
17874   // DO NOT OVERRIDE THIS FUNCTION.
17875   //
17876   // If you see an error about overriding the following function or
17877   // about it being private, you have mis-spelled SetUp() as Setup().
17878   struct Setup_should_be_spelled_SetUp {};
17879   virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
17880
17881   // We disallow copying Tests.
17882   GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
17883 };
17884
17885 typedef internal::TimeInMillis TimeInMillis;
17886
17887 // A copyable object representing a user specified test property which can be
17888 // output as a key/value string pair.
17889 //
17890 // Don't inherit from TestProperty as its destructor is not virtual.
17891 class TestProperty {
17892  public:
17893   // C'tor.  TestProperty does NOT have a default constructor.
17894   // Always use this constructor (with parameters) to create a
17895   // TestProperty object.
17896   TestProperty(const char* a_key, const char* a_value) :
17897     key_(a_key), value_(a_value) {
17898   }
17899
17900   // Gets the user supplied key.
17901   const char* key() const {
17902     return key_.c_str();
17903   }
17904
17905   // Gets the user supplied value.
17906   const char* value() const {
17907     return value_.c_str();
17908   }
17909
17910   // Sets a new value, overriding the one supplied in the constructor.
17911   void SetValue(const char* new_value) {
17912     value_ = new_value;
17913   }
17914
17915  private:
17916   // The key supplied by the user.
17917   std::string key_;
17918   // The value supplied by the user.
17919   std::string value_;
17920 };
17921
17922 // The result of a single Test.  This includes a list of
17923 // TestPartResults, a list of TestProperties, a count of how many
17924 // death tests there are in the Test, and how much time it took to run
17925 // the Test.
17926 //
17927 // TestResult is not copyable.
17928 class GTEST_API_ TestResult {
17929  public:
17930   // Creates an empty TestResult.
17931   TestResult();
17932
17933   // D'tor.  Do not inherit from TestResult.
17934   ~TestResult();
17935
17936   // Gets the number of all test parts.  This is the sum of the number
17937   // of successful test parts and the number of failed test parts.
17938   int total_part_count() const;
17939
17940   // Returns the number of the test properties.
17941   int test_property_count() const;
17942
17943   // Returns true iff the test passed (i.e. no test part failed).
17944   bool Passed() const { return !Failed(); }
17945
17946   // Returns true iff the test failed.
17947   bool Failed() const;
17948
17949   // Returns true iff the test fatally failed.
17950   bool HasFatalFailure() const;
17951
17952   // Returns true iff the test has a non-fatal failure.
17953   bool HasNonfatalFailure() const;
17954
17955   // Returns the elapsed time, in milliseconds.
17956   TimeInMillis elapsed_time() const { return elapsed_time_; }
17957
17958   // Returns the i-th test part result among all the results. i can range
17959   // from 0 to test_property_count() - 1. If i is not in that range, aborts
17960   // the program.
17961   const TestPartResult& GetTestPartResult(int i) const;
17962
17963   // Returns the i-th test property. i can range from 0 to
17964   // test_property_count() - 1. If i is not in that range, aborts the
17965   // program.
17966   const TestProperty& GetTestProperty(int i) const;
17967
17968  private:
17969   friend class TestInfo;
17970   friend class UnitTest;
17971   friend class internal::DefaultGlobalTestPartResultReporter;
17972   friend class internal::ExecDeathTest;
17973   friend class internal::TestResultAccessor;
17974   friend class internal::UnitTestImpl;
17975   friend class internal::WindowsDeathTest;
17976
17977   // Gets the vector of TestPartResults.
17978   const std::vector<TestPartResult>& test_part_results() const {
17979     return test_part_results_;
17980   }
17981
17982   // Gets the vector of TestProperties.
17983   const std::vector<TestProperty>& test_properties() const {
17984     return test_properties_;
17985   }
17986
17987   // Sets the elapsed time.
17988   void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
17989
17990   // Adds a test property to the list. The property is validated and may add
17991   // a non-fatal failure if invalid (e.g., if it conflicts with reserved
17992   // key names). If a property is already recorded for the same key, the
17993   // value will be updated, rather than storing multiple values for the same
17994   // key.
17995   void RecordProperty(const TestProperty& test_property);
17996
17997   // Adds a failure if the key is a reserved attribute of Google Test
17998   // testcase tags.  Returns true if the property is valid.
17999   // TODO(russr): Validate attribute names are legal and human readable.
18000   static bool ValidateTestProperty(const TestProperty& test_property);
18001
18002   // Adds a test part result to the list.
18003   void AddTestPartResult(const TestPartResult& test_part_result);
18004
18005   // Returns the death test count.
18006   int death_test_count() const { return death_test_count_; }
18007
18008   // Increments the death test count, returning the new count.
18009   int increment_death_test_count() { return ++death_test_count_; }
18010
18011   // Clears the test part results.
18012   void ClearTestPartResults();
18013
18014   // Clears the object.
18015   void Clear();
18016
18017   // Protects mutable state of the property vector and of owned
18018   // properties, whose values may be updated.
18019   internal::Mutex test_properites_mutex_;
18020
18021   // The vector of TestPartResults
18022   std::vector<TestPartResult> test_part_results_;
18023   // The vector of TestProperties
18024   std::vector<TestProperty> test_properties_;
18025   // Running count of death tests.
18026   int death_test_count_;
18027   // The elapsed time, in milliseconds.
18028   TimeInMillis elapsed_time_;
18029
18030   // We disallow copying TestResult.
18031   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
18032 };  // class TestResult
18033
18034 // A TestInfo object stores the following information about a test:
18035 //
18036 //   Test case name
18037 //   Test name
18038 //   Whether the test should be run
18039 //   A function pointer that creates the test object when invoked
18040 //   Test result
18041 //
18042 // The constructor of TestInfo registers itself with the UnitTest
18043 // singleton such that the RUN_ALL_TESTS() macro knows which tests to
18044 // run.
18045 class GTEST_API_ TestInfo {
18046  public:
18047   // Destructs a TestInfo object.  This function is not virtual, so
18048   // don't inherit from TestInfo.
18049   ~TestInfo();
18050
18051   // Returns the test case name.
18052   const char* test_case_name() const { return test_case_name_.c_str(); }
18053
18054   // Returns the test name.
18055   const char* name() const { return name_.c_str(); }
18056
18057   // Returns the name of the parameter type, or NULL if this is not a typed
18058   // or a type-parameterized test.
18059   const char* type_param() const {
18060     if (type_param_.get() != NULL)
18061       return type_param_->c_str();
18062     return NULL;
18063   }
18064
18065   // Returns the text representation of the value parameter, or NULL if this
18066   // is not a value-parameterized test.
18067   const char* value_param() const {
18068     if (value_param_.get() != NULL)
18069       return value_param_->c_str();
18070     return NULL;
18071   }
18072
18073   // Returns true if this test should run, that is if the test is not disabled
18074   // (or it is disabled but the also_run_disabled_tests flag has been specified)
18075   // and its full name matches the user-specified filter.
18076   //
18077   // Google Test allows the user to filter the tests by their full names.
18078   // The full name of a test Bar in test case Foo is defined as
18079   // "Foo.Bar".  Only the tests that match the filter will run.
18080   //
18081   // A filter is a colon-separated list of glob (not regex) patterns,
18082   // optionally followed by a '-' and a colon-separated list of
18083   // negative patterns (tests to exclude).  A test is run if it
18084   // matches one of the positive patterns and does not match any of
18085   // the negative patterns.
18086   //
18087   // For example, *A*:Foo.* is a filter that matches any string that
18088   // contains the character 'A' or starts with "Foo.".
18089   bool should_run() const { return should_run_; }
18090
18091   // Returns the result of the test.
18092   const TestResult* result() const { return &result_; }
18093
18094  private:
18095 #if GTEST_HAS_DEATH_TEST
18096   friend class internal::DefaultDeathTestFactory;
18097 #endif  // GTEST_HAS_DEATH_TEST
18098   friend class Test;
18099   friend class TestCase;
18100   friend class internal::UnitTestImpl;
18101   friend TestInfo* internal::MakeAndRegisterTestInfo(
18102       const char* test_case_name, const char* name,
18103       const char* type_param,
18104       const char* value_param,
18105       internal::TypeId fixture_class_id,
18106       Test::SetUpTestCaseFunc set_up_tc,
18107       Test::TearDownTestCaseFunc tear_down_tc,
18108       internal::TestFactoryBase* factory);
18109
18110   // Constructs a TestInfo object. The newly constructed instance assumes
18111   // ownership of the factory object.
18112   TestInfo(const char* test_case_name, const char* name,
18113            const char* a_type_param,
18114            const char* a_value_param,
18115            internal::TypeId fixture_class_id,
18116            internal::TestFactoryBase* factory);
18117
18118   // Increments the number of death tests encountered in this test so
18119   // far.
18120   int increment_death_test_count() {
18121     return result_.increment_death_test_count();
18122   }
18123
18124   // Creates the test object, runs it, records its result, and then
18125   // deletes it.
18126   void Run();
18127
18128   static void ClearTestResult(TestInfo* test_info) {
18129     test_info->result_.Clear();
18130   }
18131
18132   // These fields are immutable properties of the test.
18133   const std::string test_case_name_;     // Test case name
18134   const std::string name_;               // Test name
18135   // Name of the parameter type, or NULL if this is not a typed or a
18136   // type-parameterized test.
18137   const internal::scoped_ptr<const ::std::string> type_param_;
18138   // Text representation of the value parameter, or NULL if this is not a
18139   // value-parameterized test.
18140   const internal::scoped_ptr<const ::std::string> value_param_;
18141   const internal::TypeId fixture_class_id_;   // ID of the test fixture class
18142   bool should_run_;                 // True iff this test should run
18143   bool is_disabled_;                // True iff this test is disabled
18144   bool matches_filter_;             // True if this test matches the
18145                                     // user-specified filter.
18146   internal::TestFactoryBase* const factory_;  // The factory that creates
18147                                               // the test object
18148
18149   // This field is mutable and needs to be reset before running the
18150   // test for the second time.
18151   TestResult result_;
18152
18153   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
18154 };
18155
18156 // A test case, which consists of a vector of TestInfos.
18157 //
18158 // TestCase is not copyable.
18159 class GTEST_API_ TestCase {
18160  public:
18161   // Creates a TestCase with the given name.
18162   //
18163   // TestCase does NOT have a default constructor.  Always use this
18164   // constructor to create a TestCase object.
18165   //
18166   // Arguments:
18167   //
18168   //   name:         name of the test case
18169   //   a_type_param: the name of the test's type parameter, or NULL if
18170   //                 this is not a type-parameterized test.
18171   //   set_up_tc:    pointer to the function that sets up the test case
18172   //   tear_down_tc: pointer to the function that tears down the test case
18173   TestCase(const char* name, const char* a_type_param,
18174            Test::SetUpTestCaseFunc set_up_tc,
18175            Test::TearDownTestCaseFunc tear_down_tc);
18176
18177   // Destructor of TestCase.
18178   virtual ~TestCase();
18179
18180   // Gets the name of the TestCase.
18181   const char* name() const { return name_.c_str(); }
18182
18183   // Returns the name of the parameter type, or NULL if this is not a
18184   // type-parameterized test case.
18185   const char* type_param() const {
18186     if (type_param_.get() != NULL)
18187       return type_param_->c_str();
18188     return NULL;
18189   }
18190
18191   // Returns true if any test in this test case should run.
18192   bool should_run() const { return should_run_; }
18193
18194   // Gets the number of successful tests in this test case.
18195   int successful_test_count() const;
18196
18197   // Gets the number of failed tests in this test case.
18198   int failed_test_count() const;
18199
18200   // Gets the number of disabled tests in this test case.
18201   int disabled_test_count() const;
18202
18203   // Get the number of tests in this test case that should run.
18204   int test_to_run_count() const;
18205
18206   // Gets the number of all tests in this test case.
18207   int total_test_count() const;
18208
18209   // Returns true iff the test case passed.
18210   bool Passed() const { return !Failed(); }
18211
18212   // Returns true iff the test case failed.
18213   bool Failed() const { return failed_test_count() > 0; }
18214
18215   // Returns the elapsed time, in milliseconds.
18216   TimeInMillis elapsed_time() const { return elapsed_time_; }
18217
18218   // Returns the i-th test among all the tests. i can range from 0 to
18219   // total_test_count() - 1. If i is not in that range, returns NULL.
18220   const TestInfo* GetTestInfo(int i) const;
18221
18222  private:
18223   friend class Test;
18224   friend class internal::UnitTestImpl;
18225
18226   // Gets the (mutable) vector of TestInfos in this TestCase.
18227   std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
18228
18229   // Gets the (immutable) vector of TestInfos in this TestCase.
18230   const std::vector<TestInfo*>& test_info_list() const {
18231     return test_info_list_;
18232   }
18233
18234   // Returns the i-th test among all the tests. i can range from 0 to
18235   // total_test_count() - 1. If i is not in that range, returns NULL.
18236   TestInfo* GetMutableTestInfo(int i);
18237
18238   // Sets the should_run member.
18239   void set_should_run(bool should) { should_run_ = should; }
18240
18241   // Adds a TestInfo to this test case.  Will delete the TestInfo upon
18242   // destruction of the TestCase object.
18243   void AddTestInfo(TestInfo * test_info);
18244
18245   // Clears the results of all tests in this test case.
18246   void ClearResult();
18247
18248   // Clears the results of all tests in the given test case.
18249   static void ClearTestCaseResult(TestCase* test_case) {
18250     test_case->ClearResult();
18251   }
18252
18253   // Runs every test in this TestCase.
18254   void Run();
18255
18256   // Runs SetUpTestCase() for this TestCase.  This wrapper is needed
18257   // for catching exceptions thrown from SetUpTestCase().
18258   void RunSetUpTestCase() { (*set_up_tc_)(); }
18259
18260   // Runs TearDownTestCase() for this TestCase.  This wrapper is
18261   // needed for catching exceptions thrown from TearDownTestCase().
18262   void RunTearDownTestCase() { (*tear_down_tc_)(); }
18263
18264   // Returns true iff test passed.
18265   static bool TestPassed(const TestInfo* test_info) {
18266     return test_info->should_run() && test_info->result()->Passed();
18267   }
18268
18269   // Returns true iff test failed.
18270   static bool TestFailed(const TestInfo* test_info) {
18271     return test_info->should_run() && test_info->result()->Failed();
18272   }
18273
18274   // Returns true iff test is disabled.
18275   static bool TestDisabled(const TestInfo* test_info) {
18276     return test_info->is_disabled_;
18277   }
18278
18279   // Returns true if the given test should run.
18280   static bool ShouldRunTest(const TestInfo* test_info) {
18281     return test_info->should_run();
18282   }
18283
18284   // Shuffles the tests in this test case.
18285   void ShuffleTests(internal::Random* random);
18286
18287   // Restores the test order to before the first shuffle.
18288   void UnshuffleTests();
18289
18290   // Name of the test case.
18291   std::string name_;
18292   // Name of the parameter type, or NULL if this is not a typed or a
18293   // type-parameterized test.
18294   const internal::scoped_ptr<const ::std::string> type_param_;
18295   // The vector of TestInfos in their original order.  It owns the
18296   // elements in the vector.
18297   std::vector<TestInfo*> test_info_list_;
18298   // Provides a level of indirection for the test list to allow easy
18299   // shuffling and restoring the test order.  The i-th element in this
18300   // vector is the index of the i-th test in the shuffled test list.
18301   std::vector<int> test_indices_;
18302   // Pointer to the function that sets up the test case.
18303   Test::SetUpTestCaseFunc set_up_tc_;
18304   // Pointer to the function that tears down the test case.
18305   Test::TearDownTestCaseFunc tear_down_tc_;
18306   // True iff any test in this test case should run.
18307   bool should_run_;
18308   // Elapsed time, in milliseconds.
18309   TimeInMillis elapsed_time_;
18310
18311   // We disallow copying TestCases.
18312   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
18313 };
18314
18315 // An Environment object is capable of setting up and tearing down an
18316 // environment.  The user should subclass this to define his own
18317 // environment(s).
18318 //
18319 // An Environment object does the set-up and tear-down in virtual
18320 // methods SetUp() and TearDown() instead of the constructor and the
18321 // destructor, as:
18322 //
18323 //   1. You cannot safely throw from a destructor.  This is a problem
18324 //      as in some cases Google Test is used where exceptions are enabled, and
18325 //      we may want to implement ASSERT_* using exceptions where they are
18326 //      available.
18327 //   2. You cannot use ASSERT_* directly in a constructor or
18328 //      destructor.
18329 class Environment {
18330  public:
18331   // The d'tor is virtual as we need to subclass Environment.
18332   virtual ~Environment() {}
18333
18334   // Override this to define how to set up the environment.
18335   virtual void SetUp() {}
18336
18337   // Override this to define how to tear down the environment.
18338   virtual void TearDown() {}
18339  private:
18340   // If you see an error about overriding the following function or
18341   // about it being private, you have mis-spelled SetUp() as Setup().
18342   struct Setup_should_be_spelled_SetUp {};
18343   virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
18344 };
18345
18346 // The interface for tracing execution of tests. The methods are organized in
18347 // the order the corresponding events are fired.
18348 class TestEventListener {
18349  public:
18350   virtual ~TestEventListener() {}
18351
18352   // Fired before any test activity starts.
18353   virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
18354
18355   // Fired before each iteration of tests starts.  There may be more than
18356   // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
18357   // index, starting from 0.
18358   virtual void OnTestIterationStart(const UnitTest& unit_test,
18359                                     int iteration) = 0;
18360
18361   // Fired before environment set-up for each iteration of tests starts.
18362   virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
18363
18364   // Fired after environment set-up for each iteration of tests ends.
18365   virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
18366
18367   // Fired before the test case starts.
18368   virtual void OnTestCaseStart(const TestCase& test_case) = 0;
18369
18370   // Fired before the test starts.
18371   virtual void OnTestStart(const TestInfo& test_info) = 0;
18372
18373   // Fired after a failed assertion or a SUCCEED() invocation.
18374   virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
18375
18376   // Fired after the test ends.
18377   virtual void OnTestEnd(const TestInfo& test_info) = 0;
18378
18379   // Fired after the test case ends.
18380   virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
18381
18382   // Fired before environment tear-down for each iteration of tests starts.
18383   virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
18384
18385   // Fired after environment tear-down for each iteration of tests ends.
18386   virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
18387
18388   // Fired after each iteration of tests finishes.
18389   virtual void OnTestIterationEnd(const UnitTest& unit_test,
18390                                   int iteration) = 0;
18391
18392   // Fired after all test activities have ended.
18393   virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
18394 };
18395
18396 // The convenience class for users who need to override just one or two
18397 // methods and are not concerned that a possible change to a signature of
18398 // the methods they override will not be caught during the build.  For
18399 // comments about each method please see the definition of TestEventListener
18400 // above.
18401 class EmptyTestEventListener : public TestEventListener {
18402  public:
18403   virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
18404   virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
18405                                     int /*iteration*/) {}
18406   virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
18407   virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
18408   virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
18409   virtual void OnTestStart(const TestInfo& /*test_info*/) {}
18410   virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
18411   virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
18412   virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
18413   virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
18414   virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
18415   virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
18416                                   int /*iteration*/) {}
18417   virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
18418 };
18419
18420 // TestEventListeners lets users add listeners to track events in Google Test.
18421 class GTEST_API_ TestEventListeners {
18422  public:
18423   TestEventListeners();
18424   ~TestEventListeners();
18425
18426   // Appends an event listener to the end of the list. Google Test assumes
18427   // the ownership of the listener (i.e. it will delete the listener when
18428   // the test program finishes).
18429   void Append(TestEventListener* listener);
18430
18431   // Removes the given event listener from the list and returns it.  It then
18432   // becomes the caller's responsibility to delete the listener. Returns
18433   // NULL if the listener is not found in the list.
18434   TestEventListener* Release(TestEventListener* listener);
18435
18436   // Returns the standard listener responsible for the default console
18437   // output.  Can be removed from the listeners list to shut down default
18438   // console output.  Note that removing this object from the listener list
18439   // with Release transfers its ownership to the caller and makes this
18440   // function return NULL the next time.
18441   TestEventListener* default_result_printer() const {
18442     return default_result_printer_;
18443   }
18444
18445   // Returns the standard listener responsible for the default XML output
18446   // controlled by the --gtest_output=xml flag.  Can be removed from the
18447   // listeners list by users who want to shut down the default XML output
18448   // controlled by this flag and substitute it with custom one.  Note that
18449   // removing this object from the listener list with Release transfers its
18450   // ownership to the caller and makes this function return NULL the next
18451   // time.
18452   TestEventListener* default_xml_generator() const {
18453     return default_xml_generator_;
18454   }
18455
18456  private:
18457   friend class TestCase;
18458   friend class TestInfo;
18459   friend class internal::DefaultGlobalTestPartResultReporter;
18460   friend class internal::NoExecDeathTest;
18461   friend class internal::TestEventListenersAccessor;
18462   friend class internal::UnitTestImpl;
18463
18464   // Returns repeater that broadcasts the TestEventListener events to all
18465   // subscribers.
18466   TestEventListener* repeater();
18467
18468   // Sets the default_result_printer attribute to the provided listener.
18469   // The listener is also added to the listener list and previous
18470   // default_result_printer is removed from it and deleted. The listener can
18471   // also be NULL in which case it will not be added to the list. Does
18472   // nothing if the previous and the current listener objects are the same.
18473   void SetDefaultResultPrinter(TestEventListener* listener);
18474
18475   // Sets the default_xml_generator attribute to the provided listener.  The
18476   // listener is also added to the listener list and previous
18477   // default_xml_generator is removed from it and deleted. The listener can
18478   // also be NULL in which case it will not be added to the list. Does
18479   // nothing if the previous and the current listener objects are the same.
18480   void SetDefaultXmlGenerator(TestEventListener* listener);
18481
18482   // Controls whether events will be forwarded by the repeater to the
18483   // listeners in the list.
18484   bool EventForwardingEnabled() const;
18485   void SuppressEventForwarding();
18486
18487   // The actual list of listeners.
18488   internal::TestEventRepeater* repeater_;
18489   // Listener responsible for the standard result output.
18490   TestEventListener* default_result_printer_;
18491   // Listener responsible for the creation of the XML output file.
18492   TestEventListener* default_xml_generator_;
18493
18494   // We disallow copying TestEventListeners.
18495   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
18496 };
18497
18498 // A UnitTest consists of a vector of TestCases.
18499 //
18500 // This is a singleton class.  The only instance of UnitTest is
18501 // created when UnitTest::GetInstance() is first called.  This
18502 // instance is never deleted.
18503 //
18504 // UnitTest is not copyable.
18505 //
18506 // This class is thread-safe as long as the methods are called
18507 // according to their specification.
18508 class GTEST_API_ UnitTest {
18509  public:
18510   // Gets the singleton UnitTest object.  The first time this method
18511   // is called, a UnitTest object is constructed and returned.
18512   // Consecutive calls will return the same object.
18513   static UnitTest* GetInstance();
18514
18515   // Runs all tests in this UnitTest object and prints the result.
18516   // Returns 0 if successful, or 1 otherwise.
18517   //
18518   // This method can only be called from the main thread.
18519   //
18520   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18521   int Run() GTEST_MUST_USE_RESULT_;
18522
18523   // Returns the working directory when the first TEST() or TEST_F()
18524   // was executed.  The UnitTest object owns the string.
18525   const char* original_working_dir() const;
18526
18527   // Returns the TestCase object for the test that's currently running,
18528   // or NULL if no test is running.
18529   const TestCase* current_test_case() const
18530       GTEST_LOCK_EXCLUDED_(mutex_);
18531
18532   // Returns the TestInfo object for the test that's currently running,
18533   // or NULL if no test is running.
18534   const TestInfo* current_test_info() const
18535       GTEST_LOCK_EXCLUDED_(mutex_);
18536
18537   // Returns the random seed used at the start of the current test run.
18538   int random_seed() const;
18539
18540 #if GTEST_HAS_PARAM_TEST
18541   // Returns the ParameterizedTestCaseRegistry object used to keep track of
18542   // value-parameterized tests and instantiate and register them.
18543   //
18544   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18545   internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
18546       GTEST_LOCK_EXCLUDED_(mutex_);
18547 #endif  // GTEST_HAS_PARAM_TEST
18548
18549   // Gets the number of successful test cases.
18550   int successful_test_case_count() const;
18551
18552   // Gets the number of failed test cases.
18553   int failed_test_case_count() const;
18554
18555   // Gets the number of all test cases.
18556   int total_test_case_count() const;
18557
18558   // Gets the number of all test cases that contain at least one test
18559   // that should run.
18560   int test_case_to_run_count() const;
18561
18562   // Gets the number of successful tests.
18563   int successful_test_count() const;
18564
18565   // Gets the number of failed tests.
18566   int failed_test_count() const;
18567
18568   // Gets the number of disabled tests.
18569   int disabled_test_count() const;
18570
18571   // Gets the number of all tests.
18572   int total_test_count() const;
18573
18574   // Gets the number of tests that should run.
18575   int test_to_run_count() const;
18576
18577   // Gets the time of the test program start, in ms from the start of the
18578   // UNIX epoch.
18579   TimeInMillis start_timestamp() const;
18580
18581   // Gets the elapsed time, in milliseconds.
18582   TimeInMillis elapsed_time() const;
18583
18584   // Returns true iff the unit test passed (i.e. all test cases passed).
18585   bool Passed() const;
18586
18587   // Returns true iff the unit test failed (i.e. some test case failed
18588   // or something outside of all tests failed).
18589   bool Failed() const;
18590
18591   // Gets the i-th test case among all the test cases. i can range from 0 to
18592   // total_test_case_count() - 1. If i is not in that range, returns NULL.
18593   const TestCase* GetTestCase(int i) const;
18594
18595   // Returns the list of event listeners that can be used to track events
18596   // inside Google Test.
18597   TestEventListeners& listeners();
18598
18599  private:
18600   // Registers and returns a global test environment.  When a test
18601   // program is run, all global test environments will be set-up in
18602   // the order they were registered.  After all tests in the program
18603   // have finished, all global test environments will be torn-down in
18604   // the *reverse* order they were registered.
18605   //
18606   // The UnitTest object takes ownership of the given environment.
18607   //
18608   // This method can only be called from the main thread.
18609   Environment* AddEnvironment(Environment* env);
18610
18611   // Adds a TestPartResult to the current TestResult object.  All
18612   // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
18613   // eventually call this to report their results.  The user code
18614   // should use the assertion macros instead of calling this directly.
18615   void AddTestPartResult(TestPartResult::Type result_type,
18616                          const char* file_name,
18617                          int line_number,
18618                          const std::string& message,
18619                          const std::string& os_stack_trace)
18620       GTEST_LOCK_EXCLUDED_(mutex_);
18621
18622   // Adds a TestProperty to the current TestResult object. If the result already
18623   // contains a property with the same key, the value will be updated.
18624   void RecordPropertyForCurrentTest(const char* key, const char* value);
18625
18626   // Gets the i-th test case among all the test cases. i can range from 0 to
18627   // total_test_case_count() - 1. If i is not in that range, returns NULL.
18628   TestCase* GetMutableTestCase(int i);
18629
18630   // Accessors for the implementation object.
18631   internal::UnitTestImpl* impl() { return impl_; }
18632   const internal::UnitTestImpl* impl() const { return impl_; }
18633
18634   // These classes and funcions are friends as they need to access private
18635   // members of UnitTest.
18636   friend class Test;
18637   friend class internal::AssertHelper;
18638   friend class internal::ScopedTrace;
18639   friend Environment* AddGlobalTestEnvironment(Environment* env);
18640   friend internal::UnitTestImpl* internal::GetUnitTestImpl();
18641   friend void internal::ReportFailureInUnknownLocation(
18642       TestPartResult::Type result_type,
18643       const std::string& message);
18644
18645   // Creates an empty UnitTest.
18646   UnitTest();
18647
18648   // D'tor
18649   virtual ~UnitTest();
18650
18651   // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
18652   // Google Test trace stack.
18653   void PushGTestTrace(const internal::TraceInfo& trace)
18654       GTEST_LOCK_EXCLUDED_(mutex_);
18655
18656   // Pops a trace from the per-thread Google Test trace stack.
18657   void PopGTestTrace()
18658       GTEST_LOCK_EXCLUDED_(mutex_);
18659
18660   // Protects mutable state in *impl_.  This is mutable as some const
18661   // methods need to lock it too.
18662   mutable internal::Mutex mutex_;
18663
18664   // Opaque implementation object.  This field is never changed once
18665   // the object is constructed.  We don't mark it as const here, as
18666   // doing so will cause a warning in the constructor of UnitTest.
18667   // Mutable state in *impl_ is protected by mutex_.
18668   internal::UnitTestImpl* impl_;
18669
18670   // We disallow copying UnitTest.
18671   GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
18672 };
18673
18674 // A convenient wrapper for adding an environment for the test
18675 // program.
18676 //
18677 // You should call this before RUN_ALL_TESTS() is called, probably in
18678 // main().  If you use gtest_main, you need to call this before main()
18679 // starts for it to take effect.  For example, you can define a global
18680 // variable like this:
18681 //
18682 //   testing::Environment* const foo_env =
18683 //       testing::AddGlobalTestEnvironment(new FooEnvironment);
18684 //
18685 // However, we strongly recommend you to write your own main() and
18686 // call AddGlobalTestEnvironment() there, as relying on initialization
18687 // of global variables makes the code harder to read and may cause
18688 // problems when you register multiple environments from different
18689 // translation units and the environments have dependencies among them
18690 // (remember that the compiler doesn't guarantee the order in which
18691 // global variables from different translation units are initialized).
18692 inline Environment* AddGlobalTestEnvironment(Environment* env) {
18693   return UnitTest::GetInstance()->AddEnvironment(env);
18694 }
18695
18696 // Initializes Google Test.  This must be called before calling
18697 // RUN_ALL_TESTS().  In particular, it parses a command line for the
18698 // flags that Google Test recognizes.  Whenever a Google Test flag is
18699 // seen, it is removed from argv, and *argc is decremented.
18700 //
18701 // No value is returned.  Instead, the Google Test flag variables are
18702 // updated.
18703 //
18704 // Calling the function for the second time has no user-visible effect.
18705 GTEST_API_ void InitGoogleTest(int* argc, char** argv);
18706
18707 // This overloaded version can be used in Windows programs compiled in
18708 // UNICODE mode.
18709 GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
18710
18711 namespace internal {
18712
18713 // FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
18714 // value of type ToPrint that is an operand of a comparison assertion
18715 // (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in
18716 // the comparison, and is used to help determine the best way to
18717 // format the value.  In particular, when the value is a C string
18718 // (char pointer) and the other operand is an STL string object, we
18719 // want to format the C string as a string, since we know it is
18720 // compared by value with the string object.  If the value is a char
18721 // pointer but the other operand is not an STL string object, we don't
18722 // know whether the pointer is supposed to point to a NUL-terminated
18723 // string, and thus want to print it as a pointer to be safe.
18724 //
18725 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18726
18727 // The default case.
18728 template <typename ToPrint, typename OtherOperand>
18729 class FormatForComparison {
18730  public:
18731   static ::std::string Format(const ToPrint& value) {
18732     return ::testing::PrintToString(value);
18733   }
18734 };
18735
18736 // Array.
18737 template <typename ToPrint, size_t N, typename OtherOperand>
18738 class FormatForComparison<ToPrint[N], OtherOperand> {
18739  public:
18740   static ::std::string Format(const ToPrint* value) {
18741     return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
18742   }
18743 };
18744
18745 // By default, print C string as pointers to be safe, as we don't know
18746 // whether they actually point to a NUL-terminated string.
18747
18748 #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \
18749   template <typename OtherOperand>                                      \
18750   class FormatForComparison<CharType*, OtherOperand> {                  \
18751    public:                                                              \
18752     static ::std::string Format(CharType* value) {                      \
18753       return ::testing::PrintToString(static_cast<const void*>(value)); \
18754     }                                                                   \
18755   }
18756
18757 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
18758 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
18759 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
18760 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
18761
18762 #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
18763
18764 // If a C string is compared with an STL string object, we know it's meant
18765 // to point to a NUL-terminated string, and thus can print it as a string.
18766
18767 #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
18768   template <>                                                           \
18769   class FormatForComparison<CharType*, OtherStringType> {               \
18770    public:                                                              \
18771     static ::std::string Format(CharType* value) {                      \
18772       return ::testing::PrintToString(value);                           \
18773     }                                                                   \
18774   }
18775
18776 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
18777 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
18778
18779 #if GTEST_HAS_GLOBAL_STRING
18780 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
18781 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
18782 #endif
18783
18784 #if GTEST_HAS_GLOBAL_WSTRING
18785 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
18786 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
18787 #endif
18788
18789 #if GTEST_HAS_STD_WSTRING
18790 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
18791 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
18792 #endif
18793
18794 #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
18795
18796 // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
18797 // operand to be used in a failure message.  The type (but not value)
18798 // of the other operand may affect the format.  This allows us to
18799 // print a char* as a raw pointer when it is compared against another
18800 // char* or void*, and print it as a C string when it is compared
18801 // against an std::string object, for example.
18802 //
18803 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18804 template <typename T1, typename T2>
18805 std::string FormatForComparisonFailureMessage(
18806     const T1& value, const T2& /* other_operand */) {
18807   return FormatForComparison<T1, T2>::Format(value);
18808 }
18809
18810 // The helper function for {ASSERT|EXPECT}_EQ.
18811 template <typename T1, typename T2>
18812 AssertionResult CmpHelperEQ(const char* expected_expression,
18813                             const char* actual_expression,
18814                             const T1& expected,
18815                             const T2& actual) {
18816 #ifdef _MSC_VER
18817 # pragma warning(push)          // Saves the current warning state.
18818 # pragma warning(disable:4389)  // Temporarily disables warning on
18819                                 // signed/unsigned mismatch.
18820 #endif
18821
18822   if (expected == actual) {
18823     return AssertionSuccess();
18824   }
18825
18826 #ifdef _MSC_VER
18827 # pragma warning(pop)          // Restores the warning state.
18828 #endif
18829
18830   return EqFailure(expected_expression,
18831                    actual_expression,
18832                    FormatForComparisonFailureMessage(expected, actual),
18833                    FormatForComparisonFailureMessage(actual, expected),
18834                    false);
18835 }
18836
18837 // With this overloaded version, we allow anonymous enums to be used
18838 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
18839 // can be implicitly cast to BiggestInt.
18840 GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
18841                                        const char* actual_expression,
18842                                        BiggestInt expected,
18843                                        BiggestInt actual);
18844
18845 // The helper class for {ASSERT|EXPECT}_EQ.  The template argument
18846 // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
18847 // is a null pointer literal.  The following default implementation is
18848 // for lhs_is_null_literal being false.
18849 template <bool lhs_is_null_literal>
18850 class EqHelper {
18851  public:
18852   // This templatized version is for the general case.
18853   template <typename T1, typename T2>
18854   static AssertionResult Compare(const char* expected_expression,
18855                                  const char* actual_expression,
18856                                  const T1& expected,
18857                                  const T2& actual) {
18858     return CmpHelperEQ(expected_expression, actual_expression, expected,
18859                        actual);
18860   }
18861
18862   // With this overloaded version, we allow anonymous enums to be used
18863   // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
18864   // enums can be implicitly cast to BiggestInt.
18865   //
18866   // Even though its body looks the same as the above version, we
18867   // cannot merge the two, as it will make anonymous enums unhappy.
18868   static AssertionResult Compare(const char* expected_expression,
18869                                  const char* actual_expression,
18870                                  BiggestInt expected,
18871                                  BiggestInt actual) {
18872     return CmpHelperEQ(expected_expression, actual_expression, expected,
18873                        actual);
18874   }
18875 };
18876
18877 // This specialization is used when the first argument to ASSERT_EQ()
18878 // is a null pointer literal, like NULL, false, or 0.
18879 template <>
18880 class EqHelper<true> {
18881  public:
18882   // We define two overloaded versions of Compare().  The first
18883   // version will be picked when the second argument to ASSERT_EQ() is
18884   // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
18885   // EXPECT_EQ(false, a_bool).
18886   template <typename T1, typename T2>
18887   static AssertionResult Compare(
18888       const char* expected_expression,
18889       const char* actual_expression,
18890       const T1& expected,
18891       const T2& actual,
18892       // The following line prevents this overload from being considered if T2
18893       // is not a pointer type.  We need this because ASSERT_EQ(NULL, my_ptr)
18894       // expands to Compare("", "", NULL, my_ptr), which requires a conversion
18895       // to match the Secret* in the other overload, which would otherwise make
18896       // this template match better.
18897       typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
18898     return CmpHelperEQ(expected_expression, actual_expression, expected,
18899                        actual);
18900   }
18901
18902   // This version will be picked when the second argument to ASSERT_EQ() is a
18903   // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
18904   template <typename T>
18905   static AssertionResult Compare(
18906       const char* expected_expression,
18907       const char* actual_expression,
18908       // We used to have a second template parameter instead of Secret*.  That
18909       // template parameter would deduce to 'long', making this a better match
18910       // than the first overload even without the first overload's EnableIf.
18911       // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
18912       // non-pointer argument" (even a deduced integral argument), so the old
18913       // implementation caused warnings in user code.
18914       Secret* /* expected (NULL) */,
18915       T* actual) {
18916     // We already know that 'expected' is a null pointer.
18917     return CmpHelperEQ(expected_expression, actual_expression,
18918                        static_cast<T*>(NULL), actual);
18919   }
18920 };
18921
18922 // A macro for implementing the helper functions needed to implement
18923 // ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste
18924 // of similar code.
18925 //
18926 // For each templatized helper function, we also define an overloaded
18927 // version for BiggestInt in order to reduce code bloat and allow
18928 // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
18929 // with gcc 4.
18930 //
18931 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18932 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
18933 template <typename T1, typename T2>\
18934 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
18935                                    const T1& val1, const T2& val2) {\
18936   if (val1 op val2) {\
18937     return AssertionSuccess();\
18938   } else {\
18939     return AssertionFailure() \
18940         << "Expected: (" << expr1 << ") " #op " (" << expr2\
18941         << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
18942         << " vs " << FormatForComparisonFailureMessage(val2, val1);\
18943   }\
18944 }\
18945 GTEST_API_ AssertionResult CmpHelper##op_name(\
18946     const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
18947
18948 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18949
18950 // Implements the helper function for {ASSERT|EXPECT}_NE
18951 GTEST_IMPL_CMP_HELPER_(NE, !=);
18952 // Implements the helper function for {ASSERT|EXPECT}_LE
18953 GTEST_IMPL_CMP_HELPER_(LE, <=);
18954 // Implements the helper function for {ASSERT|EXPECT}_LT
18955 GTEST_IMPL_CMP_HELPER_(LT, <);
18956 // Implements the helper function for {ASSERT|EXPECT}_GE
18957 GTEST_IMPL_CMP_HELPER_(GE, >=);
18958 // Implements the helper function for {ASSERT|EXPECT}_GT
18959 GTEST_IMPL_CMP_HELPER_(GT, >);
18960
18961 #undef GTEST_IMPL_CMP_HELPER_
18962
18963 // The helper function for {ASSERT|EXPECT}_STREQ.
18964 //
18965 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18966 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
18967                                           const char* actual_expression,
18968                                           const char* expected,
18969                                           const char* actual);
18970
18971 // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
18972 //
18973 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18974 GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
18975                                               const char* actual_expression,
18976                                               const char* expected,
18977                                               const char* actual);
18978
18979 // The helper function for {ASSERT|EXPECT}_STRNE.
18980 //
18981 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18982 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
18983                                           const char* s2_expression,
18984                                           const char* s1,
18985                                           const char* s2);
18986
18987 // The helper function for {ASSERT|EXPECT}_STRCASENE.
18988 //
18989 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18990 GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
18991                                               const char* s2_expression,
18992                                               const char* s1,
18993                                               const char* s2);
18994
18995
18996 // Helper function for *_STREQ on wide strings.
18997 //
18998 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18999 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19000                                           const char* actual_expression,
19001                                           const wchar_t* expected,
19002                                           const wchar_t* actual);
19003
19004 // Helper function for *_STRNE on wide strings.
19005 //
19006 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19007 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19008                                           const char* s2_expression,
19009                                           const wchar_t* s1,
19010                                           const wchar_t* s2);
19011
19012 }  // namespace internal
19013
19014 // IsSubstring() and IsNotSubstring() are intended to be used as the
19015 // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
19016 // themselves.  They check whether needle is a substring of haystack
19017 // (NULL is considered a substring of itself only), and return an
19018 // appropriate error message when they fail.
19019 //
19020 // The {needle,haystack}_expr arguments are the stringified
19021 // expressions that generated the two real arguments.
19022 GTEST_API_ AssertionResult IsSubstring(
19023     const char* needle_expr, const char* haystack_expr,
19024     const char* needle, const char* haystack);
19025 GTEST_API_ AssertionResult IsSubstring(
19026     const char* needle_expr, const char* haystack_expr,
19027     const wchar_t* needle, const wchar_t* haystack);
19028 GTEST_API_ AssertionResult IsNotSubstring(
19029     const char* needle_expr, const char* haystack_expr,
19030     const char* needle, const char* haystack);
19031 GTEST_API_ AssertionResult IsNotSubstring(
19032     const char* needle_expr, const char* haystack_expr,
19033     const wchar_t* needle, const wchar_t* haystack);
19034 GTEST_API_ AssertionResult IsSubstring(
19035     const char* needle_expr, const char* haystack_expr,
19036     const ::std::string& needle, const ::std::string& haystack);
19037 GTEST_API_ AssertionResult IsNotSubstring(
19038     const char* needle_expr, const char* haystack_expr,
19039     const ::std::string& needle, const ::std::string& haystack);
19040
19041 #if GTEST_HAS_STD_WSTRING
19042 GTEST_API_ AssertionResult IsSubstring(
19043     const char* needle_expr, const char* haystack_expr,
19044     const ::std::wstring& needle, const ::std::wstring& haystack);
19045 GTEST_API_ AssertionResult IsNotSubstring(
19046     const char* needle_expr, const char* haystack_expr,
19047     const ::std::wstring& needle, const ::std::wstring& haystack);
19048 #endif  // GTEST_HAS_STD_WSTRING
19049
19050 namespace internal {
19051
19052 // Helper template function for comparing floating-points.
19053 //
19054 // Template parameter:
19055 //
19056 //   RawType: the raw floating-point type (either float or double)
19057 //
19058 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19059 template <typename RawType>
19060 AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
19061                                          const char* actual_expression,
19062                                          RawType expected,
19063                                          RawType actual) {
19064   const FloatingPoint<RawType> lhs(expected), rhs(actual);
19065
19066   if (lhs.AlmostEquals(rhs)) {
19067     return AssertionSuccess();
19068   }
19069
19070   ::std::stringstream expected_ss;
19071   expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19072               << expected;
19073
19074   ::std::stringstream actual_ss;
19075   actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19076             << actual;
19077
19078   return EqFailure(expected_expression,
19079                    actual_expression,
19080                    StringStreamToString(&expected_ss),
19081                    StringStreamToString(&actual_ss),
19082                    false);
19083 }
19084
19085 // Helper function for implementing ASSERT_NEAR.
19086 //
19087 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19088 GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
19089                                                 const char* expr2,
19090                                                 const char* abs_error_expr,
19091                                                 double val1,
19092                                                 double val2,
19093                                                 double abs_error);
19094
19095 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19096 // A class that enables one to stream messages to assertion macros
19097 class GTEST_API_ AssertHelper {
19098  public:
19099   // Constructor.
19100   AssertHelper(TestPartResult::Type type,
19101                const char* file,
19102                int line,
19103                const char* message);
19104   ~AssertHelper();
19105
19106   // Message assignment is a semantic trick to enable assertion
19107   // streaming; see the GTEST_MESSAGE_ macro below.
19108   void operator=(const Message& message) const;
19109
19110  private:
19111   // We put our data in a struct so that the size of the AssertHelper class can
19112   // be as small as possible.  This is important because gcc is incapable of
19113   // re-using stack space even for temporary variables, so every EXPECT_EQ
19114   // reserves stack space for another AssertHelper.
19115   struct AssertHelperData {
19116     AssertHelperData(TestPartResult::Type t,
19117                      const char* srcfile,
19118                      int line_num,
19119                      const char* msg)
19120         : type(t), file(srcfile), line(line_num), message(msg) { }
19121
19122     TestPartResult::Type const type;
19123     const char* const file;
19124     int const line;
19125     std::string const message;
19126
19127    private:
19128     GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
19129   };
19130
19131   AssertHelperData* const data_;
19132
19133   GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
19134 };
19135
19136 }  // namespace internal
19137
19138 #if GTEST_HAS_PARAM_TEST
19139 // The pure interface class that all value-parameterized tests inherit from.
19140 // A value-parameterized class must inherit from both ::testing::Test and
19141 // ::testing::WithParamInterface. In most cases that just means inheriting
19142 // from ::testing::TestWithParam, but more complicated test hierarchies
19143 // may need to inherit from Test and WithParamInterface at different levels.
19144 //
19145 // This interface has support for accessing the test parameter value via
19146 // the GetParam() method.
19147 //
19148 // Use it with one of the parameter generator defining functions, like Range(),
19149 // Values(), ValuesIn(), Bool(), and Combine().
19150 //
19151 // class FooTest : public ::testing::TestWithParam<int> {
19152 //  protected:
19153 //   FooTest() {
19154 //     // Can use GetParam() here.
19155 //   }
19156 //   virtual ~FooTest() {
19157 //     // Can use GetParam() here.
19158 //   }
19159 //   virtual void SetUp() {
19160 //     // Can use GetParam() here.
19161 //   }
19162 //   virtual void TearDown {
19163 //     // Can use GetParam() here.
19164 //   }
19165 // };
19166 // TEST_P(FooTest, DoesBar) {
19167 //   // Can use GetParam() method here.
19168 //   Foo foo;
19169 //   ASSERT_TRUE(foo.DoesBar(GetParam()));
19170 // }
19171 // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
19172
19173 template <typename T>
19174 class WithParamInterface {
19175  public:
19176   typedef T ParamType;
19177   virtual ~WithParamInterface() {}
19178
19179   // The current parameter value. Is also available in the test fixture's
19180   // constructor. This member function is non-static, even though it only
19181   // references static data, to reduce the opportunity for incorrect uses
19182   // like writing 'WithParamInterface<bool>::GetParam()' for a test that
19183   // uses a fixture whose parameter type is int.
19184   const ParamType& GetParam() const { return *parameter_; }
19185
19186  private:
19187   // Sets parameter value. The caller is responsible for making sure the value
19188   // remains alive and unchanged throughout the current test.
19189   static void SetParam(const ParamType* parameter) {
19190     parameter_ = parameter;
19191   }
19192
19193   // Static value used for accessing parameter during a test lifetime.
19194   static const ParamType* parameter_;
19195
19196   // TestClass must be a subclass of WithParamInterface<T> and Test.
19197   template <class TestClass> friend class internal::ParameterizedTestFactory;
19198 };
19199
19200 template <typename T>
19201 const T* WithParamInterface<T>::parameter_ = NULL;
19202
19203 // Most value-parameterized classes can ignore the existence of
19204 // WithParamInterface, and can just inherit from ::testing::TestWithParam.
19205
19206 template <typename T>
19207 class TestWithParam : public Test, public WithParamInterface<T> {
19208 };
19209
19210 #endif  // GTEST_HAS_PARAM_TEST
19211
19212 // Macros for indicating success/failure in test code.
19213
19214 // ADD_FAILURE unconditionally adds a failure to the current test.
19215 // SUCCEED generates a success - it doesn't automatically make the
19216 // current test successful, as a test is only successful when it has
19217 // no failure.
19218 //
19219 // EXPECT_* verifies that a certain condition is satisfied.  If not,
19220 // it behaves like ADD_FAILURE.  In particular:
19221 //
19222 //   EXPECT_TRUE  verifies that a Boolean condition is true.
19223 //   EXPECT_FALSE verifies that a Boolean condition is false.
19224 //
19225 // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
19226 // that they will also abort the current function on failure.  People
19227 // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
19228 // writing data-driven tests often find themselves using ADD_FAILURE
19229 // and EXPECT_* more.
19230
19231 // Generates a nonfatal failure with a generic message.
19232 #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
19233
19234 // Generates a nonfatal failure at the given source file location with
19235 // a generic message.
19236 #define ADD_FAILURE_AT(file, line) \
19237   GTEST_MESSAGE_AT_(file, line, "Failed", \
19238                     ::testing::TestPartResult::kNonFatalFailure)
19239
19240 // Generates a fatal failure with a generic message.
19241 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
19242
19243 // Define this macro to 1 to omit the definition of FAIL(), which is a
19244 // generic name and clashes with some other libraries.
19245 #if !GTEST_DONT_DEFINE_FAIL
19246 # define FAIL() GTEST_FAIL()
19247 #endif
19248
19249 // Generates a success with a generic message.
19250 #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
19251
19252 // Define this macro to 1 to omit the definition of SUCCEED(), which
19253 // is a generic name and clashes with some other libraries.
19254 #if !GTEST_DONT_DEFINE_SUCCEED
19255 # define SUCCEED() GTEST_SUCCEED()
19256 #endif
19257
19258 // Macros for testing exceptions.
19259 //
19260 //    * {ASSERT|EXPECT}_THROW(statement, expected_exception):
19261 //         Tests that the statement throws the expected exception.
19262 //    * {ASSERT|EXPECT}_NO_THROW(statement):
19263 //         Tests that the statement doesn't throw any exception.
19264 //    * {ASSERT|EXPECT}_ANY_THROW(statement):
19265 //         Tests that the statement throws an exception.
19266
19267 #define EXPECT_THROW(statement, expected_exception) \
19268   GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
19269 #define EXPECT_NO_THROW(statement) \
19270   GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19271 #define EXPECT_ANY_THROW(statement) \
19272   GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19273 #define ASSERT_THROW(statement, expected_exception) \
19274   GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
19275 #define ASSERT_NO_THROW(statement) \
19276   GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
19277 #define ASSERT_ANY_THROW(statement) \
19278   GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
19279
19280 // Boolean assertions. Condition can be either a Boolean expression or an
19281 // AssertionResult. For more information on how to use AssertionResult with
19282 // these macros see comments on that class.
19283 #define EXPECT_TRUE(condition) \
19284   GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19285                       GTEST_NONFATAL_FAILURE_)
19286 #define EXPECT_FALSE(condition) \
19287   GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19288                       GTEST_NONFATAL_FAILURE_)
19289 #define ASSERT_TRUE(condition) \
19290   GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19291                       GTEST_FATAL_FAILURE_)
19292 #define ASSERT_FALSE(condition) \
19293   GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19294                       GTEST_FATAL_FAILURE_)
19295
19296 // Includes the auto-generated header that implements a family of
19297 // generic predicate assertion macros.
19298 // Copyright 2006, Google Inc.
19299 // All rights reserved.
19300 //
19301 // Redistribution and use in source and binary forms, with or without
19302 // modification, are permitted provided that the following conditions are
19303 // met:
19304 //
19305 //     * Redistributions of source code must retain the above copyright
19306 // notice, this list of conditions and the following disclaimer.
19307 //     * Redistributions in binary form must reproduce the above
19308 // copyright notice, this list of conditions and the following disclaimer
19309 // in the documentation and/or other materials provided with the
19310 // distribution.
19311 //     * Neither the name of Google Inc. nor the names of its
19312 // contributors may be used to endorse or promote products derived from
19313 // this software without specific prior written permission.
19314 //
19315 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19316 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19317 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19318 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19319 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19320 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19321 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19322 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19323 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19324 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19325 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19326
19327 // This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
19328 // 'gen_gtest_pred_impl.py 5'.  DO NOT EDIT BY HAND!
19329 //
19330 // Implements a family of generic predicate assertion macros.
19331
19332 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19333 #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19334
19335 // Makes sure this header is not included before gtest.h.
19336 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
19337 # error Do not include gtest_pred_impl.h directly.  Include gtest.h instead.
19338 #endif  // GTEST_INCLUDE_GTEST_GTEST_H_
19339
19340 // This header implements a family of generic predicate assertion
19341 // macros:
19342 //
19343 //   ASSERT_PRED_FORMAT1(pred_format, v1)
19344 //   ASSERT_PRED_FORMAT2(pred_format, v1, v2)
19345 //   ...
19346 //
19347 // where pred_format is a function or functor that takes n (in the
19348 // case of ASSERT_PRED_FORMATn) values and their source expression
19349 // text, and returns a testing::AssertionResult.  See the definition
19350 // of ASSERT_EQ in gtest.h for an example.
19351 //
19352 // If you don't care about formatting, you can use the more
19353 // restrictive version:
19354 //
19355 //   ASSERT_PRED1(pred, v1)
19356 //   ASSERT_PRED2(pred, v1, v2)
19357 //   ...
19358 //
19359 // where pred is an n-ary function or functor that returns bool,
19360 // and the values v1, v2, ..., must support the << operator for
19361 // streaming to std::ostream.
19362 //
19363 // We also define the EXPECT_* variations.
19364 //
19365 // For now we only support predicates whose arity is at most 5.
19366 // Please email googletestframework@googlegroups.com if you need
19367 // support for higher arities.
19368
19369 // GTEST_ASSERT_ is the basic statement to which all of the assertions
19370 // in this file reduce.  Don't use this in your code.
19371
19372 #define GTEST_ASSERT_(expression, on_failure) \
19373   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
19374   if (const ::testing::AssertionResult gtest_ar = (expression)) \
19375     ; \
19376   else \
19377     on_failure(gtest_ar.failure_message())
19378
19379
19380 // Helper function for implementing {EXPECT|ASSERT}_PRED1.  Don't use
19381 // this in your code.
19382 template <typename Pred,
19383           typename T1>
19384 AssertionResult AssertPred1Helper(const char* pred_text,
19385                                   const char* e1,
19386                                   Pred pred,
19387                                   const T1& v1) {
19388   if (pred(v1)) return AssertionSuccess();
19389
19390   return AssertionFailure() << pred_text << "("
19391                             << e1 << ") evaluates to false, where"
19392                             << "\n" << e1 << " evaluates to " << v1;
19393 }
19394
19395 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
19396 // Don't use this in your code.
19397 #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
19398   GTEST_ASSERT_(pred_format(#v1, v1), \
19399                 on_failure)
19400
19401 // Internal macro for implementing {EXPECT|ASSERT}_PRED1.  Don't use
19402 // this in your code.
19403 #define GTEST_PRED1_(pred, v1, on_failure)\
19404   GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
19405                                              #v1, \
19406                                              pred, \
19407                                              v1), on_failure)
19408
19409 // Unary predicate assertion macros.
19410 #define EXPECT_PRED_FORMAT1(pred_format, v1) \
19411   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
19412 #define EXPECT_PRED1(pred, v1) \
19413   GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
19414 #define ASSERT_PRED_FORMAT1(pred_format, v1) \
19415   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
19416 #define ASSERT_PRED1(pred, v1) \
19417   GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
19418
19419
19420
19421 // Helper function for implementing {EXPECT|ASSERT}_PRED2.  Don't use
19422 // this in your code.
19423 template <typename Pred,
19424           typename T1,
19425           typename T2>
19426 AssertionResult AssertPred2Helper(const char* pred_text,
19427                                   const char* e1,
19428                                   const char* e2,
19429                                   Pred pred,
19430                                   const T1& v1,
19431                                   const T2& v2) {
19432   if (pred(v1, v2)) return AssertionSuccess();
19433
19434   return AssertionFailure() << pred_text << "("
19435                             << e1 << ", "
19436                             << e2 << ") evaluates to false, where"
19437                             << "\n" << e1 << " evaluates to " << v1
19438                             << "\n" << e2 << " evaluates to " << v2;
19439 }
19440
19441 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
19442 // Don't use this in your code.
19443 #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
19444   GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
19445                 on_failure)
19446
19447 // Internal macro for implementing {EXPECT|ASSERT}_PRED2.  Don't use
19448 // this in your code.
19449 #define GTEST_PRED2_(pred, v1, v2, on_failure)\
19450   GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
19451                                              #v1, \
19452                                              #v2, \
19453                                              pred, \
19454                                              v1, \
19455                                              v2), on_failure)
19456
19457 // Binary predicate assertion macros.
19458 #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
19459   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
19460 #define EXPECT_PRED2(pred, v1, v2) \
19461   GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
19462 #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
19463   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
19464 #define ASSERT_PRED2(pred, v1, v2) \
19465   GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
19466
19467
19468
19469 // Helper function for implementing {EXPECT|ASSERT}_PRED3.  Don't use
19470 // this in your code.
19471 template <typename Pred,
19472           typename T1,
19473           typename T2,
19474           typename T3>
19475 AssertionResult AssertPred3Helper(const char* pred_text,
19476                                   const char* e1,
19477                                   const char* e2,
19478                                   const char* e3,
19479                                   Pred pred,
19480                                   const T1& v1,
19481                                   const T2& v2,
19482                                   const T3& v3) {
19483   if (pred(v1, v2, v3)) return AssertionSuccess();
19484
19485   return AssertionFailure() << pred_text << "("
19486                             << e1 << ", "
19487                             << e2 << ", "
19488                             << e3 << ") evaluates to false, where"
19489                             << "\n" << e1 << " evaluates to " << v1
19490                             << "\n" << e2 << " evaluates to " << v2
19491                             << "\n" << e3 << " evaluates to " << v3;
19492 }
19493
19494 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
19495 // Don't use this in your code.
19496 #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
19497   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
19498                 on_failure)
19499
19500 // Internal macro for implementing {EXPECT|ASSERT}_PRED3.  Don't use
19501 // this in your code.
19502 #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
19503   GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
19504                                              #v1, \
19505                                              #v2, \
19506                                              #v3, \
19507                                              pred, \
19508                                              v1, \
19509                                              v2, \
19510                                              v3), on_failure)
19511
19512 // Ternary predicate assertion macros.
19513 #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19514   GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19515 #define EXPECT_PRED3(pred, v1, v2, v3) \
19516   GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19517 #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19518   GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
19519 #define ASSERT_PRED3(pred, v1, v2, v3) \
19520   GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
19521
19522
19523
19524 // Helper function for implementing {EXPECT|ASSERT}_PRED4.  Don't use
19525 // this in your code.
19526 template <typename Pred,
19527           typename T1,
19528           typename T2,
19529           typename T3,
19530           typename T4>
19531 AssertionResult AssertPred4Helper(const char* pred_text,
19532                                   const char* e1,
19533                                   const char* e2,
19534                                   const char* e3,
19535                                   const char* e4,
19536                                   Pred pred,
19537                                   const T1& v1,
19538                                   const T2& v2,
19539                                   const T3& v3,
19540                                   const T4& v4) {
19541   if (pred(v1, v2, v3, v4)) return AssertionSuccess();
19542
19543   return AssertionFailure() << pred_text << "("
19544                             << e1 << ", "
19545                             << e2 << ", "
19546                             << e3 << ", "
19547                             << e4 << ") evaluates to false, where"
19548                             << "\n" << e1 << " evaluates to " << v1
19549                             << "\n" << e2 << " evaluates to " << v2
19550                             << "\n" << e3 << " evaluates to " << v3
19551                             << "\n" << e4 << " evaluates to " << v4;
19552 }
19553
19554 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
19555 // Don't use this in your code.
19556 #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
19557   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
19558                 on_failure)
19559
19560 // Internal macro for implementing {EXPECT|ASSERT}_PRED4.  Don't use
19561 // this in your code.
19562 #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
19563   GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
19564                                              #v1, \
19565                                              #v2, \
19566                                              #v3, \
19567                                              #v4, \
19568                                              pred, \
19569                                              v1, \
19570                                              v2, \
19571                                              v3, \
19572                                              v4), on_failure)
19573
19574 // 4-ary predicate assertion macros.
19575 #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19576   GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19577 #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
19578   GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19579 #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19580   GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19581 #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
19582   GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19583
19584
19585
19586 // Helper function for implementing {EXPECT|ASSERT}_PRED5.  Don't use
19587 // this in your code.
19588 template <typename Pred,
19589           typename T1,
19590           typename T2,
19591           typename T3,
19592           typename T4,
19593           typename T5>
19594 AssertionResult AssertPred5Helper(const char* pred_text,
19595                                   const char* e1,
19596                                   const char* e2,
19597                                   const char* e3,
19598                                   const char* e4,
19599                                   const char* e5,
19600                                   Pred pred,
19601                                   const T1& v1,
19602                                   const T2& v2,
19603                                   const T3& v3,
19604                                   const T4& v4,
19605                                   const T5& v5) {
19606   if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
19607
19608   return AssertionFailure() << pred_text << "("
19609                             << e1 << ", "
19610                             << e2 << ", "
19611                             << e3 << ", "
19612                             << e4 << ", "
19613                             << e5 << ") evaluates to false, where"
19614                             << "\n" << e1 << " evaluates to " << v1
19615                             << "\n" << e2 << " evaluates to " << v2
19616                             << "\n" << e3 << " evaluates to " << v3
19617                             << "\n" << e4 << " evaluates to " << v4
19618                             << "\n" << e5 << " evaluates to " << v5;
19619 }
19620
19621 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
19622 // Don't use this in your code.
19623 #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
19624   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
19625                 on_failure)
19626
19627 // Internal macro for implementing {EXPECT|ASSERT}_PRED5.  Don't use
19628 // this in your code.
19629 #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
19630   GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
19631                                              #v1, \
19632                                              #v2, \
19633                                              #v3, \
19634                                              #v4, \
19635                                              #v5, \
19636                                              pred, \
19637                                              v1, \
19638                                              v2, \
19639                                              v3, \
19640                                              v4, \
19641                                              v5), on_failure)
19642
19643 // 5-ary predicate assertion macros.
19644 #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19645   GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19646 #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
19647   GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19648 #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19649   GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19650 #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
19651   GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19652
19653
19654
19655 #endif  // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19656
19657 // Macros for testing equalities and inequalities.
19658 //
19659 //    * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
19660 //    * {ASSERT|EXPECT}_NE(v1, v2):           Tests that v1 != v2
19661 //    * {ASSERT|EXPECT}_LT(v1, v2):           Tests that v1 < v2
19662 //    * {ASSERT|EXPECT}_LE(v1, v2):           Tests that v1 <= v2
19663 //    * {ASSERT|EXPECT}_GT(v1, v2):           Tests that v1 > v2
19664 //    * {ASSERT|EXPECT}_GE(v1, v2):           Tests that v1 >= v2
19665 //
19666 // When they are not, Google Test prints both the tested expressions and
19667 // their actual values.  The values must be compatible built-in types,
19668 // or you will get a compiler error.  By "compatible" we mean that the
19669 // values can be compared by the respective operator.
19670 //
19671 // Note:
19672 //
19673 //   1. It is possible to make a user-defined type work with
19674 //   {ASSERT|EXPECT}_??(), but that requires overloading the
19675 //   comparison operators and is thus discouraged by the Google C++
19676 //   Usage Guide.  Therefore, you are advised to use the
19677 //   {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
19678 //   equal.
19679 //
19680 //   2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
19681 //   pointers (in particular, C strings).  Therefore, if you use it
19682 //   with two C strings, you are testing how their locations in memory
19683 //   are related, not how their content is related.  To compare two C
19684 //   strings by content, use {ASSERT|EXPECT}_STR*().
19685 //
19686 //   3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
19687 //   {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
19688 //   what the actual value is when it fails, and similarly for the
19689 //   other comparisons.
19690 //
19691 //   4. Do not depend on the order in which {ASSERT|EXPECT}_??()
19692 //   evaluate their arguments, which is undefined.
19693 //
19694 //   5. These macros evaluate their arguments exactly once.
19695 //
19696 // Examples:
19697 //
19698 //   EXPECT_NE(5, Foo());
19699 //   EXPECT_EQ(NULL, a_pointer);
19700 //   ASSERT_LT(i, array_size);
19701 //   ASSERT_GT(records.size(), 0) << "There is no record left.";
19702
19703 #define EXPECT_EQ(expected, actual) \
19704   EXPECT_PRED_FORMAT2(::testing::internal:: \
19705                       EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19706                       expected, actual)
19707 #define EXPECT_NE(expected, actual) \
19708   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
19709 #define EXPECT_LE(val1, val2) \
19710   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19711 #define EXPECT_LT(val1, val2) \
19712   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19713 #define EXPECT_GE(val1, val2) \
19714   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19715 #define EXPECT_GT(val1, val2) \
19716   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19717
19718 #define GTEST_ASSERT_EQ(expected, actual) \
19719   ASSERT_PRED_FORMAT2(::testing::internal:: \
19720                       EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19721                       expected, actual)
19722 #define GTEST_ASSERT_NE(val1, val2) \
19723   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
19724 #define GTEST_ASSERT_LE(val1, val2) \
19725   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19726 #define GTEST_ASSERT_LT(val1, val2) \
19727   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19728 #define GTEST_ASSERT_GE(val1, val2) \
19729   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19730 #define GTEST_ASSERT_GT(val1, val2) \
19731   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19732
19733 // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
19734 // ASSERT_XY(), which clashes with some users' own code.
19735
19736 #if !GTEST_DONT_DEFINE_ASSERT_EQ
19737 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
19738 #endif
19739
19740 #if !GTEST_DONT_DEFINE_ASSERT_NE
19741 # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
19742 #endif
19743
19744 #if !GTEST_DONT_DEFINE_ASSERT_LE
19745 # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
19746 #endif
19747
19748 #if !GTEST_DONT_DEFINE_ASSERT_LT
19749 # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
19750 #endif
19751
19752 #if !GTEST_DONT_DEFINE_ASSERT_GE
19753 # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
19754 #endif
19755
19756 #if !GTEST_DONT_DEFINE_ASSERT_GT
19757 # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
19758 #endif
19759
19760 // C-string Comparisons.  All tests treat NULL and any non-NULL string
19761 // as different.  Two NULLs are equal.
19762 //
19763 //    * {ASSERT|EXPECT}_STREQ(s1, s2):     Tests that s1 == s2
19764 //    * {ASSERT|EXPECT}_STRNE(s1, s2):     Tests that s1 != s2
19765 //    * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
19766 //    * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
19767 //
19768 // For wide or narrow string objects, you can use the
19769 // {ASSERT|EXPECT}_??() macros.
19770 //
19771 // Don't depend on the order in which the arguments are evaluated,
19772 // which is undefined.
19773 //
19774 // These macros evaluate their arguments exactly once.
19775
19776 #define EXPECT_STREQ(expected, actual) \
19777   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19778 #define EXPECT_STRNE(s1, s2) \
19779   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19780 #define EXPECT_STRCASEEQ(expected, actual) \
19781   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19782 #define EXPECT_STRCASENE(s1, s2)\
19783   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19784
19785 #define ASSERT_STREQ(expected, actual) \
19786   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19787 #define ASSERT_STRNE(s1, s2) \
19788   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19789 #define ASSERT_STRCASEEQ(expected, actual) \
19790   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19791 #define ASSERT_STRCASENE(s1, s2)\
19792   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19793
19794 // Macros for comparing floating-point numbers.
19795 //
19796 //    * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
19797 //         Tests that two float values are almost equal.
19798 //    * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
19799 //         Tests that two double values are almost equal.
19800 //    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
19801 //         Tests that v1 and v2 are within the given distance to each other.
19802 //
19803 // Google Test uses ULP-based comparison to automatically pick a default
19804 // error bound that is appropriate for the operands.  See the
19805 // FloatingPoint template class in gtest-internal.h if you are
19806 // interested in the implementation details.
19807
19808 #define EXPECT_FLOAT_EQ(expected, actual)\
19809   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19810                       expected, actual)
19811
19812 #define EXPECT_DOUBLE_EQ(expected, actual)\
19813   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19814                       expected, actual)
19815
19816 #define ASSERT_FLOAT_EQ(expected, actual)\
19817   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19818                       expected, actual)
19819
19820 #define ASSERT_DOUBLE_EQ(expected, actual)\
19821   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19822                       expected, actual)
19823
19824 #define EXPECT_NEAR(val1, val2, abs_error)\
19825   EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19826                       val1, val2, abs_error)
19827
19828 #define ASSERT_NEAR(val1, val2, abs_error)\
19829   ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19830                       val1, val2, abs_error)
19831
19832 // These predicate format functions work on floating-point values, and
19833 // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
19834 //
19835 //   EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
19836
19837 // Asserts that val1 is less than, or almost equal to, val2.  Fails
19838 // otherwise.  In particular, it fails if either val1 or val2 is NaN.
19839 GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
19840                                    float val1, float val2);
19841 GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
19842                                     double val1, double val2);
19843
19844
19845 #if GTEST_OS_WINDOWS
19846
19847 // Macros that test for HRESULT failure and success, these are only useful
19848 // on Windows, and rely on Windows SDK macros and APIs to compile.
19849 //
19850 //    * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
19851 //
19852 // When expr unexpectedly fails or succeeds, Google Test prints the
19853 // expected result and the actual result with both a human-readable
19854 // string representation of the error, if available, as well as the
19855 // hex result code.
19856 # define EXPECT_HRESULT_SUCCEEDED(expr) \
19857     EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19858
19859 # define ASSERT_HRESULT_SUCCEEDED(expr) \
19860     ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19861
19862 # define EXPECT_HRESULT_FAILED(expr) \
19863     EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19864
19865 # define ASSERT_HRESULT_FAILED(expr) \
19866     ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19867
19868 #endif  // GTEST_OS_WINDOWS
19869
19870 // Macros that execute statement and check that it doesn't generate new fatal
19871 // failures in the current thread.
19872 //
19873 //   * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
19874 //
19875 // Examples:
19876 //
19877 //   EXPECT_NO_FATAL_FAILURE(Process());
19878 //   ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
19879 //
19880 #define ASSERT_NO_FATAL_FAILURE(statement) \
19881     GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
19882 #define EXPECT_NO_FATAL_FAILURE(statement) \
19883     GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
19884
19885 // Causes a trace (including the source file path, the current line
19886 // number, and the given message) to be included in every test failure
19887 // message generated by code in the current scope.  The effect is
19888 // undone when the control leaves the current scope.
19889 //
19890 // The message argument can be anything streamable to std::ostream.
19891 //
19892 // In the implementation, we include the current line number as part
19893 // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
19894 // to appear in the same block - as long as they are on different
19895 // lines.
19896 #define SCOPED_TRACE(message) \
19897   ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
19898     __FILE__, __LINE__, ::testing::Message() << (message))
19899
19900 // Compile-time assertion for type equality.
19901 // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
19902 // the same type.  The value it returns is not interesting.
19903 //
19904 // Instead of making StaticAssertTypeEq a class template, we make it a
19905 // function template that invokes a helper class template.  This
19906 // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
19907 // defining objects of that type.
19908 //
19909 // CAVEAT:
19910 //
19911 // When used inside a method of a class template,
19912 // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
19913 // instantiated.  For example, given:
19914 //
19915 //   template <typename T> class Foo {
19916 //    public:
19917 //     void Bar() { testing::StaticAssertTypeEq<int, T>(); }
19918 //   };
19919 //
19920 // the code:
19921 //
19922 //   void Test1() { Foo<bool> foo; }
19923 //
19924 // will NOT generate a compiler error, as Foo<bool>::Bar() is never
19925 // actually instantiated.  Instead, you need:
19926 //
19927 //   void Test2() { Foo<bool> foo; foo.Bar(); }
19928 //
19929 // to cause a compiler error.
19930 template <typename T1, typename T2>
19931 bool StaticAssertTypeEq() {
19932   (void)internal::StaticAssertTypeEqHelper<T1, T2>();
19933   return true;
19934 }
19935
19936 // Defines a test.
19937 //
19938 // The first parameter is the name of the test case, and the second
19939 // parameter is the name of the test within the test case.
19940 //
19941 // The convention is to end the test case name with "Test".  For
19942 // example, a test case for the Foo class can be named FooTest.
19943 //
19944 // The user should put his test code between braces after using this
19945 // macro.  Example:
19946 //
19947 //   TEST(FooTest, InitializesCorrectly) {
19948 //     Foo foo;
19949 //     EXPECT_TRUE(foo.StatusIsOK());
19950 //   }
19951
19952 // Note that we call GetTestTypeId() instead of GetTypeId<
19953 // ::testing::Test>() here to get the type ID of testing::Test.  This
19954 // is to work around a suspected linker bug when using Google Test as
19955 // a framework on Mac OS X.  The bug causes GetTypeId<
19956 // ::testing::Test>() to return different values depending on whether
19957 // the call is from the Google Test framework itself or from user test
19958 // code.  GetTestTypeId() is guaranteed to always return the same
19959 // value, as it always calls GetTypeId<>() from the Google Test
19960 // framework.
19961 #define GTEST_TEST(test_case_name, test_name)\
19962   GTEST_TEST_(test_case_name, test_name, \
19963               ::testing::Test, ::testing::internal::GetTestTypeId())
19964
19965 // Define this macro to 1 to omit the definition of TEST(), which
19966 // is a generic name and clashes with some other libraries.
19967 #if !GTEST_DONT_DEFINE_TEST
19968 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
19969 #endif
19970
19971 // Defines a test that uses a test fixture.
19972 //
19973 // The first parameter is the name of the test fixture class, which
19974 // also doubles as the test case name.  The second parameter is the
19975 // name of the test within the test case.
19976 //
19977 // A test fixture class must be declared earlier.  The user should put
19978 // his test code between braces after using this macro.  Example:
19979 //
19980 //   class FooTest : public testing::Test {
19981 //    protected:
19982 //     virtual void SetUp() { b_.AddElement(3); }
19983 //
19984 //     Foo a_;
19985 //     Foo b_;
19986 //   };
19987 //
19988 //   TEST_F(FooTest, InitializesCorrectly) {
19989 //     EXPECT_TRUE(a_.StatusIsOK());
19990 //   }
19991 //
19992 //   TEST_F(FooTest, ReturnsElementCountCorrectly) {
19993 //     EXPECT_EQ(0, a_.size());
19994 //     EXPECT_EQ(1, b_.size());
19995 //   }
19996
19997 #define TEST_F(test_fixture, test_name)\
19998   GTEST_TEST_(test_fixture, test_name, test_fixture, \
19999               ::testing::internal::GetTypeId<test_fixture>())
20000
20001 // Use this macro in main() to run all tests.  It returns 0 if all
20002 // tests are successful, or 1 otherwise.
20003 //
20004 // RUN_ALL_TESTS() should be invoked after the command line has been
20005 // parsed by InitGoogleTest().
20006
20007 #define RUN_ALL_TESTS()\
20008   (::testing::UnitTest::GetInstance()->Run())
20009
20010 }  // namespace testing
20011
20012 #endif  // GTEST_INCLUDE_GTEST_GTEST_H_