gtest.h
Go to the documentation of this file.
00001 // Copyright 2005, Google Inc.
00002 // All rights reserved.
00003 //
00004 // Redistribution and use in source and binary forms, with or without
00005 // modification, are permitted provided that the following conditions are
00006 // met:
00007 //
00008 //     * Redistributions of source code must retain the above copyright
00009 // notice, this list of conditions and the following disclaimer.
00010 //     * Redistributions in binary form must reproduce the above
00011 // copyright notice, this list of conditions and the following disclaimer
00012 // in the documentation and/or other materials provided with the
00013 // distribution.
00014 //     * Neither the name of Google Inc. nor the names of its
00015 // contributors may be used to endorse or promote products derived from
00016 // this software without specific prior written permission.
00017 //
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00019 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00020 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00021 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00022 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00023 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00024 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00025 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00026 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00027 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00028 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // Author: wan@google.com (Zhanyong Wan)
00031 //
00032 // The Google C++ Testing Framework (Google Test)
00033 //
00034 // This header file defines the public API for Google Test.  It should be
00035 // included by any test program that uses Google Test.
00036 //
00037 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
00038 // leave some internal implementation details in this header file.
00039 // They are clearly marked by comments like this:
00040 //
00041 //   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
00042 //
00043 // Such code is NOT meant to be used by a user directly, and is subject
00044 // to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
00045 // program!
00046 //
00047 // Acknowledgment: Google Test borrowed the idea of automatic test
00048 // registration from Barthelemy Dagenais' (barthelemy@prologique.com)
00049 // easyUnit framework.
00050 
00051 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
00052 #define GTEST_INCLUDE_GTEST_GTEST_H_
00053 
00054 #include <limits>
00055 #include <ostream>
00056 #include <vector>
00057 
00058 // Copyright 2005, Google Inc.
00059 // All rights reserved.
00060 //
00061 // Redistribution and use in source and binary forms, with or without
00062 // modification, are permitted provided that the following conditions are
00063 // met:
00064 //
00065 //     * Redistributions of source code must retain the above copyright
00066 // notice, this list of conditions and the following disclaimer.
00067 //     * Redistributions in binary form must reproduce the above
00068 // copyright notice, this list of conditions and the following disclaimer
00069 // in the documentation and/or other materials provided with the
00070 // distribution.
00071 //     * Neither the name of Google Inc. nor the names of its
00072 // contributors may be used to endorse or promote products derived from
00073 // this software without specific prior written permission.
00074 //
00075 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00076 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00077 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00078 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00079 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00080 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00081 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00082 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00083 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00084 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00085 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00086 //
00087 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
00088 //
00089 // The Google C++ Testing Framework (Google Test)
00090 //
00091 // This header file declares functions and macros used internally by
00092 // Google Test.  They are subject to change without notice.
00093 
00094 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
00095 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
00096 
00097 // Copyright 2005, Google Inc.
00098 // All rights reserved.
00099 //
00100 // Redistribution and use in source and binary forms, with or without
00101 // modification, are permitted provided that the following conditions are
00102 // met:
00103 //
00104 //     * Redistributions of source code must retain the above copyright
00105 // notice, this list of conditions and the following disclaimer.
00106 //     * Redistributions in binary form must reproduce the above
00107 // copyright notice, this list of conditions and the following disclaimer
00108 // in the documentation and/or other materials provided with the
00109 // distribution.
00110 //     * Neither the name of Google Inc. nor the names of its
00111 // contributors may be used to endorse or promote products derived from
00112 // this software without specific prior written permission.
00113 //
00114 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00115 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00116 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00117 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00118 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00119 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00120 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00121 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00122 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00123 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00124 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00125 //
00126 // Authors: wan@google.com (Zhanyong Wan)
00127 //
00128 // Low-level types and utilities for porting Google Test to various
00129 // platforms.  They are subject to change without notice.  DO NOT USE
00130 // THEM IN USER CODE.
00131 //
00132 // This file is fundamental to Google Test.  All other Google Test source
00133 // files are expected to #include this.  Therefore, it cannot #include
00134 // any other Google Test header.
00135 
00136 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
00137 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
00138 
00139 // The user can define the following macros in the build script to
00140 // control Google Test's behavior.  If the user doesn't define a macro
00141 // in this list, Google Test will define it.
00142 //
00143 //   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)
00144 //                              is/isn't available.
00145 //   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions
00146 //                              are enabled.
00147 //   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string
00148 //                              is/isn't available (some systems define
00149 //                              ::string, which is different to std::string).
00150 //   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
00151 //                              is/isn't available (some systems define
00152 //                              ::wstring, which is different to std::wstring).
00153 //   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular
00154 //                              expressions are/aren't available.
00155 //   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>
00156 //                              is/isn't available.
00157 //   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't
00158 //                              enabled.
00159 //   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that
00160 //                              std::wstring does/doesn't work (Google Test can
00161 //                              be used where std::wstring is unavailable).
00162 //   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple
00163 //                              is/isn't available.
00164 //   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the
00165 //                              compiler supports Microsoft's "Structured
00166 //                              Exception Handling".
00167 //   GTEST_HAS_STREAM_REDIRECTION
00168 //                            - Define it to 1/0 to indicate whether the
00169 //                              platform supports I/O stream redirection using
00170 //                              dup() and dup2().
00171 //   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google
00172 //                              Test's own tr1 tuple implementation should be
00173 //                              used.  Unused when the user sets
00174 //                              GTEST_HAS_TR1_TUPLE to 0.
00175 //   GTEST_LANG_CXX11         - Define it to 1/0 to indicate that Google Test
00176 //                              is building in C++11/C++98 mode.
00177 //   GTEST_LINKED_AS_SHARED_LIBRARY
00178 //                            - Define to 1 when compiling tests that use
00179 //                              Google Test as a shared library (known as
00180 //                              DLL on Windows).
00181 //   GTEST_CREATE_SHARED_LIBRARY
00182 //                            - Define to 1 when compiling Google Test itself
00183 //                              as a shared library.
00184 
00185 // This header defines the following utilities:
00186 //
00187 // Macros indicating the current platform (defined to 1 if compiled on
00188 // the given platform; otherwise undefined):
00189 //   GTEST_OS_AIX      - IBM AIX
00190 //   GTEST_OS_CYGWIN   - Cygwin
00191 //   GTEST_OS_HPUX     - HP-UX
00192 //   GTEST_OS_LINUX    - Linux
00193 //     GTEST_OS_LINUX_ANDROID - Google Android
00194 //   GTEST_OS_MAC      - Mac OS X
00195 //     GTEST_OS_IOS    - iOS
00196 //       GTEST_OS_IOS_SIMULATOR - iOS simulator
00197 //   GTEST_OS_NACL     - Google Native Client (NaCl)
00198 //   GTEST_OS_OPENBSD  - OpenBSD
00199 //   GTEST_OS_QNX      - QNX
00200 //   GTEST_OS_SOLARIS  - Sun Solaris
00201 //   GTEST_OS_SYMBIAN  - Symbian
00202 //   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)
00203 //     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
00204 //     GTEST_OS_WINDOWS_MINGW    - MinGW
00205 //     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile
00206 //   GTEST_OS_ZOS      - z/OS
00207 //
00208 // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
00209 // most stable support.  Since core members of the Google Test project
00210 // don't have access to other platforms, support for them may be less
00211 // stable.  If you notice any problems on your platform, please notify
00212 // googletestframework@googlegroups.com (patches for fixing them are
00213 // even more welcome!).
00214 //
00215 // Note that it is possible that none of the GTEST_OS_* macros are defined.
00216 //
00217 // Macros indicating available Google Test features (defined to 1 if
00218 // the corresponding feature is supported; otherwise undefined):
00219 //   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized
00220 //                            tests)
00221 //   GTEST_HAS_DEATH_TEST   - death tests
00222 //   GTEST_HAS_PARAM_TEST   - value-parameterized tests
00223 //   GTEST_HAS_TYPED_TEST   - typed tests
00224 //   GTEST_HAS_TYPED_TEST_P - type-parameterized tests
00225 //   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with
00226 //                            GTEST_HAS_POSIX_RE (see above) which users can
00227 //                            define themselves.
00228 //   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
00229 //                            the above two are mutually exclusive.
00230 //   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
00231 //
00232 // Macros for basic C++ coding:
00233 //   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
00234 //   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a
00235 //                              variable don't have to be used.
00236 //   GTEST_DISALLOW_ASSIGN_   - disables operator=.
00237 //   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
00238 //   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.
00239 //
00240 // Synchronization:
00241 //   Mutex, MutexLock, ThreadLocal, GetThreadCount()
00242 //                  - synchronization primitives.
00243 //   GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
00244 //                         synchronization primitives have real implementations
00245 //                         and Google Test is thread-safe; or 0 otherwise.
00246 //
00247 // Template meta programming:
00248 //   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.
00249 //   IteratorTraits - partial implementation of std::iterator_traits, which
00250 //                    is not available in libCstd when compiled with Sun C++.
00251 //
00252 // Smart pointers:
00253 //   scoped_ptr     - as in TR2.
00254 //
00255 // Regular expressions:
00256 //   RE             - a simple regular expression class using the POSIX
00257 //                    Extended Regular Expression syntax on UNIX-like
00258 //                    platforms, or a reduced regular exception syntax on
00259 //                    other platforms, including Windows.
00260 //
00261 // Logging:
00262 //   GTEST_LOG_()   - logs messages at the specified severity level.
00263 //   LogToStderr()  - directs all log messages to stderr.
00264 //   FlushInfoLog() - flushes informational log messages.
00265 //
00266 // Stdout and stderr capturing:
00267 //   CaptureStdout()     - starts capturing stdout.
00268 //   GetCapturedStdout() - stops capturing stdout and returns the captured
00269 //                         string.
00270 //   CaptureStderr()     - starts capturing stderr.
00271 //   GetCapturedStderr() - stops capturing stderr and returns the captured
00272 //                         string.
00273 //
00274 // Integer types:
00275 //   TypeWithSize   - maps an integer to a int type.
00276 //   Int32, UInt32, Int64, UInt64, TimeInMillis
00277 //                  - integers of known sizes.
00278 //   BiggestInt     - the biggest signed integer type.
00279 //
00280 // Command-line utilities:
00281 //   GTEST_FLAG()       - references a flag.
00282 //   GTEST_DECLARE_*()  - declares a flag.
00283 //   GTEST_DEFINE_*()   - defines a flag.
00284 //   GetInjectableArgvs() - returns the command line as a vector of strings.
00285 //
00286 // Environment variable utilities:
00287 //   GetEnv()             - gets the value of an environment variable.
00288 //   BoolFromGTestEnv()   - parses a bool environment variable.
00289 //   Int32FromGTestEnv()  - parses an Int32 environment variable.
00290 //   StringFromGTestEnv() - parses a string environment variable.
00291 
00292 #include <ctype.h>   // for isspace, etc
00293 #include <stddef.h>  // for ptrdiff_t
00294 #include <stdlib.h>
00295 #include <stdio.h>
00296 #include <string.h>
00297 #ifndef _WIN32_WCE
00298 # include <sys/types.h>
00299 # include <sys/stat.h>
00300 #endif  // !_WIN32_WCE
00301 
00302 #if defined __APPLE__
00303 # include <AvailabilityMacros.h>
00304 # include <TargetConditionals.h>
00305 #endif
00306 
00307 #include <iostream>  // NOLINT
00308 #include <sstream>  // NOLINT
00309 #include <string>  // NOLINT
00310 
00311 #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
00312 #define GTEST_FLAG_PREFIX_ "gtest_"
00313 #define GTEST_FLAG_PREFIX_DASH_ "gtest-"
00314 #define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
00315 #define GTEST_NAME_ "Google Test"
00316 #define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
00317 
00318 // Determines the version of gcc that is used to compile this.
00319 #ifdef __GNUC__
00320 // 40302 means version 4.3.2.
00321 # define GTEST_GCC_VER_ \
00322     (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
00323 #endif  // __GNUC__
00324 
00325 // Determines the platform on which Google Test is compiled.
00326 #ifdef __CYGWIN__
00327 # define GTEST_OS_CYGWIN 1
00328 #elif defined __SYMBIAN32__
00329 # define GTEST_OS_SYMBIAN 1
00330 #elif defined _WIN32
00331 # define GTEST_OS_WINDOWS 1
00332 # ifdef _WIN32_WCE
00333 #  define GTEST_OS_WINDOWS_MOBILE 1
00334 # elif defined(__MINGW__) || defined(__MINGW32__)
00335 #  define GTEST_OS_WINDOWS_MINGW 1
00336 # else
00337 #  define GTEST_OS_WINDOWS_DESKTOP 1
00338 # endif  // _WIN32_WCE
00339 #elif defined __APPLE__
00340 # define GTEST_OS_MAC 1
00341 # if TARGET_OS_IPHONE
00342 #  define GTEST_OS_IOS 1
00343 #  if TARGET_IPHONE_SIMULATOR
00344 #   define GTEST_OS_IOS_SIMULATOR 1
00345 #  endif
00346 # endif
00347 #elif defined __linux__
00348 # define GTEST_OS_LINUX 1
00349 # if defined __ANDROID__
00350 #  define GTEST_OS_LINUX_ANDROID 1
00351 # endif
00352 #elif defined __MVS__
00353 # define GTEST_OS_ZOS 1
00354 #elif defined(__sun) && defined(__SVR4)
00355 # define GTEST_OS_SOLARIS 1
00356 #elif defined(_AIX)
00357 # define GTEST_OS_AIX 1
00358 #elif defined(__hpux)
00359 # define GTEST_OS_HPUX 1
00360 #elif defined __native_client__
00361 # define GTEST_OS_NACL 1
00362 #elif defined __OpenBSD__
00363 # define GTEST_OS_OPENBSD 1
00364 #elif defined __QNX__
00365 # define GTEST_OS_QNX 1
00366 #endif  // __CYGWIN__
00367 
00368 #ifndef GTEST_LANG_CXX11
00369 // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
00370 // -std={c,gnu}++{0x,11} is passed.  The C++11 standard specifies a
00371 // value for __cplusplus, and recent versions of clang, gcc, and
00372 // probably other compilers set that too in C++11 mode.
00373 # if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
00374 // Compiling in at least C++11 mode.
00375 #  define GTEST_LANG_CXX11 1
00376 # else
00377 #  define GTEST_LANG_CXX11 0
00378 # endif
00379 #endif
00380 
00381 // Brings in definitions for functions used in the testing::internal::posix
00382 // namespace (read, write, close, chdir, isatty, stat). We do not currently
00383 // use them on Windows Mobile.
00384 #if !GTEST_OS_WINDOWS
00385 // This assumes that non-Windows OSes provide unistd.h. For OSes where this
00386 // is not the case, we need to include headers that provide the functions
00387 // mentioned above.
00388 # include <unistd.h>
00389 # include <strings.h>
00390 #elif !GTEST_OS_WINDOWS_MOBILE
00391 # include <direct.h>
00392 # include <io.h>
00393 #endif
00394 
00395 #if GTEST_OS_LINUX_ANDROID
00396 // Used to define __ANDROID_API__ matching the target NDK API level.
00397 #  include <android/api-level.h>  // NOLINT
00398 #endif
00399 
00400 // Defines this to true iff Google Test can use POSIX regular expressions.
00401 #ifndef GTEST_HAS_POSIX_RE
00402 # if GTEST_OS_LINUX_ANDROID
00403 // On Android, <regex.h> is only available starting with Gingerbread.
00404 #  define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
00405 # else
00406 #  define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
00407 # endif
00408 #endif
00409 
00410 #if GTEST_HAS_POSIX_RE
00411 
00412 // On some platforms, <regex.h> needs someone to define size_t, and
00413 // won't compile otherwise.  We can #include it here as we already
00414 // included <stdlib.h>, which is guaranteed to define size_t through
00415 // <stddef.h>.
00416 # include <regex.h>  // NOLINT
00417 
00418 # define GTEST_USES_POSIX_RE 1
00419 
00420 #elif GTEST_OS_WINDOWS
00421 
00422 // <regex.h> is not available on Windows.  Use our own simple regex
00423 // implementation instead.
00424 # define GTEST_USES_SIMPLE_RE 1
00425 
00426 #else
00427 
00428 // <regex.h> may not be available on this platform.  Use our own
00429 // simple regex implementation instead.
00430 # define GTEST_USES_SIMPLE_RE 1
00431 
00432 #endif  // GTEST_HAS_POSIX_RE
00433 
00434 #ifndef GTEST_HAS_EXCEPTIONS
00435 // The user didn't tell us whether exceptions are enabled, so we need
00436 // to figure it out.
00437 # if defined(_MSC_VER) || defined(__BORLANDC__)
00438 // MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
00439 // macro to enable exceptions, so we'll do the same.
00440 // Assumes that exceptions are enabled by default.
00441 #  ifndef _HAS_EXCEPTIONS
00442 #   define _HAS_EXCEPTIONS 1
00443 #  endif  // _HAS_EXCEPTIONS
00444 #  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
00445 # elif defined(__GNUC__) && __EXCEPTIONS
00446 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
00447 #  define GTEST_HAS_EXCEPTIONS 1
00448 # elif defined(__SUNPRO_CC)
00449 // Sun Pro CC supports exceptions.  However, there is no compile-time way of
00450 // detecting whether they are enabled or not.  Therefore, we assume that
00451 // they are enabled unless the user tells us otherwise.
00452 #  define GTEST_HAS_EXCEPTIONS 1
00453 # elif defined(__IBMCPP__) && __EXCEPTIONS
00454 // xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
00455 #  define GTEST_HAS_EXCEPTIONS 1
00456 # elif defined(__HP_aCC)
00457 // Exception handling is in effect by default in HP aCC compiler. It has to
00458 // be turned of by +noeh compiler option if desired.
00459 #  define GTEST_HAS_EXCEPTIONS 1
00460 # else
00461 // For other compilers, we assume exceptions are disabled to be
00462 // conservative.
00463 #  define GTEST_HAS_EXCEPTIONS 0
00464 # endif  // defined(_MSC_VER) || defined(__BORLANDC__)
00465 #endif  // GTEST_HAS_EXCEPTIONS
00466 
00467 #if !defined(GTEST_HAS_STD_STRING)
00468 // Even though we don't use this macro any longer, we keep it in case
00469 // some clients still depend on it.
00470 # define GTEST_HAS_STD_STRING 1
00471 #elif !GTEST_HAS_STD_STRING
00472 // The user told us that ::std::string isn't available.
00473 # error "Google Test cannot be used where ::std::string isn't available."
00474 #endif  // !defined(GTEST_HAS_STD_STRING)
00475 
00476 #ifndef GTEST_HAS_GLOBAL_STRING
00477 // The user didn't tell us whether ::string is available, so we need
00478 // to figure it out.
00479 
00480 # define GTEST_HAS_GLOBAL_STRING 0
00481 
00482 #endif  // GTEST_HAS_GLOBAL_STRING
00483 
00484 #ifndef GTEST_HAS_STD_WSTRING
00485 // The user didn't tell us whether ::std::wstring is available, so we need
00486 // to figure it out.
00487 // TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
00488 //   is available.
00489 
00490 // Cygwin 1.7 and below doesn't support ::std::wstring.
00491 // Solaris' libc++ doesn't support it either.  Android has
00492 // no support for it at least as recent as Froyo (2.2).
00493 # define GTEST_HAS_STD_WSTRING \
00494     (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
00495 
00496 #endif  // GTEST_HAS_STD_WSTRING
00497 
00498 #ifndef GTEST_HAS_GLOBAL_WSTRING
00499 // The user didn't tell us whether ::wstring is available, so we need
00500 // to figure it out.
00501 # define GTEST_HAS_GLOBAL_WSTRING \
00502     (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
00503 #endif  // GTEST_HAS_GLOBAL_WSTRING
00504 
00505 // Determines whether RTTI is available.
00506 #ifndef GTEST_HAS_RTTI
00507 // The user didn't tell us whether RTTI is enabled, so we need to
00508 // figure it out.
00509 
00510 # ifdef _MSC_VER
00511 
00512 #  ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.
00513 #   define GTEST_HAS_RTTI 1
00514 #  else
00515 #   define GTEST_HAS_RTTI 0
00516 #  endif
00517 
00518 // Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
00519 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
00520 
00521 #  ifdef __GXX_RTTI
00522 // When building against STLport with the Android NDK and with
00523 // -frtti -fno-exceptions, the build fails at link time with undefined
00524 // references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
00525 // so disable RTTI when detected.
00526 #   if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
00527        !defined(__EXCEPTIONS)
00528 #    define GTEST_HAS_RTTI 0
00529 #   else
00530 #    define GTEST_HAS_RTTI 1
00531 #   endif  // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
00532 #  else
00533 #   define GTEST_HAS_RTTI 0
00534 #  endif  // __GXX_RTTI
00535 
00536 // Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
00537 // using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
00538 // first version with C++ support.
00539 # elif defined(__clang__)
00540 
00541 #  define GTEST_HAS_RTTI __has_feature(cxx_rtti)
00542 
00543 // Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
00544 // both the typeid and dynamic_cast features are present.
00545 # elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
00546 
00547 #  ifdef __RTTI_ALL__
00548 #   define GTEST_HAS_RTTI 1
00549 #  else
00550 #   define GTEST_HAS_RTTI 0
00551 #  endif
00552 
00553 # else
00554 
00555 // For all other compilers, we assume RTTI is enabled.
00556 #  define GTEST_HAS_RTTI 1
00557 
00558 # endif  // _MSC_VER
00559 
00560 #endif  // GTEST_HAS_RTTI
00561 
00562 // It's this header's responsibility to #include <typeinfo> when RTTI
00563 // is enabled.
00564 #if GTEST_HAS_RTTI
00565 # include <typeinfo>
00566 #endif
00567 
00568 // Determines whether Google Test can use the pthreads library.
00569 #ifndef GTEST_HAS_PTHREAD
00570 // The user didn't tell us explicitly, so we assume pthreads support is
00571 // available on Linux and Mac.
00572 //
00573 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
00574 // to your compiler flags.
00575 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
00576     || GTEST_OS_QNX)
00577 #endif  // GTEST_HAS_PTHREAD
00578 
00579 #if GTEST_HAS_PTHREAD
00580 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
00581 // true.
00582 # include <pthread.h>  // NOLINT
00583 
00584 // For timespec and nanosleep, used below.
00585 # include <time.h>  // NOLINT
00586 #endif
00587 
00588 // Determines whether Google Test can use tr1/tuple.  You can define
00589 // this macro to 0 to prevent Google Test from using tuple (any
00590 // feature depending on tuple with be disabled in this mode).
00591 #ifndef GTEST_HAS_TR1_TUPLE
00592 # if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
00593 // STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
00594 #  define GTEST_HAS_TR1_TUPLE 0
00595 # else
00596 // The user didn't tell us not to do it, so we assume it's OK.
00597 #  define GTEST_HAS_TR1_TUPLE 1
00598 # endif
00599 #endif  // GTEST_HAS_TR1_TUPLE
00600 
00601 // Determines whether Google Test's own tr1 tuple implementation
00602 // should be used.
00603 #ifndef GTEST_USE_OWN_TR1_TUPLE
00604 // The user didn't tell us, so we need to figure it out.
00605 
00606 // We use our own TR1 tuple if we aren't sure the user has an
00607 // implementation of it already.  At this time, libstdc++ 4.0.0+ and
00608 // MSVC 2010 are the only mainstream standard libraries that come
00609 // with a TR1 tuple implementation.  NVIDIA's CUDA NVCC compiler
00610 // pretends to be GCC by defining __GNUC__ and friends, but cannot
00611 // compile GCC's tuple implementation.  MSVC 2008 (9.0) provides TR1
00612 // tuple in a 323 MB Feature Pack download, which we cannot assume the
00613 // user has.  QNX's QCC compiler is a modified GCC but it doesn't
00614 // support TR1 tuple.  libc++ only provides std::tuple, in C++11 mode,
00615 // and it can be used with some compilers that define __GNUC__.
00616 # if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
00617       && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600
00618 #  define GTEST_ENV_HAS_TR1_TUPLE_ 1
00619 # endif
00620 
00621 // C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
00622 // in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
00623 // can build with clang but need to use gcc4.2's libstdc++).
00624 # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
00625 #  define GTEST_ENV_HAS_STD_TUPLE_ 1
00626 # endif
00627 
00628 # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
00629 #  define GTEST_USE_OWN_TR1_TUPLE 0
00630 # else
00631 #  define GTEST_USE_OWN_TR1_TUPLE 1
00632 # endif
00633 
00634 #endif  // GTEST_USE_OWN_TR1_TUPLE
00635 
00636 // To avoid conditional compilation everywhere, we make it
00637 // gtest-port.h's responsibility to #include the header implementing
00638 // tr1/tuple.
00639 #if GTEST_HAS_TR1_TUPLE
00640 
00641 # if GTEST_USE_OWN_TR1_TUPLE
00642 // This file was GENERATED by command:
00643 //     pump.py gtest-tuple.h.pump
00644 // DO NOT EDIT BY HAND!!!
00645 
00646 // Copyright 2009 Google Inc.
00647 // All Rights Reserved.
00648 //
00649 // Redistribution and use in source and binary forms, with or without
00650 // modification, are permitted provided that the following conditions are
00651 // met:
00652 //
00653 //     * Redistributions of source code must retain the above copyright
00654 // notice, this list of conditions and the following disclaimer.
00655 //     * Redistributions in binary form must reproduce the above
00656 // copyright notice, this list of conditions and the following disclaimer
00657 // in the documentation and/or other materials provided with the
00658 // distribution.
00659 //     * Neither the name of Google Inc. nor the names of its
00660 // contributors may be used to endorse or promote products derived from
00661 // this software without specific prior written permission.
00662 //
00663 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00664 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00665 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00666 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00667 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00668 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00669 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00670 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00671 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00672 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00673 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00674 //
00675 // Author: wan@google.com (Zhanyong Wan)
00676 
00677 // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
00678 
00679 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
00680 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
00681 
00682 #include <utility>  // For ::std::pair.
00683 
00684 // The compiler used in Symbian has a bug that prevents us from declaring the
00685 // tuple template as a friend (it complains that tuple is redefined).  This
00686 // hack bypasses the bug by declaring the members that should otherwise be
00687 // private as public.
00688 // Sun Studio versions < 12 also have the above bug.
00689 #if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
00690 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
00691 #else
00692 # define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
00693     template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
00694    private:
00695 #endif
00696 
00697 // GTEST_n_TUPLE_(T) is the type of an n-tuple.
00698 #define GTEST_0_TUPLE_(T) tuple<>
00699 #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
00700     void, void, void>
00701 #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
00702     void, void, void>
00703 #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
00704     void, void, void>
00705 #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
00706     void, void, void>
00707 #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
00708     void, void, void>
00709 #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
00710     void, void, void>
00711 #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
00712     void, void, void>
00713 #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
00714     T##7, void, void>
00715 #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
00716     T##7, T##8, void>
00717 #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
00718     T##7, T##8, T##9>
00719 
00720 // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
00721 #define GTEST_0_TYPENAMES_(T)
00722 #define GTEST_1_TYPENAMES_(T) typename T##0
00723 #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
00724 #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
00725 #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00726     typename T##3
00727 #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00728     typename T##3, typename T##4
00729 #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00730     typename T##3, typename T##4, typename T##5
00731 #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00732     typename T##3, typename T##4, typename T##5, typename T##6
00733 #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00734     typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
00735 #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00736     typename T##3, typename T##4, typename T##5, typename T##6, \
00737     typename T##7, typename T##8
00738 #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
00739     typename T##3, typename T##4, typename T##5, typename T##6, \
00740     typename T##7, typename T##8, typename T##9
00741 
00742 // In theory, defining stuff in the ::std namespace is undefined
00743 // behavior.  We can do this as we are playing the role of a standard
00744 // library vendor.
00745 namespace std {
00746 namespace tr1 {
00747 
00748 template <typename T0 = void, typename T1 = void, typename T2 = void,
00749     typename T3 = void, typename T4 = void, typename T5 = void,
00750     typename T6 = void, typename T7 = void, typename T8 = void,
00751     typename T9 = void>
00752 class tuple;
00753 
00754 // Anything in namespace gtest_internal is Google Test's INTERNAL
00755 // IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
00756 namespace gtest_internal {
00757 
00758 // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
00759 template <typename T>
00760 struct ByRef { typedef const T& type; };  // NOLINT
00761 template <typename T>
00762 struct ByRef<T&> { typedef T& type; };  // NOLINT
00763 
00764 // A handy wrapper for ByRef.
00765 #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
00766 
00767 // AddRef<T>::type is T if T is a reference; otherwise it's T&.  This
00768 // is the same as tr1::add_reference<T>::type.
00769 template <typename T>
00770 struct AddRef { typedef T& type; };  // NOLINT
00771 template <typename T>
00772 struct AddRef<T&> { typedef T& type; };  // NOLINT
00773 
00774 // A handy wrapper for AddRef.
00775 #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
00776 
00777 // A helper for implementing get<k>().
00778 template <int k> class Get;
00779 
00780 // A helper for implementing tuple_element<k, T>.  kIndexValid is true
00781 // iff k < the number of fields in tuple type T.
00782 template <bool kIndexValid, int kIndex, class Tuple>
00783 struct TupleElement;
00784 
00785 template <GTEST_10_TYPENAMES_(T)>
00786 struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
00787   typedef T0 type;
00788 };
00789 
00790 template <GTEST_10_TYPENAMES_(T)>
00791 struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
00792   typedef T1 type;
00793 };
00794 
00795 template <GTEST_10_TYPENAMES_(T)>
00796 struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
00797   typedef T2 type;
00798 };
00799 
00800 template <GTEST_10_TYPENAMES_(T)>
00801 struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
00802   typedef T3 type;
00803 };
00804 
00805 template <GTEST_10_TYPENAMES_(T)>
00806 struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
00807   typedef T4 type;
00808 };
00809 
00810 template <GTEST_10_TYPENAMES_(T)>
00811 struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
00812   typedef T5 type;
00813 };
00814 
00815 template <GTEST_10_TYPENAMES_(T)>
00816 struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
00817   typedef T6 type;
00818 };
00819 
00820 template <GTEST_10_TYPENAMES_(T)>
00821 struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
00822   typedef T7 type;
00823 };
00824 
00825 template <GTEST_10_TYPENAMES_(T)>
00826 struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
00827   typedef T8 type;
00828 };
00829 
00830 template <GTEST_10_TYPENAMES_(T)>
00831 struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
00832   typedef T9 type;
00833 };
00834 
00835 }  // namespace gtest_internal
00836 
00837 template <>
00838 class tuple<> {
00839  public:
00840   tuple() {}
00841   tuple(const tuple& /* t */)  {}
00842   tuple& operator=(const tuple& /* t */) { return *this; }
00843 };
00844 
00845 template <GTEST_1_TYPENAMES_(T)>
00846 class GTEST_1_TUPLE_(T) {
00847  public:
00848   template <int k> friend class gtest_internal::Get;
00849 
00850   tuple() : f0_() {}
00851 
00852   explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
00853 
00854   tuple(const tuple& t) : f0_(t.f0_) {}
00855 
00856   template <GTEST_1_TYPENAMES_(U)>
00857   tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
00858 
00859   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00860 
00861   template <GTEST_1_TYPENAMES_(U)>
00862   tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
00863     return CopyFrom(t);
00864   }
00865 
00866   GTEST_DECLARE_TUPLE_AS_FRIEND_
00867 
00868   template <GTEST_1_TYPENAMES_(U)>
00869   tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
00870     f0_ = t.f0_;
00871     return *this;
00872   }
00873 
00874   T0 f0_;
00875 };
00876 
00877 template <GTEST_2_TYPENAMES_(T)>
00878 class GTEST_2_TUPLE_(T) {
00879  public:
00880   template <int k> friend class gtest_internal::Get;
00881 
00882   tuple() : f0_(), f1_() {}
00883 
00884   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
00885       f1_(f1) {}
00886 
00887   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
00888 
00889   template <GTEST_2_TYPENAMES_(U)>
00890   tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
00891   template <typename U0, typename U1>
00892   tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
00893 
00894   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00895 
00896   template <GTEST_2_TYPENAMES_(U)>
00897   tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
00898     return CopyFrom(t);
00899   }
00900   template <typename U0, typename U1>
00901   tuple& operator=(const ::std::pair<U0, U1>& p) {
00902     f0_ = p.first;
00903     f1_ = p.second;
00904     return *this;
00905   }
00906 
00907   GTEST_DECLARE_TUPLE_AS_FRIEND_
00908 
00909   template <GTEST_2_TYPENAMES_(U)>
00910   tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
00911     f0_ = t.f0_;
00912     f1_ = t.f1_;
00913     return *this;
00914   }
00915 
00916   T0 f0_;
00917   T1 f1_;
00918 };
00919 
00920 template <GTEST_3_TYPENAMES_(T)>
00921 class GTEST_3_TUPLE_(T) {
00922  public:
00923   template <int k> friend class gtest_internal::Get;
00924 
00925   tuple() : f0_(), f1_(), f2_() {}
00926 
00927   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
00928       GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
00929 
00930   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
00931 
00932   template <GTEST_3_TYPENAMES_(U)>
00933   tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
00934 
00935   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00936 
00937   template <GTEST_3_TYPENAMES_(U)>
00938   tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
00939     return CopyFrom(t);
00940   }
00941 
00942   GTEST_DECLARE_TUPLE_AS_FRIEND_
00943 
00944   template <GTEST_3_TYPENAMES_(U)>
00945   tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
00946     f0_ = t.f0_;
00947     f1_ = t.f1_;
00948     f2_ = t.f2_;
00949     return *this;
00950   }
00951 
00952   T0 f0_;
00953   T1 f1_;
00954   T2 f2_;
00955 };
00956 
00957 template <GTEST_4_TYPENAMES_(T)>
00958 class GTEST_4_TUPLE_(T) {
00959  public:
00960   template <int k> friend class gtest_internal::Get;
00961 
00962   tuple() : f0_(), f1_(), f2_(), f3_() {}
00963 
00964   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
00965       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
00966       f3_(f3) {}
00967 
00968   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
00969 
00970   template <GTEST_4_TYPENAMES_(U)>
00971   tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
00972       f3_(t.f3_) {}
00973 
00974   tuple& operator=(const tuple& t) { return CopyFrom(t); }
00975 
00976   template <GTEST_4_TYPENAMES_(U)>
00977   tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
00978     return CopyFrom(t);
00979   }
00980 
00981   GTEST_DECLARE_TUPLE_AS_FRIEND_
00982 
00983   template <GTEST_4_TYPENAMES_(U)>
00984   tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
00985     f0_ = t.f0_;
00986     f1_ = t.f1_;
00987     f2_ = t.f2_;
00988     f3_ = t.f3_;
00989     return *this;
00990   }
00991 
00992   T0 f0_;
00993   T1 f1_;
00994   T2 f2_;
00995   T3 f3_;
00996 };
00997 
00998 template <GTEST_5_TYPENAMES_(T)>
00999 class GTEST_5_TUPLE_(T) {
01000  public:
01001   template <int k> friend class gtest_internal::Get;
01002 
01003   tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
01004 
01005   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01006       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
01007       GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
01008 
01009   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01010       f4_(t.f4_) {}
01011 
01012   template <GTEST_5_TYPENAMES_(U)>
01013   tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01014       f3_(t.f3_), f4_(t.f4_) {}
01015 
01016   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01017 
01018   template <GTEST_5_TYPENAMES_(U)>
01019   tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
01020     return CopyFrom(t);
01021   }
01022 
01023   GTEST_DECLARE_TUPLE_AS_FRIEND_
01024 
01025   template <GTEST_5_TYPENAMES_(U)>
01026   tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
01027     f0_ = t.f0_;
01028     f1_ = t.f1_;
01029     f2_ = t.f2_;
01030     f3_ = t.f3_;
01031     f4_ = t.f4_;
01032     return *this;
01033   }
01034 
01035   T0 f0_;
01036   T1 f1_;
01037   T2 f2_;
01038   T3 f3_;
01039   T4 f4_;
01040 };
01041 
01042 template <GTEST_6_TYPENAMES_(T)>
01043 class GTEST_6_TUPLE_(T) {
01044  public:
01045   template <int k> friend class gtest_internal::Get;
01046 
01047   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
01048 
01049   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01050       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01051       GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
01052       f5_(f5) {}
01053 
01054   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01055       f4_(t.f4_), f5_(t.f5_) {}
01056 
01057   template <GTEST_6_TYPENAMES_(U)>
01058   tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01059       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
01060 
01061   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01062 
01063   template <GTEST_6_TYPENAMES_(U)>
01064   tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
01065     return CopyFrom(t);
01066   }
01067 
01068   GTEST_DECLARE_TUPLE_AS_FRIEND_
01069 
01070   template <GTEST_6_TYPENAMES_(U)>
01071   tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
01072     f0_ = t.f0_;
01073     f1_ = t.f1_;
01074     f2_ = t.f2_;
01075     f3_ = t.f3_;
01076     f4_ = t.f4_;
01077     f5_ = t.f5_;
01078     return *this;
01079   }
01080 
01081   T0 f0_;
01082   T1 f1_;
01083   T2 f2_;
01084   T3 f3_;
01085   T4 f4_;
01086   T5 f5_;
01087 };
01088 
01089 template <GTEST_7_TYPENAMES_(T)>
01090 class GTEST_7_TUPLE_(T) {
01091  public:
01092   template <int k> friend class gtest_internal::Get;
01093 
01094   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
01095 
01096   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01097       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01098       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
01099       f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
01100 
01101   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01102       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
01103 
01104   template <GTEST_7_TYPENAMES_(U)>
01105   tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01106       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
01107 
01108   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01109 
01110   template <GTEST_7_TYPENAMES_(U)>
01111   tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
01112     return CopyFrom(t);
01113   }
01114 
01115   GTEST_DECLARE_TUPLE_AS_FRIEND_
01116 
01117   template <GTEST_7_TYPENAMES_(U)>
01118   tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
01119     f0_ = t.f0_;
01120     f1_ = t.f1_;
01121     f2_ = t.f2_;
01122     f3_ = t.f3_;
01123     f4_ = t.f4_;
01124     f5_ = t.f5_;
01125     f6_ = t.f6_;
01126     return *this;
01127   }
01128 
01129   T0 f0_;
01130   T1 f1_;
01131   T2 f2_;
01132   T3 f3_;
01133   T4 f4_;
01134   T5 f5_;
01135   T6 f6_;
01136 };
01137 
01138 template <GTEST_8_TYPENAMES_(T)>
01139 class GTEST_8_TUPLE_(T) {
01140  public:
01141   template <int k> friend class gtest_internal::Get;
01142 
01143   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
01144 
01145   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01146       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01147       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
01148       GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
01149       f5_(f5), f6_(f6), f7_(f7) {}
01150 
01151   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01152       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
01153 
01154   template <GTEST_8_TYPENAMES_(U)>
01155   tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01156       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
01157 
01158   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01159 
01160   template <GTEST_8_TYPENAMES_(U)>
01161   tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
01162     return CopyFrom(t);
01163   }
01164 
01165   GTEST_DECLARE_TUPLE_AS_FRIEND_
01166 
01167   template <GTEST_8_TYPENAMES_(U)>
01168   tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
01169     f0_ = t.f0_;
01170     f1_ = t.f1_;
01171     f2_ = t.f2_;
01172     f3_ = t.f3_;
01173     f4_ = t.f4_;
01174     f5_ = t.f5_;
01175     f6_ = t.f6_;
01176     f7_ = t.f7_;
01177     return *this;
01178   }
01179 
01180   T0 f0_;
01181   T1 f1_;
01182   T2 f2_;
01183   T3 f3_;
01184   T4 f4_;
01185   T5 f5_;
01186   T6 f6_;
01187   T7 f7_;
01188 };
01189 
01190 template <GTEST_9_TYPENAMES_(T)>
01191 class GTEST_9_TUPLE_(T) {
01192  public:
01193   template <int k> friend class gtest_internal::Get;
01194 
01195   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
01196 
01197   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01198       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01199       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
01200       GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
01201       f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
01202 
01203   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01204       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
01205 
01206   template <GTEST_9_TYPENAMES_(U)>
01207   tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01208       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
01209 
01210   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01211 
01212   template <GTEST_9_TYPENAMES_(U)>
01213   tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
01214     return CopyFrom(t);
01215   }
01216 
01217   GTEST_DECLARE_TUPLE_AS_FRIEND_
01218 
01219   template <GTEST_9_TYPENAMES_(U)>
01220   tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
01221     f0_ = t.f0_;
01222     f1_ = t.f1_;
01223     f2_ = t.f2_;
01224     f3_ = t.f3_;
01225     f4_ = t.f4_;
01226     f5_ = t.f5_;
01227     f6_ = t.f6_;
01228     f7_ = t.f7_;
01229     f8_ = t.f8_;
01230     return *this;
01231   }
01232 
01233   T0 f0_;
01234   T1 f1_;
01235   T2 f2_;
01236   T3 f3_;
01237   T4 f4_;
01238   T5 f5_;
01239   T6 f6_;
01240   T7 f7_;
01241   T8 f8_;
01242 };
01243 
01244 template <GTEST_10_TYPENAMES_(T)>
01245 class tuple {
01246  public:
01247   template <int k> friend class gtest_internal::Get;
01248 
01249   tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
01250       f9_() {}
01251 
01252   explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
01253       GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
01254       GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
01255       GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
01256       f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
01257 
01258   tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
01259       f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
01260 
01261   template <GTEST_10_TYPENAMES_(U)>
01262   tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
01263       f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
01264       f9_(t.f9_) {}
01265 
01266   tuple& operator=(const tuple& t) { return CopyFrom(t); }
01267 
01268   template <GTEST_10_TYPENAMES_(U)>
01269   tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
01270     return CopyFrom(t);
01271   }
01272 
01273   GTEST_DECLARE_TUPLE_AS_FRIEND_
01274 
01275   template <GTEST_10_TYPENAMES_(U)>
01276   tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
01277     f0_ = t.f0_;
01278     f1_ = t.f1_;
01279     f2_ = t.f2_;
01280     f3_ = t.f3_;
01281     f4_ = t.f4_;
01282     f5_ = t.f5_;
01283     f6_ = t.f6_;
01284     f7_ = t.f7_;
01285     f8_ = t.f8_;
01286     f9_ = t.f9_;
01287     return *this;
01288   }
01289 
01290   T0 f0_;
01291   T1 f1_;
01292   T2 f2_;
01293   T3 f3_;
01294   T4 f4_;
01295   T5 f5_;
01296   T6 f6_;
01297   T7 f7_;
01298   T8 f8_;
01299   T9 f9_;
01300 };
01301 
01302 // 6.1.3.2 Tuple creation functions.
01303 
01304 // Known limitations: we don't support passing an
01305 // std::tr1::reference_wrapper<T> to make_tuple().  And we don't
01306 // implement tie().
01307 
01308 inline tuple<> make_tuple() { return tuple<>(); }
01309 
01310 template <GTEST_1_TYPENAMES_(T)>
01311 inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
01312   return GTEST_1_TUPLE_(T)(f0);
01313 }
01314 
01315 template <GTEST_2_TYPENAMES_(T)>
01316 inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
01317   return GTEST_2_TUPLE_(T)(f0, f1);
01318 }
01319 
01320 template <GTEST_3_TYPENAMES_(T)>
01321 inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
01322   return GTEST_3_TUPLE_(T)(f0, f1, f2);
01323 }
01324 
01325 template <GTEST_4_TYPENAMES_(T)>
01326 inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01327     const T3& f3) {
01328   return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
01329 }
01330 
01331 template <GTEST_5_TYPENAMES_(T)>
01332 inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01333     const T3& f3, const T4& f4) {
01334   return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
01335 }
01336 
01337 template <GTEST_6_TYPENAMES_(T)>
01338 inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01339     const T3& f3, const T4& f4, const T5& f5) {
01340   return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
01341 }
01342 
01343 template <GTEST_7_TYPENAMES_(T)>
01344 inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01345     const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
01346   return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
01347 }
01348 
01349 template <GTEST_8_TYPENAMES_(T)>
01350 inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01351     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
01352   return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
01353 }
01354 
01355 template <GTEST_9_TYPENAMES_(T)>
01356 inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01357     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
01358     const T8& f8) {
01359   return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
01360 }
01361 
01362 template <GTEST_10_TYPENAMES_(T)>
01363 inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
01364     const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
01365     const T8& f8, const T9& f9) {
01366   return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
01367 }
01368 
01369 // 6.1.3.3 Tuple helper classes.
01370 
01371 template <typename Tuple> struct tuple_size;
01372 
01373 template <GTEST_0_TYPENAMES_(T)>
01374 struct tuple_size<GTEST_0_TUPLE_(T) > {
01375   static const int value = 0;
01376 };
01377 
01378 template <GTEST_1_TYPENAMES_(T)>
01379 struct tuple_size<GTEST_1_TUPLE_(T) > {
01380   static const int value = 1;
01381 };
01382 
01383 template <GTEST_2_TYPENAMES_(T)>
01384 struct tuple_size<GTEST_2_TUPLE_(T) > {
01385   static const int value = 2;
01386 };
01387 
01388 template <GTEST_3_TYPENAMES_(T)>
01389 struct tuple_size<GTEST_3_TUPLE_(T) > {
01390   static const int value = 3;
01391 };
01392 
01393 template <GTEST_4_TYPENAMES_(T)>
01394 struct tuple_size<GTEST_4_TUPLE_(T) > {
01395   static const int value = 4;
01396 };
01397 
01398 template <GTEST_5_TYPENAMES_(T)>
01399 struct tuple_size<GTEST_5_TUPLE_(T) > {
01400   static const int value = 5;
01401 };
01402 
01403 template <GTEST_6_TYPENAMES_(T)>
01404 struct tuple_size<GTEST_6_TUPLE_(T) > {
01405   static const int value = 6;
01406 };
01407 
01408 template <GTEST_7_TYPENAMES_(T)>
01409 struct tuple_size<GTEST_7_TUPLE_(T) > {
01410   static const int value = 7;
01411 };
01412 
01413 template <GTEST_8_TYPENAMES_(T)>
01414 struct tuple_size<GTEST_8_TUPLE_(T) > {
01415   static const int value = 8;
01416 };
01417 
01418 template <GTEST_9_TYPENAMES_(T)>
01419 struct tuple_size<GTEST_9_TUPLE_(T) > {
01420   static const int value = 9;
01421 };
01422 
01423 template <GTEST_10_TYPENAMES_(T)>
01424 struct tuple_size<GTEST_10_TUPLE_(T) > {
01425   static const int value = 10;
01426 };
01427 
01428 template <int k, class Tuple>
01429 struct tuple_element {
01430   typedef typename gtest_internal::TupleElement<
01431       k < (tuple_size<Tuple>::value), k, Tuple>::type type;
01432 };
01433 
01434 #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
01435 
01436 // 6.1.3.4 Element access.
01437 
01438 namespace gtest_internal {
01439 
01440 template <>
01441 class Get<0> {
01442  public:
01443   template <class Tuple>
01444   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
01445   Field(Tuple& t) { return t.f0_; }  // NOLINT
01446 
01447   template <class Tuple>
01448   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
01449   ConstField(const Tuple& t) { return t.f0_; }
01450 };
01451 
01452 template <>
01453 class Get<1> {
01454  public:
01455   template <class Tuple>
01456   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
01457   Field(Tuple& t) { return t.f1_; }  // NOLINT
01458 
01459   template <class Tuple>
01460   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
01461   ConstField(const Tuple& t) { return t.f1_; }
01462 };
01463 
01464 template <>
01465 class Get<2> {
01466  public:
01467   template <class Tuple>
01468   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
01469   Field(Tuple& t) { return t.f2_; }  // NOLINT
01470 
01471   template <class Tuple>
01472   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
01473   ConstField(const Tuple& t) { return t.f2_; }
01474 };
01475 
01476 template <>
01477 class Get<3> {
01478  public:
01479   template <class Tuple>
01480   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
01481   Field(Tuple& t) { return t.f3_; }  // NOLINT
01482 
01483   template <class Tuple>
01484   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
01485   ConstField(const Tuple& t) { return t.f3_; }
01486 };
01487 
01488 template <>
01489 class Get<4> {
01490  public:
01491   template <class Tuple>
01492   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
01493   Field(Tuple& t) { return t.f4_; }  // NOLINT
01494 
01495   template <class Tuple>
01496   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
01497   ConstField(const Tuple& t) { return t.f4_; }
01498 };
01499 
01500 template <>
01501 class Get<5> {
01502  public:
01503   template <class Tuple>
01504   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
01505   Field(Tuple& t) { return t.f5_; }  // NOLINT
01506 
01507   template <class Tuple>
01508   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
01509   ConstField(const Tuple& t) { return t.f5_; }
01510 };
01511 
01512 template <>
01513 class Get<6> {
01514  public:
01515   template <class Tuple>
01516   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
01517   Field(Tuple& t) { return t.f6_; }  // NOLINT
01518 
01519   template <class Tuple>
01520   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
01521   ConstField(const Tuple& t) { return t.f6_; }
01522 };
01523 
01524 template <>
01525 class Get<7> {
01526  public:
01527   template <class Tuple>
01528   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
01529   Field(Tuple& t) { return t.f7_; }  // NOLINT
01530 
01531   template <class Tuple>
01532   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
01533   ConstField(const Tuple& t) { return t.f7_; }
01534 };
01535 
01536 template <>
01537 class Get<8> {
01538  public:
01539   template <class Tuple>
01540   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
01541   Field(Tuple& t) { return t.f8_; }  // NOLINT
01542 
01543   template <class Tuple>
01544   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
01545   ConstField(const Tuple& t) { return t.f8_; }
01546 };
01547 
01548 template <>
01549 class Get<9> {
01550  public:
01551   template <class Tuple>
01552   static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
01553   Field(Tuple& t) { return t.f9_; }  // NOLINT
01554 
01555   template <class Tuple>
01556   static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
01557   ConstField(const Tuple& t) { return t.f9_; }
01558 };
01559 
01560 }  // namespace gtest_internal
01561 
01562 template <int k, GTEST_10_TYPENAMES_(T)>
01563 GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
01564 get(GTEST_10_TUPLE_(T)& t) {
01565   return gtest_internal::Get<k>::Field(t);
01566 }
01567 
01568 template <int k, GTEST_10_TYPENAMES_(T)>
01569 GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))
01570 get(const GTEST_10_TUPLE_(T)& t) {
01571   return gtest_internal::Get<k>::ConstField(t);
01572 }
01573 
01574 // 6.1.3.5 Relational operators
01575 
01576 // We only implement == and !=, as we don't have a need for the rest yet.
01577 
01578 namespace gtest_internal {
01579 
01580 // SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
01581 // first k fields of t1 equals the first k fields of t2.
01582 // SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
01583 // k1 != k2.
01584 template <int kSize1, int kSize2>
01585 struct SameSizeTuplePrefixComparator;
01586 
01587 template <>
01588 struct SameSizeTuplePrefixComparator<0, 0> {
01589   template <class Tuple1, class Tuple2>
01590   static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
01591     return true;
01592   }
01593 };
01594 
01595 template <int k>
01596 struct SameSizeTuplePrefixComparator<k, k> {
01597   template <class Tuple1, class Tuple2>
01598   static bool Eq(const Tuple1& t1, const Tuple2& t2) {
01599     return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
01600         ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
01601   }
01602 };
01603 
01604 }  // namespace gtest_internal
01605 
01606 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
01607 inline bool operator==(const GTEST_10_TUPLE_(T)& t,
01608                        const GTEST_10_TUPLE_(U)& u) {
01609   return gtest_internal::SameSizeTuplePrefixComparator<
01610       tuple_size<GTEST_10_TUPLE_(T) >::value,
01611       tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
01612 }
01613 
01614 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
01615 inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
01616                        const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
01617 
01618 // 6.1.4 Pairs.
01619 // Unimplemented.
01620 
01621 }  // namespace tr1
01622 }  // namespace std
01623 
01624 #undef GTEST_0_TUPLE_
01625 #undef GTEST_1_TUPLE_
01626 #undef GTEST_2_TUPLE_
01627 #undef GTEST_3_TUPLE_
01628 #undef GTEST_4_TUPLE_
01629 #undef GTEST_5_TUPLE_
01630 #undef GTEST_6_TUPLE_
01631 #undef GTEST_7_TUPLE_
01632 #undef GTEST_8_TUPLE_
01633 #undef GTEST_9_TUPLE_
01634 #undef GTEST_10_TUPLE_
01635 
01636 #undef GTEST_0_TYPENAMES_
01637 #undef GTEST_1_TYPENAMES_
01638 #undef GTEST_2_TYPENAMES_
01639 #undef GTEST_3_TYPENAMES_
01640 #undef GTEST_4_TYPENAMES_
01641 #undef GTEST_5_TYPENAMES_
01642 #undef GTEST_6_TYPENAMES_
01643 #undef GTEST_7_TYPENAMES_
01644 #undef GTEST_8_TYPENAMES_
01645 #undef GTEST_9_TYPENAMES_
01646 #undef GTEST_10_TYPENAMES_
01647 
01648 #undef GTEST_DECLARE_TUPLE_AS_FRIEND_
01649 #undef GTEST_BY_REF_
01650 #undef GTEST_ADD_REF_
01651 #undef GTEST_TUPLE_ELEMENT_
01652 
01653 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
01654 # elif GTEST_ENV_HAS_STD_TUPLE_
01655 #  include <tuple>
01656 // C++11 puts its tuple into the ::std namespace rather than
01657 // ::std::tr1.  gtest expects tuple to live in ::std::tr1, so put it there.
01658 // This causes undefined behavior, but supported compilers react in
01659 // the way we intend.
01660 namespace std {
01661 namespace tr1 {
01662 using ::std::get;
01663 using ::std::make_tuple;
01664 using ::std::tuple;
01665 using ::std::tuple_element;
01666 using ::std::tuple_size;
01667 }
01668 }
01669 
01670 # elif GTEST_OS_SYMBIAN
01671 
01672 // On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
01673 // use STLport's tuple implementation, which unfortunately doesn't
01674 // work as the copy of STLport distributed with Symbian is incomplete.
01675 // By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
01676 // use its own tuple implementation.
01677 #  ifdef BOOST_HAS_TR1_TUPLE
01678 #   undef BOOST_HAS_TR1_TUPLE
01679 #  endif  // BOOST_HAS_TR1_TUPLE
01680 
01681 // This prevents <boost/tr1/detail/config.hpp>, which defines
01682 // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
01683 #  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
01684 #  include <tuple>
01685 
01686 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
01687 // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does
01688 // not conform to the TR1 spec, which requires the header to be <tuple>.
01689 
01690 #  if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
01691 // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
01692 // which is #included by <tr1/tuple>, to not compile when RTTI is
01693 // disabled.  _TR1_FUNCTIONAL is the header guard for
01694 // <tr1/functional>.  Hence the following #define is a hack to prevent
01695 // <tr1/functional> from being included.
01696 #   define _TR1_FUNCTIONAL 1
01697 #   include <tr1/tuple>
01698 #   undef _TR1_FUNCTIONAL  // Allows the user to #include
01699                         // <tr1/functional> if he chooses to.
01700 #  else
01701 #   include <tr1/tuple>  // NOLINT
01702 #  endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
01703 
01704 # else
01705 // If the compiler is not GCC 4.0+, we assume the user is using a
01706 // spec-conforming TR1 implementation.
01707 #  include <tuple>  // NOLINT
01708 # endif  // GTEST_USE_OWN_TR1_TUPLE
01709 
01710 #endif  // GTEST_HAS_TR1_TUPLE
01711 
01712 // Determines whether clone(2) is supported.
01713 // Usually it will only be available on Linux, excluding
01714 // Linux on the Itanium architecture.
01715 // Also see http://linux.die.net/man/2/clone.
01716 #ifndef GTEST_HAS_CLONE
01717 // The user didn't tell us, so we need to figure it out.
01718 
01719 # if GTEST_OS_LINUX && !defined(__ia64__)
01720 #  if GTEST_OS_LINUX_ANDROID
01721 // On Android, clone() is only available on ARM starting with Gingerbread.
01722 #    if defined(__arm__) && __ANDROID_API__ >= 9
01723 #     define GTEST_HAS_CLONE 1
01724 #    else
01725 #     define GTEST_HAS_CLONE 0
01726 #    endif
01727 #  else
01728 #   define GTEST_HAS_CLONE 1
01729 #  endif
01730 # else
01731 #  define GTEST_HAS_CLONE 0
01732 # endif  // GTEST_OS_LINUX && !defined(__ia64__)
01733 
01734 #endif  // GTEST_HAS_CLONE
01735 
01736 // Determines whether to support stream redirection. This is used to test
01737 // output correctness and to implement death tests.
01738 #ifndef GTEST_HAS_STREAM_REDIRECTION
01739 // By default, we assume that stream redirection is supported on all
01740 // platforms except known mobile ones.
01741 # if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
01742 #  define GTEST_HAS_STREAM_REDIRECTION 0
01743 # else
01744 #  define GTEST_HAS_STREAM_REDIRECTION 1
01745 # endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
01746 #endif  // GTEST_HAS_STREAM_REDIRECTION
01747 
01748 // Determines whether to support death tests.
01749 // Google Test does not support death tests for VC 7.1 and earlier as
01750 // abort() in a VC 7.1 application compiled as GUI in debug config
01751 // pops up a dialog window that cannot be suppressed programmatically.
01752 #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
01753      (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \
01754      (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
01755      GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
01756      GTEST_OS_OPENBSD || GTEST_OS_QNX)
01757 # define GTEST_HAS_DEATH_TEST 1
01758 # include <vector>  // NOLINT
01759 #endif
01760 
01761 // We don't support MSVC 7.1 with exceptions disabled now.  Therefore
01762 // all the compilers we care about are adequate for supporting
01763 // value-parameterized tests.
01764 #define GTEST_HAS_PARAM_TEST 1
01765 
01766 // Determines whether to support type-driven tests.
01767 
01768 // Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
01769 // Sun Pro CC, IBM Visual Age, and HP aCC support.
01770 #if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
01771     defined(__IBMCPP__) || defined(__HP_aCC)
01772 # define GTEST_HAS_TYPED_TEST 1
01773 # define GTEST_HAS_TYPED_TEST_P 1
01774 #endif
01775 
01776 // Determines whether to support Combine(). This only makes sense when
01777 // value-parameterized tests are enabled.  The implementation doesn't
01778 // work on Sun Studio since it doesn't understand templated conversion
01779 // operators.
01780 #if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
01781 # define GTEST_HAS_COMBINE 1
01782 #endif
01783 
01784 // Determines whether the system compiler uses UTF-16 for encoding wide strings.
01785 #define GTEST_WIDE_STRING_USES_UTF16_ \
01786     (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
01787 
01788 // Determines whether test results can be streamed to a socket.
01789 #if GTEST_OS_LINUX
01790 # define GTEST_CAN_STREAM_RESULTS_ 1
01791 #endif
01792 
01793 // Defines some utility macros.
01794 
01795 // The GNU compiler emits a warning if nested "if" statements are followed by
01796 // an "else" statement and braces are not used to explicitly disambiguate the
01797 // "else" binding.  This leads to problems with code like:
01798 //
01799 //   if (gate)
01800 //     ASSERT_*(condition) << "Some message";
01801 //
01802 // The "switch (0) case 0:" idiom is used to suppress this.
01803 #ifdef __INTEL_COMPILER
01804 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_
01805 #else
01806 # define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default:  // NOLINT
01807 #endif
01808 
01809 // Use this annotation at the end of a struct/class definition to
01810 // prevent the compiler from optimizing away instances that are never
01811 // used.  This is useful when all interesting logic happens inside the
01812 // c'tor and / or d'tor.  Example:
01813 //
01814 //   struct Foo {
01815 //     Foo() { ... }
01816 //   } GTEST_ATTRIBUTE_UNUSED_;
01817 //
01818 // Also use it after a variable or parameter declaration to tell the
01819 // compiler the variable/parameter does not have to be used.
01820 #if defined(__GNUC__) && !defined(COMPILER_ICC)
01821 # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
01822 #else
01823 # define GTEST_ATTRIBUTE_UNUSED_
01824 #endif
01825 
01826 // A macro to disallow operator=
01827 // This should be used in the private: declarations for a class.
01828 #define GTEST_DISALLOW_ASSIGN_(type)\
01829   void operator=(type const &)
01830 
01831 // A macro to disallow copy constructor and operator=
01832 // This should be used in the private: declarations for a class.
01833 #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
01834   type(type const &);\
01835   GTEST_DISALLOW_ASSIGN_(type)
01836 
01837 // Tell the compiler to warn about unused return values for functions declared
01838 // with this macro.  The macro should be used on function declarations
01839 // following the argument list:
01840 //
01841 //   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
01842 #if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
01843 # define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
01844 #else
01845 # define GTEST_MUST_USE_RESULT_
01846 #endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
01847 
01848 // Determine whether the compiler supports Microsoft's Structured Exception
01849 // Handling.  This is supported by several Windows compilers but generally
01850 // does not exist on any other system.
01851 #ifndef GTEST_HAS_SEH
01852 // The user didn't tell us, so we need to figure it out.
01853 
01854 # if defined(_MSC_VER) || defined(__BORLANDC__)
01855 // These two compilers are known to support SEH.
01856 #  define GTEST_HAS_SEH 1
01857 # else
01858 // Assume no SEH.
01859 #  define GTEST_HAS_SEH 0
01860 # endif
01861 
01862 #endif  // GTEST_HAS_SEH
01863 
01864 #ifdef _MSC_VER
01865 
01866 # if GTEST_LINKED_AS_SHARED_LIBRARY
01867 #  define GTEST_API_ __declspec(dllimport)
01868 # elif GTEST_CREATE_SHARED_LIBRARY
01869 #  define GTEST_API_ __declspec(dllexport)
01870 # endif
01871 
01872 #endif  // _MSC_VER
01873 
01874 #ifndef GTEST_API_
01875 # define GTEST_API_
01876 #endif
01877 
01878 #ifdef __GNUC__
01879 // Ask the compiler to never inline a given function.
01880 # define GTEST_NO_INLINE_ __attribute__((noinline))
01881 #else
01882 # define GTEST_NO_INLINE_
01883 #endif
01884 
01885 // _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
01886 #if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
01887 # define GTEST_HAS_CXXABI_H_ 1
01888 #else
01889 # define GTEST_HAS_CXXABI_H_ 0
01890 #endif
01891 
01892 namespace testing {
01893 
01894 class Message;
01895 
01896 namespace internal {
01897 
01898 // A secret type that Google Test users don't know about.  It has no
01899 // definition on purpose.  Therefore it's impossible to create a
01900 // Secret object, which is what we want.
01901 class Secret;
01902 
01903 // The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
01904 // expression is true. For example, you could use it to verify the
01905 // size of a static array:
01906 //
01907 //   GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
01908 //                         content_type_names_incorrect_size);
01909 //
01910 // or to make sure a struct is smaller than a certain size:
01911 //
01912 //   GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
01913 //
01914 // The second argument to the macro is the name of the variable. If
01915 // the expression is false, most compilers will issue a warning/error
01916 // containing the name of the variable.
01917 
01918 template <bool>
01919 struct CompileAssert {
01920 };
01921 
01922 #define GTEST_COMPILE_ASSERT_(expr, msg) \
01923   typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
01924       msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
01925 
01926 // Implementation details of GTEST_COMPILE_ASSERT_:
01927 //
01928 // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
01929 //   elements (and thus is invalid) when the expression is false.
01930 //
01931 // - The simpler definition
01932 //
01933 //    #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
01934 //
01935 //   does not work, as gcc supports variable-length arrays whose sizes
01936 //   are determined at run-time (this is gcc's extension and not part
01937 //   of the C++ standard).  As a result, gcc fails to reject the
01938 //   following code with the simple definition:
01939 //
01940 //     int foo;
01941 //     GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
01942 //                                      // not a compile-time constant.
01943 //
01944 // - By using the type CompileAssert<(bool(expr))>, we ensures that
01945 //   expr is a compile-time constant.  (Template arguments must be
01946 //   determined at compile-time.)
01947 //
01948 // - The outter parentheses in CompileAssert<(bool(expr))> are necessary
01949 //   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written
01950 //
01951 //     CompileAssert<bool(expr)>
01952 //
01953 //   instead, these compilers will refuse to compile
01954 //
01955 //     GTEST_COMPILE_ASSERT_(5 > 0, some_message);
01956 //
01957 //   (They seem to think the ">" in "5 > 0" marks the end of the
01958 //   template argument list.)
01959 //
01960 // - The array size is (bool(expr) ? 1 : -1), instead of simply
01961 //
01962 //     ((expr) ? 1 : -1).
01963 //
01964 //   This is to avoid running into a bug in MS VC 7.1, which
01965 //   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
01966 
01967 // StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
01968 //
01969 // This template is declared, but intentionally undefined.
01970 template <typename T1, typename T2>
01971 struct StaticAssertTypeEqHelper;
01972 
01973 template <typename T>
01974 struct StaticAssertTypeEqHelper<T, T> {};
01975 
01976 #if GTEST_HAS_GLOBAL_STRING
01977 typedef ::string string;
01978 #else
01979 typedef ::std::string string;
01980 #endif  // GTEST_HAS_GLOBAL_STRING
01981 
01982 #if GTEST_HAS_GLOBAL_WSTRING
01983 typedef ::wstring wstring;
01984 #elif GTEST_HAS_STD_WSTRING
01985 typedef ::std::wstring wstring;
01986 #endif  // GTEST_HAS_GLOBAL_WSTRING
01987 
01988 // A helper for suppressing warnings on constant condition.  It just
01989 // returns 'condition'.
01990 GTEST_API_ bool IsTrue(bool condition);
01991 
01992 // Defines scoped_ptr.
01993 
01994 // This implementation of scoped_ptr is PARTIAL - it only contains
01995 // enough stuff to satisfy Google Test's need.
01996 template <typename T>
01997 class scoped_ptr {
01998  public:
01999   typedef T element_type;
02000 
02001   explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
02002   ~scoped_ptr() { reset(); }
02003 
02004   T& operator*() const { return *ptr_; }
02005   T* operator->() const { return ptr_; }
02006   T* get() const { return ptr_; }
02007 
02008   T* release() {
02009     T* const ptr = ptr_;
02010     ptr_ = NULL;
02011     return ptr;
02012   }
02013 
02014   void reset(T* p = NULL) {
02015     if (p != ptr_) {
02016       if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.
02017         delete ptr_;
02018       }
02019       ptr_ = p;
02020     }
02021   }
02022 
02023  private:
02024   T* ptr_;
02025 
02026   GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
02027 };
02028 
02029 // Defines RE.
02030 
02031 // A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended
02032 // Regular Expression syntax.
02033 class GTEST_API_ RE {
02034  public:
02035   // A copy constructor is required by the Standard to initialize object
02036   // references from r-values.
02037   RE(const RE& other) { Init(other.pattern()); }
02038 
02039   // Constructs an RE from a string.
02040   RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT
02041 
02042 #if GTEST_HAS_GLOBAL_STRING
02043 
02044   RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT
02045 
02046 #endif  // GTEST_HAS_GLOBAL_STRING
02047 
02048   RE(const char* regex) { Init(regex); }  // NOLINT
02049   ~RE();
02050 
02051   // Returns the string representation of the regex.
02052   const char* pattern() const { return pattern_; }
02053 
02054   // FullMatch(str, re) returns true iff regular expression re matches
02055   // the entire str.
02056   // PartialMatch(str, re) returns true iff regular expression re
02057   // matches a substring of str (including str itself).
02058   //
02059   // TODO(wan@google.com): make FullMatch() and PartialMatch() work
02060   // when str contains NUL characters.
02061   static bool FullMatch(const ::std::string& str, const RE& re) {
02062     return FullMatch(str.c_str(), re);
02063   }
02064   static bool PartialMatch(const ::std::string& str, const RE& re) {
02065     return PartialMatch(str.c_str(), re);
02066   }
02067 
02068 #if GTEST_HAS_GLOBAL_STRING
02069 
02070   static bool FullMatch(const ::string& str, const RE& re) {
02071     return FullMatch(str.c_str(), re);
02072   }
02073   static bool PartialMatch(const ::string& str, const RE& re) {
02074     return PartialMatch(str.c_str(), re);
02075   }
02076 
02077 #endif  // GTEST_HAS_GLOBAL_STRING
02078 
02079   static bool FullMatch(const char* str, const RE& re);
02080   static bool PartialMatch(const char* str, const RE& re);
02081 
02082  private:
02083   void Init(const char* regex);
02084 
02085   // We use a const char* instead of an std::string, as Google Test used to be
02086   // used where std::string is not available.  TODO(wan@google.com): change to
02087   // std::string.
02088   const char* pattern_;
02089   bool is_valid_;
02090 
02091 #if GTEST_USES_POSIX_RE
02092 
02093   regex_t full_regex_;     // For FullMatch().
02094   regex_t partial_regex_;  // For PartialMatch().
02095 
02096 #else  // GTEST_USES_SIMPLE_RE
02097 
02098   const char* full_pattern_;  // For FullMatch();
02099 
02100 #endif
02101 
02102   GTEST_DISALLOW_ASSIGN_(RE);
02103 };
02104 
02105 // Formats a source file path and a line number as they would appear
02106 // in an error message from the compiler used to compile this code.
02107 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
02108 
02109 // Formats a file location for compiler-independent XML output.
02110 // Although this function is not platform dependent, we put it next to
02111 // FormatFileLocation in order to contrast the two functions.
02112 GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
02113                                                                int line);
02114 
02115 // Defines logging utilities:
02116 //   GTEST_LOG_(severity) - logs messages at the specified severity level. The
02117 //                          message itself is streamed into the macro.
02118 //   LogToStderr()  - directs all log messages to stderr.
02119 //   FlushInfoLog() - flushes informational log messages.
02120 
02121 enum GTestLogSeverity {
02122   GTEST_INFO,
02123   GTEST_WARNING,
02124   GTEST_ERROR,
02125   GTEST_FATAL
02126 };
02127 
02128 // Formats log entry severity, provides a stream object for streaming the
02129 // log message, and terminates the message with a newline when going out of
02130 // scope.
02131 class GTEST_API_ GTestLog {
02132  public:
02133   GTestLog(GTestLogSeverity severity, const char* file, int line);
02134 
02135   // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
02136   ~GTestLog();
02137 
02138   ::std::ostream& GetStream() { return ::std::cerr; }
02139 
02140  private:
02141   const GTestLogSeverity severity_;
02142 
02143   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
02144 };
02145 
02146 #define GTEST_LOG_(severity) \
02147     ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
02148                                   __FILE__, __LINE__).GetStream()
02149 
02150 inline void LogToStderr() {}
02151 inline void FlushInfoLog() { fflush(NULL); }
02152 
02153 // INTERNAL IMPLEMENTATION - DO NOT USE.
02154 //
02155 // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
02156 // is not satisfied.
02157 //  Synopsys:
02158 //    GTEST_CHECK_(boolean_condition);
02159 //     or
02160 //    GTEST_CHECK_(boolean_condition) << "Additional message";
02161 //
02162 //    This checks the condition and if the condition is not satisfied
02163 //    it prints message about the condition violation, including the
02164 //    condition itself, plus additional message streamed into it, if any,
02165 //    and then it aborts the program. It aborts the program irrespective of
02166 //    whether it is built in the debug mode or not.
02167 #define GTEST_CHECK_(condition) \
02168     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
02169     if (::testing::internal::IsTrue(condition)) \
02170       ; \
02171     else \
02172       GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
02173 
02174 // An all-mode assert to verify that the given POSIX-style function
02175 // call returns 0 (indicating success).  Known limitation: this
02176 // doesn't expand to a balanced 'if' statement, so enclose the macro
02177 // in {} if you need to use it as the only statement in an 'if'
02178 // branch.
02179 #define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
02180   if (const int gtest_error = (posix_call)) \
02181     GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
02182                       << gtest_error
02183 
02184 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
02185 //
02186 // Use ImplicitCast_ as a safe version of static_cast for upcasting in
02187 // the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
02188 // const Foo*).  When you use ImplicitCast_, the compiler checks that
02189 // the cast is safe.  Such explicit ImplicitCast_s are necessary in
02190 // surprisingly many situations where C++ demands an exact type match
02191 // instead of an argument type convertable to a target type.
02192 //
02193 // The syntax for using ImplicitCast_ is the same as for static_cast:
02194 //
02195 //   ImplicitCast_<ToType>(expr)
02196 //
02197 // ImplicitCast_ would have been part of the C++ standard library,
02198 // but the proposal was submitted too late.  It will probably make
02199 // its way into the language in the future.
02200 //
02201 // This relatively ugly name is intentional. It prevents clashes with
02202 // similar functions users may have (e.g., implicit_cast). The internal
02203 // namespace alone is not enough because the function can be found by ADL.
02204 template<typename To>
02205 inline To ImplicitCast_(To x) { return x; }
02206 
02207 // When you upcast (that is, cast a pointer from type Foo to type
02208 // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
02209 // always succeed.  When you downcast (that is, cast a pointer from
02210 // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
02211 // how do you know the pointer is really of type SubclassOfFoo?  It
02212 // could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,
02213 // when you downcast, you should use this macro.  In debug mode, we
02214 // use dynamic_cast<> to double-check the downcast is legal (we die
02215 // if it's not).  In normal mode, we do the efficient static_cast<>
02216 // instead.  Thus, it's important to test in debug mode to make sure
02217 // the cast is legal!
02218 //    This is the only place in the code we should use dynamic_cast<>.
02219 // In particular, you SHOULDN'T be using dynamic_cast<> in order to
02220 // do RTTI (eg code like this:
02221 //    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
02222 //    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
02223 // You should design the code some other way not to need this.
02224 //
02225 // This relatively ugly name is intentional. It prevents clashes with
02226 // similar functions users may have (e.g., down_cast). The internal
02227 // namespace alone is not enough because the function can be found by ADL.
02228 template<typename To, typename From>  // use like this: DownCast_<T*>(foo);
02229 inline To DownCast_(From* f) {  // so we only accept pointers
02230   // Ensures that To is a sub-type of From *.  This test is here only
02231   // for compile-time type checking, and has no overhead in an
02232   // optimized build at run-time, as it will be optimized away
02233   // completely.
02234   if (false) {
02235     const To to = NULL;
02236     ::testing::internal::ImplicitCast_<From*>(to);
02237   }
02238 
02239 #if GTEST_HAS_RTTI
02240   // RTTI: debug mode only!
02241   GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
02242 #endif
02243   return static_cast<To>(f);
02244 }
02245 
02246 // Downcasts the pointer of type Base to Derived.
02247 // Derived must be a subclass of Base. The parameter MUST
02248 // point to a class of type Derived, not any subclass of it.
02249 // When RTTI is available, the function performs a runtime
02250 // check to enforce this.
02251 template <class Derived, class Base>
02252 Derived* CheckedDowncastToActualType(Base* base) {
02253 #if GTEST_HAS_RTTI
02254   GTEST_CHECK_(typeid(*base) == typeid(Derived));
02255   return dynamic_cast<Derived*>(base);  // NOLINT
02256 #else
02257   return static_cast<Derived*>(base);  // Poor man's downcast.
02258 #endif
02259 }
02260 
02261 #if GTEST_HAS_STREAM_REDIRECTION
02262 
02263 // Defines the stderr capturer:
02264 //   CaptureStdout     - starts capturing stdout.
02265 //   GetCapturedStdout - stops capturing stdout and returns the captured string.
02266 //   CaptureStderr     - starts capturing stderr.
02267 //   GetCapturedStderr - stops capturing stderr and returns the captured string.
02268 //
02269 GTEST_API_ void CaptureStdout();
02270 GTEST_API_ std::string GetCapturedStdout();
02271 GTEST_API_ void CaptureStderr();
02272 GTEST_API_ std::string GetCapturedStderr();
02273 
02274 #endif  // GTEST_HAS_STREAM_REDIRECTION
02275 
02276 
02277 #if GTEST_HAS_DEATH_TEST
02278 
02279 const ::std::vector<testing::internal::string>& GetInjectableArgvs();
02280 void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
02281                              new_argvs);
02282 
02283 // A copy of all command line arguments.  Set by InitGoogleTest().
02284 extern ::std::vector<testing::internal::string> g_argvs;
02285 
02286 #endif  // GTEST_HAS_DEATH_TEST
02287 
02288 // Defines synchronization primitives.
02289 
02290 #if GTEST_HAS_PTHREAD
02291 
02292 // Sleeps for (roughly) n milli-seconds.  This function is only for
02293 // testing Google Test's own constructs.  Don't use it in user tests,
02294 // either directly or indirectly.
02295 inline void SleepMilliseconds(int n) {
02296   const timespec time = {
02297     0,                  // 0 seconds.
02298     n * 1000L * 1000L,  // And n ms.
02299   };
02300   nanosleep(&time, NULL);
02301 }
02302 
02303 // Allows a controller thread to pause execution of newly created
02304 // threads until notified.  Instances of this class must be created
02305 // and destroyed in the controller thread.
02306 //
02307 // This class is only for testing Google Test's own constructs. Do not
02308 // use it in user tests, either directly or indirectly.
02309 class Notification {
02310  public:
02311   Notification() : notified_(false) {
02312     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
02313   }
02314   ~Notification() {
02315     pthread_mutex_destroy(&mutex_);
02316   }
02317 
02318   // Notifies all threads created with this notification to start. Must
02319   // be called from the controller thread.
02320   void Notify() {
02321     pthread_mutex_lock(&mutex_);
02322     notified_ = true;
02323     pthread_mutex_unlock(&mutex_);
02324   }
02325 
02326   // Blocks until the controller thread notifies. Must be called from a test
02327   // thread.
02328   void WaitForNotification() {
02329     for (;;) {
02330       pthread_mutex_lock(&mutex_);
02331       const bool notified = notified_;
02332       pthread_mutex_unlock(&mutex_);
02333       if (notified)
02334         break;
02335       SleepMilliseconds(10);
02336     }
02337   }
02338 
02339  private:
02340   pthread_mutex_t mutex_;
02341   bool notified_;
02342 
02343   GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
02344 };
02345 
02346 // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
02347 // Consequently, it cannot select a correct instantiation of ThreadWithParam
02348 // in order to call its Run(). Introducing ThreadWithParamBase as a
02349 // non-templated base class for ThreadWithParam allows us to bypass this
02350 // problem.
02351 class ThreadWithParamBase {
02352  public:
02353   virtual ~ThreadWithParamBase() {}
02354   virtual void Run() = 0;
02355 };
02356 
02357 // pthread_create() accepts a pointer to a function type with the C linkage.
02358 // According to the Standard (7.5/1), function types with different linkages
02359 // are different even if they are otherwise identical.  Some compilers (for
02360 // example, SunStudio) treat them as different types.  Since class methods
02361 // cannot be defined with C-linkage we need to define a free C-function to
02362 // pass into pthread_create().
02363 extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
02364   static_cast<ThreadWithParamBase*>(thread)->Run();
02365   return NULL;
02366 }
02367 
02368 // Helper class for testing Google Test's multi-threading constructs.
02369 // To use it, write:
02370 //
02371 //   void ThreadFunc(int param) { /* Do things with param */ }
02372 //   Notification thread_can_start;
02373 //   ...
02374 //   // The thread_can_start parameter is optional; you can supply NULL.
02375 //   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
02376 //   thread_can_start.Notify();
02377 //
02378 // These classes are only for testing Google Test's own constructs. Do
02379 // not use them in user tests, either directly or indirectly.
02380 template <typename T>
02381 class ThreadWithParam : public ThreadWithParamBase {
02382  public:
02383   typedef void (*UserThreadFunc)(T);
02384 
02385   ThreadWithParam(
02386       UserThreadFunc func, T param, Notification* thread_can_start)
02387       : func_(func),
02388         param_(param),
02389         thread_can_start_(thread_can_start),
02390         finished_(false) {
02391     ThreadWithParamBase* const base = this;
02392     // The thread can be created only after all fields except thread_
02393     // have been initialized.
02394     GTEST_CHECK_POSIX_SUCCESS_(
02395         pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
02396   }
02397   ~ThreadWithParam() { Join(); }
02398 
02399   void Join() {
02400     if (!finished_) {
02401       GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
02402       finished_ = true;
02403     }
02404   }
02405 
02406   virtual void Run() {
02407     if (thread_can_start_ != NULL)
02408       thread_can_start_->WaitForNotification();
02409     func_(param_);
02410   }
02411 
02412  private:
02413   const UserThreadFunc func_;  // User-supplied thread function.
02414   const T param_;  // User-supplied parameter to the thread function.
02415   // When non-NULL, used to block execution until the controller thread
02416   // notifies.
02417   Notification* const thread_can_start_;
02418   bool finished_;  // true iff we know that the thread function has finished.
02419   pthread_t thread_;  // The native thread object.
02420 
02421   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
02422 };
02423 
02424 // MutexBase and Mutex implement mutex on pthreads-based platforms. They
02425 // are used in conjunction with class MutexLock:
02426 //
02427 //   Mutex mutex;
02428 //   ...
02429 //   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the end
02430 //                            // of the current scope.
02431 //
02432 // MutexBase implements behavior for both statically and dynamically
02433 // allocated mutexes.  Do not use MutexBase directly.  Instead, write
02434 // the following to define a static mutex:
02435 //
02436 //   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
02437 //
02438 // You can forward declare a static mutex like this:
02439 //
02440 //   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
02441 //
02442 // To create a dynamic mutex, just define an object of type Mutex.
02443 class MutexBase {
02444  public:
02445   // Acquires this mutex.
02446   void Lock() {
02447     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
02448     owner_ = pthread_self();
02449     has_owner_ = true;
02450   }
02451 
02452   // Releases this mutex.
02453   void Unlock() {
02454     // Since the lock is being released the owner_ field should no longer be
02455     // considered valid. We don't protect writing to has_owner_ here, as it's
02456     // the caller's responsibility to ensure that the current thread holds the
02457     // mutex when this is called.
02458     has_owner_ = false;
02459     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
02460   }
02461 
02462   // Does nothing if the current thread holds the mutex. Otherwise, crashes
02463   // with high probability.
02464   void AssertHeld() const {
02465     GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
02466         << "The current thread is not holding the mutex @" << this;
02467   }
02468 
02469   // A static mutex may be used before main() is entered.  It may even
02470   // be used before the dynamic initialization stage.  Therefore we
02471   // must be able to initialize a static mutex object at link time.
02472   // This means MutexBase has to be a POD and its member variables
02473   // have to be public.
02474  public:
02475   pthread_mutex_t mutex_;  // The underlying pthread mutex.
02476   // has_owner_ indicates whether the owner_ field below contains a valid thread
02477   // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
02478   // accesses to the owner_ field should be protected by a check of this field.
02479   // An alternative might be to memset() owner_ to all zeros, but there's no
02480   // guarantee that a zero'd pthread_t is necessarily invalid or even different
02481   // from pthread_self().
02482   bool has_owner_;
02483   pthread_t owner_;  // The thread holding the mutex.
02484 };
02485 
02486 // Forward-declares a static mutex.
02487 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
02488     extern ::testing::internal::MutexBase mutex
02489 
02490 // Defines and statically (i.e. at link time) initializes a static mutex.
02491 // The initialization list here does not explicitly initialize each field,
02492 // instead relying on default initialization for the unspecified fields. In
02493 // particular, the owner_ field (a pthread_t) is not explicitly initialized.
02494 // This allows initialization to work whether pthread_t is a scalar or struct.
02495 // The flag -Wmissing-field-initializers must not be specified for this to work.
02496 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
02497     ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
02498 
02499 // The Mutex class can only be used for mutexes created at runtime. It
02500 // shares its API with MutexBase otherwise.
02501 class Mutex : public MutexBase {
02502  public:
02503   Mutex() {
02504     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
02505     has_owner_ = false;
02506   }
02507   ~Mutex() {
02508     GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
02509   }
02510 
02511  private:
02512   GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
02513 };
02514 
02515 // We cannot name this class MutexLock as the ctor declaration would
02516 // conflict with a macro named MutexLock, which is defined on some
02517 // platforms.  Hence the typedef trick below.
02518 class GTestMutexLock {
02519  public:
02520   explicit GTestMutexLock(MutexBase* mutex)
02521       : mutex_(mutex) { mutex_->Lock(); }
02522 
02523   ~GTestMutexLock() { mutex_->Unlock(); }
02524 
02525  private:
02526   MutexBase* const mutex_;
02527 
02528   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
02529 };
02530 
02531 typedef GTestMutexLock MutexLock;
02532 
02533 // Helpers for ThreadLocal.
02534 
02535 // pthread_key_create() requires DeleteThreadLocalValue() to have
02536 // C-linkage.  Therefore it cannot be templatized to access
02537 // ThreadLocal<T>.  Hence the need for class
02538 // ThreadLocalValueHolderBase.
02539 class ThreadLocalValueHolderBase {
02540  public:
02541   virtual ~ThreadLocalValueHolderBase() {}
02542 };
02543 
02544 // Called by pthread to delete thread-local data stored by
02545 // pthread_setspecific().
02546 extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
02547   delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
02548 }
02549 
02550 // Implements thread-local storage on pthreads-based systems.
02551 //
02552 //   // Thread 1
02553 //   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.
02554 //
02555 //   // Thread 2
02556 //   tl.set(150);  // Changes the value for thread 2 only.
02557 //   EXPECT_EQ(150, tl.get());
02558 //
02559 //   // Thread 1
02560 //   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.
02561 //   tl.set(200);
02562 //   EXPECT_EQ(200, tl.get());
02563 //
02564 // The template type argument T must have a public copy constructor.
02565 // In addition, the default ThreadLocal constructor requires T to have
02566 // a public default constructor.
02567 //
02568 // An object managed for a thread by a ThreadLocal instance is deleted
02569 // when the thread exits.  Or, if the ThreadLocal instance dies in
02570 // that thread, when the ThreadLocal dies.  It's the user's
02571 // responsibility to ensure that all other threads using a ThreadLocal
02572 // have exited when it dies, or the per-thread objects for those
02573 // threads will not be deleted.
02574 //
02575 // Google Test only uses global ThreadLocal objects.  That means they
02576 // will die after main() has returned.  Therefore, no per-thread
02577 // object managed by Google Test will be leaked as long as all threads
02578 // using Google Test have exited when main() returns.
02579 template <typename T>
02580 class ThreadLocal {
02581  public:
02582   ThreadLocal() : key_(CreateKey()),
02583                   default_() {}
02584   explicit ThreadLocal(const T& value) : key_(CreateKey()),
02585                                          default_(value) {}
02586 
02587   ~ThreadLocal() {
02588     // Destroys the managed object for the current thread, if any.
02589     DeleteThreadLocalValue(pthread_getspecific(key_));
02590 
02591     // Releases resources associated with the key.  This will *not*
02592     // delete managed objects for other threads.
02593     GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
02594   }
02595 
02596   T* pointer() { return GetOrCreateValue(); }
02597   const T* pointer() const { return GetOrCreateValue(); }
02598   const T& get() const { return *pointer(); }
02599   void set(const T& value) { *pointer() = value; }
02600 
02601  private:
02602   // Holds a value of type T.
02603   class ValueHolder : public ThreadLocalValueHolderBase {
02604    public:
02605     explicit ValueHolder(const T& value) : value_(value) {}
02606 
02607     T* pointer() { return &value_; }
02608 
02609    private:
02610     T value_;
02611     GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
02612   };
02613 
02614   static pthread_key_t CreateKey() {
02615     pthread_key_t key;
02616     // When a thread exits, DeleteThreadLocalValue() will be called on
02617     // the object managed for that thread.
02618     GTEST_CHECK_POSIX_SUCCESS_(
02619         pthread_key_create(&key, &DeleteThreadLocalValue));
02620     return key;
02621   }
02622 
02623   T* GetOrCreateValue() const {
02624     ThreadLocalValueHolderBase* const holder =
02625         static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
02626     if (holder != NULL) {
02627       return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
02628     }
02629 
02630     ValueHolder* const new_holder = new ValueHolder(default_);
02631     ThreadLocalValueHolderBase* const holder_base = new_holder;
02632     GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
02633     return new_holder->pointer();
02634   }
02635 
02636   // A key pthreads uses for looking up per-thread values.
02637   const pthread_key_t key_;
02638   const T default_;  // The default value for each thread.
02639 
02640   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
02641 };
02642 
02643 # define GTEST_IS_THREADSAFE 1
02644 
02645 #else  // GTEST_HAS_PTHREAD
02646 
02647 // A dummy implementation of synchronization primitives (mutex, lock,
02648 // and thread-local variable).  Necessary for compiling Google Test where
02649 // mutex is not supported - using Google Test in multiple threads is not
02650 // supported on such platforms.
02651 
02652 class Mutex {
02653  public:
02654   Mutex() {}
02655   void Lock() {}
02656   void Unlock() {}
02657   void AssertHeld() const {}
02658 };
02659 
02660 # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
02661   extern ::testing::internal::Mutex mutex
02662 
02663 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
02664 
02665 class GTestMutexLock {
02666  public:
02667   explicit GTestMutexLock(Mutex*) {}  // NOLINT
02668 };
02669 
02670 typedef GTestMutexLock MutexLock;
02671 
02672 template <typename T>
02673 class ThreadLocal {
02674  public:
02675   ThreadLocal() : value_() {}
02676   explicit ThreadLocal(const T& value) : value_(value) {}
02677   T* pointer() { return &value_; }
02678   const T* pointer() const { return &value_; }
02679   const T& get() const { return value_; }
02680   void set(const T& value) { value_ = value; }
02681  private:
02682   T value_;
02683 };
02684 
02685 // The above synchronization primitives have dummy implementations.
02686 // Therefore Google Test is not thread-safe.
02687 # define GTEST_IS_THREADSAFE 0
02688 
02689 #endif  // GTEST_HAS_PTHREAD
02690 
02691 // Returns the number of threads running in the process, or 0 to indicate that
02692 // we cannot detect it.
02693 GTEST_API_ size_t GetThreadCount();
02694 
02695 // Passing non-POD classes through ellipsis (...) crashes the ARM
02696 // compiler and generates a warning in Sun Studio.  The Nokia Symbian
02697 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
02698 // for objects passed through ellipsis (...), failing for uncopyable
02699 // objects.  We define this to ensure that only POD is passed through
02700 // ellipsis on these systems.
02701 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
02702 // We lose support for NULL detection where the compiler doesn't like
02703 // passing non-POD classes through ellipsis (...).
02704 # define GTEST_ELLIPSIS_NEEDS_POD_ 1
02705 #else
02706 # define GTEST_CAN_COMPARE_NULL 1
02707 #endif
02708 
02709 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
02710 // const T& and const T* in a function template.  These compilers
02711 // _can_ decide between class template specializations for T and T*,
02712 // so a tr1::type_traits-like is_pointer works.
02713 #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
02714 # define GTEST_NEEDS_IS_POINTER_ 1
02715 #endif
02716 
02717 template <bool bool_value>
02718 struct bool_constant {
02719   typedef bool_constant<bool_value> type;
02720   static const bool value = bool_value;
02721 };
02722 template <bool bool_value> const bool bool_constant<bool_value>::value;
02723 
02724 typedef bool_constant<false> false_type;
02725 typedef bool_constant<true> true_type;
02726 
02727 template <typename T>
02728 struct is_pointer : public false_type {};
02729 
02730 template <typename T>
02731 struct is_pointer<T*> : public true_type {};
02732 
02733 template <typename Iterator>
02734 struct IteratorTraits {
02735   typedef typename Iterator::value_type value_type;
02736 };
02737 
02738 template <typename T>
02739 struct IteratorTraits<T*> {
02740   typedef T value_type;
02741 };
02742 
02743 template <typename T>
02744 struct IteratorTraits<const T*> {
02745   typedef T value_type;
02746 };
02747 
02748 #if GTEST_OS_WINDOWS
02749 # define GTEST_PATH_SEP_ "\\"
02750 # define GTEST_HAS_ALT_PATH_SEP_ 1
02751 // The biggest signed integer type the compiler supports.
02752 typedef __int64 BiggestInt;
02753 #else
02754 # define GTEST_PATH_SEP_ "/"
02755 # define GTEST_HAS_ALT_PATH_SEP_ 0
02756 typedef long long BiggestInt;  // NOLINT
02757 #endif  // GTEST_OS_WINDOWS
02758 
02759 // Utilities for char.
02760 
02761 // isspace(int ch) and friends accept an unsigned char or EOF.  char
02762 // may be signed, depending on the compiler (or compiler flags).
02763 // Therefore we need to cast a char to unsigned char before calling
02764 // isspace(), etc.
02765 
02766 inline bool IsAlpha(char ch) {
02767   return isalpha(static_cast<unsigned char>(ch)) != 0;
02768 }
02769 inline bool IsAlNum(char ch) {
02770   return isalnum(static_cast<unsigned char>(ch)) != 0;
02771 }
02772 inline bool IsDigit(char ch) {
02773   return isdigit(static_cast<unsigned char>(ch)) != 0;
02774 }
02775 inline bool IsLower(char ch) {
02776   return islower(static_cast<unsigned char>(ch)) != 0;
02777 }
02778 inline bool IsSpace(char ch) {
02779   return isspace(static_cast<unsigned char>(ch)) != 0;
02780 }
02781 inline bool IsUpper(char ch) {
02782   return isupper(static_cast<unsigned char>(ch)) != 0;
02783 }
02784 inline bool IsXDigit(char ch) {
02785   return isxdigit(static_cast<unsigned char>(ch)) != 0;
02786 }
02787 inline bool IsXDigit(wchar_t ch) {
02788   const unsigned char low_byte = static_cast<unsigned char>(ch);
02789   return ch == low_byte && isxdigit(low_byte) != 0;
02790 }
02791 
02792 inline char ToLower(char ch) {
02793   return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
02794 }
02795 inline char ToUpper(char ch) {
02796   return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
02797 }
02798 
02799 // The testing::internal::posix namespace holds wrappers for common
02800 // POSIX functions.  These wrappers hide the differences between
02801 // Windows/MSVC and POSIX systems.  Since some compilers define these
02802 // standard functions as macros, the wrapper cannot have the same name
02803 // as the wrapped function.
02804 
02805 namespace posix {
02806 
02807 // Functions with a different name on Windows.
02808 
02809 #if GTEST_OS_WINDOWS
02810 
02811 typedef struct _stat StatStruct;
02812 
02813 # ifdef __BORLANDC__
02814 inline int IsATTY(int fd) { return isatty(fd); }
02815 inline int StrCaseCmp(const char* s1, const char* s2) {
02816   return stricmp(s1, s2);
02817 }
02818 inline char* StrDup(const char* src) { return strdup(src); }
02819 # else  // !__BORLANDC__
02820 #  if GTEST_OS_WINDOWS_MOBILE
02821 inline int IsATTY(int /* fd */) { return 0; }
02822 #  else
02823 inline int IsATTY(int fd) { return _isatty(fd); }
02824 #  endif  // GTEST_OS_WINDOWS_MOBILE
02825 inline int StrCaseCmp(const char* s1, const char* s2) {
02826   return _stricmp(s1, s2);
02827 }
02828 inline char* StrDup(const char* src) { return _strdup(src); }
02829 # endif  // __BORLANDC__
02830 
02831 # if GTEST_OS_WINDOWS_MOBILE
02832 inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
02833 // Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
02834 // time and thus not defined there.
02835 # else
02836 inline int FileNo(FILE* file) { return _fileno(file); }
02837 inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
02838 inline int RmDir(const char* dir) { return _rmdir(dir); }
02839 inline bool IsDir(const StatStruct& st) {
02840   return (_S_IFDIR & st.st_mode) != 0;
02841 }
02842 # endif  // GTEST_OS_WINDOWS_MOBILE
02843 
02844 #else
02845 
02846 typedef struct stat StatStruct;
02847 
02848 inline int FileNo(FILE* file) { return fileno(file); }
02849 inline int IsATTY(int fd) { return isatty(fd); }
02850 inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
02851 inline int StrCaseCmp(const char* s1, const char* s2) {
02852   return strcasecmp(s1, s2);
02853 }
02854 inline char* StrDup(const char* src) { return strdup(src); }
02855 inline int RmDir(const char* dir) { return rmdir(dir); }
02856 inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
02857 
02858 #endif  // GTEST_OS_WINDOWS
02859 
02860 // Functions deprecated by MSVC 8.0.
02861 
02862 #ifdef _MSC_VER
02863 // Temporarily disable warning 4996 (deprecated function).
02864 # pragma warning(push)
02865 # pragma warning(disable:4996)
02866 #endif
02867 
02868 inline const char* StrNCpy(char* dest, const char* src, size_t n) {
02869   return strncpy(dest, src, n);
02870 }
02871 
02872 // ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
02873 // StrError() aren't needed on Windows CE at this time and thus not
02874 // defined there.
02875 
02876 #if !GTEST_OS_WINDOWS_MOBILE
02877 inline int ChDir(const char* dir) { return chdir(dir); }
02878 #endif
02879 inline FILE* FOpen(const char* path, const char* mode) {
02880   return fopen(path, mode);
02881 }
02882 #if !GTEST_OS_WINDOWS_MOBILE
02883 inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
02884   return freopen(path, mode, stream);
02885 }
02886 inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
02887 #endif
02888 inline int FClose(FILE* fp) { return fclose(fp); }
02889 #if !GTEST_OS_WINDOWS_MOBILE
02890 inline int Read(int fd, void* buf, unsigned int count) {
02891   return static_cast<int>(read(fd, buf, count));
02892 }
02893 inline int Write(int fd, const void* buf, unsigned int count) {
02894   return static_cast<int>(write(fd, buf, count));
02895 }
02896 inline int Close(int fd) { return close(fd); }
02897 inline const char* StrError(int errnum) { return strerror(errnum); }
02898 #endif
02899 inline const char* GetEnv(const char* name) {
02900 #if GTEST_OS_WINDOWS_MOBILE
02901   // We are on Windows CE, which has no environment variables.
02902   return NULL;
02903 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
02904   // Environment variables which we programmatically clear will be set to the
02905   // empty string rather than unset (NULL).  Handle that case.
02906   const char* const env = getenv(name);
02907   return (env != NULL && env[0] != '\0') ? env : NULL;
02908 #else
02909   return getenv(name);
02910 #endif
02911 }
02912 
02913 #ifdef _MSC_VER
02914 # pragma warning(pop)  // Restores the warning state.
02915 #endif
02916 
02917 #if GTEST_OS_WINDOWS_MOBILE
02918 // Windows CE has no C library. The abort() function is used in
02919 // several places in Google Test. This implementation provides a reasonable
02920 // imitation of standard behaviour.
02921 void Abort();
02922 #else
02923 inline void Abort() { abort(); }
02924 #endif  // GTEST_OS_WINDOWS_MOBILE
02925 
02926 }  // namespace posix
02927 
02928 // MSVC "deprecates" snprintf and issues warnings wherever it is used.  In
02929 // order to avoid these warnings, we need to use _snprintf or _snprintf_s on
02930 // MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate
02931 // function in order to achieve that.  We use macro definition here because
02932 // snprintf is a variadic function.
02933 #if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
02934 // MSVC 2005 and above support variadic macros.
02935 # define GTEST_SNPRINTF_(buffer, size, format, ...) \
02936      _snprintf_s(buffer, size, size, format, __VA_ARGS__)
02937 #elif defined(_MSC_VER)
02938 // Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
02939 // complain about _snprintf.
02940 # define GTEST_SNPRINTF_ _snprintf
02941 #else
02942 # define GTEST_SNPRINTF_ snprintf
02943 #endif
02944 
02945 // The maximum number a BiggestInt can represent.  This definition
02946 // works no matter BiggestInt is represented in one's complement or
02947 // two's complement.
02948 //
02949 // We cannot rely on numeric_limits in STL, as __int64 and long long
02950 // are not part of standard C++ and numeric_limits doesn't need to be
02951 // defined for them.
02952 const BiggestInt kMaxBiggestInt =
02953     ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
02954 
02955 // This template class serves as a compile-time function from size to
02956 // type.  It maps a size in bytes to a primitive type with that
02957 // size. e.g.
02958 //
02959 //   TypeWithSize<4>::UInt
02960 //
02961 // is typedef-ed to be unsigned int (unsigned integer made up of 4
02962 // bytes).
02963 //
02964 // Such functionality should belong to STL, but I cannot find it
02965 // there.
02966 //
02967 // Google Test uses this class in the implementation of floating-point
02968 // comparison.
02969 //
02970 // For now it only handles UInt (unsigned int) as that's all Google Test
02971 // needs.  Other types can be easily added in the future if need
02972 // arises.
02973 template <size_t size>
02974 class TypeWithSize {
02975  public:
02976   // This prevents the user from using TypeWithSize<N> with incorrect
02977   // values of N.
02978   typedef void UInt;
02979 };
02980 
02981 // The specialization for size 4.
02982 template <>
02983 class TypeWithSize<4> {
02984  public:
02985   // unsigned int has size 4 in both gcc and MSVC.
02986   //
02987   // As base/basictypes.h doesn't compile on Windows, we cannot use
02988   // uint32, uint64, and etc here.
02989   typedef int Int;
02990   typedef unsigned int UInt;
02991 };
02992 
02993 // The specialization for size 8.
02994 template <>
02995 class TypeWithSize<8> {
02996  public:
02997 #if GTEST_OS_WINDOWS
02998   typedef __int64 Int;
02999   typedef unsigned __int64 UInt;
03000 #else
03001   typedef long long Int;  // NOLINT
03002   typedef unsigned long long UInt;  // NOLINT
03003 #endif  // GTEST_OS_WINDOWS
03004 };
03005 
03006 // Integer types of known sizes.
03007 typedef TypeWithSize<4>::Int Int32;
03008 typedef TypeWithSize<4>::UInt UInt32;
03009 typedef TypeWithSize<8>::Int Int64;
03010 typedef TypeWithSize<8>::UInt UInt64;
03011 typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
03012 
03013 // Utilities for command line flags and environment variables.
03014 
03015 // Macro for referencing flags.
03016 #define GTEST_FLAG(name) FLAGS_gtest_##name
03017 
03018 // Macros for declaring flags.
03019 #define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
03020 #define GTEST_DECLARE_int32_(name) \
03021     GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
03022 #define GTEST_DECLARE_string_(name) \
03023     GTEST_API_ extern ::std::string GTEST_FLAG(name)
03024 
03025 // Macros for defining flags.
03026 #define GTEST_DEFINE_bool_(name, default_val, doc) \
03027     GTEST_API_ bool GTEST_FLAG(name) = (default_val)
03028 #define GTEST_DEFINE_int32_(name, default_val, doc) \
03029     GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
03030 #define GTEST_DEFINE_string_(name, default_val, doc) \
03031     GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
03032 
03033 // Thread annotations
03034 #define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
03035 #define GTEST_LOCK_EXCLUDED_(locks)
03036 
03037 // Parses 'str' for a 32-bit signed integer.  If successful, writes the result
03038 // to *value and returns true; otherwise leaves *value unchanged and returns
03039 // false.
03040 // TODO(chandlerc): Find a better way to refactor flag and environment parsing
03041 // out of both gtest-port.cc and gtest.cc to avoid exporting this utility
03042 // function.
03043 bool ParseInt32(const Message& src_text, const char* str, Int32* value);
03044 
03045 // Parses a bool/Int32/string from the environment variable
03046 // corresponding to the given Google Test flag.
03047 bool BoolFromGTestEnv(const char* flag, bool default_val);
03048 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
03049 const char* StringFromGTestEnv(const char* flag, const char* default_val);
03050 
03051 }  // namespace internal
03052 }  // namespace testing
03053 
03054 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
03055 
03056 #if GTEST_OS_LINUX
03057 # include <stdlib.h>
03058 # include <sys/types.h>
03059 # include <sys/wait.h>
03060 # include <unistd.h>
03061 #endif  // GTEST_OS_LINUX
03062 
03063 #if GTEST_HAS_EXCEPTIONS
03064 # include <stdexcept>
03065 #endif
03066 
03067 #include <ctype.h>
03068 #include <float.h>
03069 #include <string.h>
03070 #include <iomanip>
03071 #include <limits>
03072 #include <set>
03073 
03074 // Copyright 2005, Google Inc.
03075 // All rights reserved.
03076 //
03077 // Redistribution and use in source and binary forms, with or without
03078 // modification, are permitted provided that the following conditions are
03079 // met:
03080 //
03081 //     * Redistributions of source code must retain the above copyright
03082 // notice, this list of conditions and the following disclaimer.
03083 //     * Redistributions in binary form must reproduce the above
03084 // copyright notice, this list of conditions and the following disclaimer
03085 // in the documentation and/or other materials provided with the
03086 // distribution.
03087 //     * Neither the name of Google Inc. nor the names of its
03088 // contributors may be used to endorse or promote products derived from
03089 // this software without specific prior written permission.
03090 //
03091 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
03092 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
03093 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
03094 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
03095 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
03096 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
03097 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
03098 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
03099 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
03100 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
03101 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
03102 //
03103 // Author: wan@google.com (Zhanyong Wan)
03104 //
03105 // The Google C++ Testing Framework (Google Test)
03106 //
03107 // This header file defines the Message class.
03108 //
03109 // IMPORTANT NOTE: Due to limitation of the C++ language, we have to
03110 // leave some internal implementation details in this header file.
03111 // They are clearly marked by comments like this:
03112 //
03113 //   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
03114 //
03115 // Such code is NOT meant to be used by a user directly, and is subject
03116 // to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
03117 // program!
03118 
03119 #ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
03120 #define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
03121 
03122 #include <limits>
03123 
03124 
03125 // Ensures that there is at least one operator<< in the global namespace.
03126 // See Message& operator<<(...) below for why.
03127 void operator<<(const testing::internal::Secret&, int);
03128 
03129 namespace testing {
03130 
03131 // The Message class works like an ostream repeater.
03132 //
03133 // Typical usage:
03134 //
03135 //   1. You stream a bunch of values to a Message object.
03136 //      It will remember the text in a stringstream.
03137 //   2. Then you stream the Message object to an ostream.
03138 //      This causes the text in the Message to be streamed
03139 //      to the ostream.
03140 //
03141 // For example;
03142 //
03143 //   testing::Message foo;
03144 //   foo << 1 << " != " << 2;
03145 //   std::cout << foo;
03146 //
03147 // will print "1 != 2".
03148 //
03149 // Message is not intended to be inherited from.  In particular, its
03150 // destructor is not virtual.
03151 //
03152 // Note that stringstream behaves differently in gcc and in MSVC.  You
03153 // can stream a NULL char pointer to it in the former, but not in the
03154 // latter (it causes an access violation if you do).  The Message
03155 // class hides this difference by treating a NULL char pointer as
03156 // "(null)".
03157 class GTEST_API_ Message {
03158  private:
03159   // The type of basic IO manipulators (endl, ends, and flush) for
03160   // narrow streams.
03161   typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
03162 
03163  public:
03164   // Constructs an empty Message.
03165   Message();
03166 
03167   // Copy constructor.
03168   Message(const Message& msg) : ss_(new ::std::stringstream) {  // NOLINT
03169     *ss_ << msg.GetString();
03170   }
03171 
03172   // Constructs a Message from a C-string.
03173   explicit Message(const char* str) : ss_(new ::std::stringstream) {
03174     *ss_ << str;
03175   }
03176 
03177 #if GTEST_OS_SYMBIAN
03178   // Streams a value (either a pointer or not) to this object.
03179   template <typename T>
03180   inline Message& operator <<(const T& value) {
03181     StreamHelper(typename internal::is_pointer<T>::type(), value);
03182     return *this;
03183   }
03184 #else
03185   // Streams a non-pointer value to this object.
03186   template <typename T>
03187   inline Message& operator <<(const T& val) {
03188     // Some libraries overload << for STL containers.  These
03189     // overloads are defined in the global namespace instead of ::std.
03190     //
03191     // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
03192     // overloads are visible in either the std namespace or the global
03193     // namespace, but not other namespaces, including the testing
03194     // namespace which Google Test's Message class is in.
03195     //
03196     // To allow STL containers (and other types that has a << operator
03197     // defined in the global namespace) to be used in Google Test
03198     // assertions, testing::Message must access the custom << operator
03199     // from the global namespace.  With this using declaration,
03200     // overloads of << defined in the global namespace and those
03201     // visible via Koenig lookup are both exposed in this function.
03202     using ::operator <<;
03203     *ss_ << val;
03204     return *this;
03205   }
03206 
03207   // Streams a pointer value to this object.
03208   //
03209   // This function is an overload of the previous one.  When you
03210   // stream a pointer to a Message, this definition will be used as it
03211   // is more specialized.  (The C++ Standard, section
03212   // [temp.func.order].)  If you stream a non-pointer, then the
03213   // previous definition will be used.
03214   //
03215   // The reason for this overload is that streaming a NULL pointer to
03216   // ostream is undefined behavior.  Depending on the compiler, you
03217   // may get "0", "(nil)", "(null)", or an access violation.  To
03218   // ensure consistent result across compilers, we always treat NULL
03219   // as "(null)".
03220   template <typename T>
03221   inline Message& operator <<(T* const& pointer) {  // NOLINT
03222     if (pointer == NULL) {
03223       *ss_ << "(null)";
03224     } else {
03225       *ss_ << pointer;
03226     }
03227     return *this;
03228   }
03229 #endif  // GTEST_OS_SYMBIAN
03230 
03231   // Since the basic IO manipulators are overloaded for both narrow
03232   // and wide streams, we have to provide this specialized definition
03233   // of operator <<, even though its body is the same as the
03234   // templatized version above.  Without this definition, streaming
03235   // endl or other basic IO manipulators to Message will confuse the
03236   // compiler.
03237   Message& operator <<(BasicNarrowIoManip val) {
03238     *ss_ << val;
03239     return *this;
03240   }
03241 
03242   // Instead of 1/0, we want to see true/false for bool values.
03243   Message& operator <<(bool b) {
03244     return *this << (b ? "true" : "false");
03245   }
03246 
03247   // These two overloads allow streaming a wide C string to a Message
03248   // using the UTF-8 encoding.
03249   Message& operator <<(const wchar_t* wide_c_str);
03250   Message& operator <<(wchar_t* wide_c_str);
03251 
03252 #if GTEST_HAS_STD_WSTRING
03253   // Converts the given wide string to a narrow string using the UTF-8
03254   // encoding, and streams the result to this Message object.
03255   Message& operator <<(const ::std::wstring& wstr);
03256 #endif  // GTEST_HAS_STD_WSTRING
03257 
03258 #if GTEST_HAS_GLOBAL_WSTRING
03259   // Converts the given wide string to a narrow string using the UTF-8
03260   // encoding, and streams the result to this Message object.
03261   Message& operator <<(const ::wstring& wstr);
03262 #endif  // GTEST_HAS_GLOBAL_WSTRING
03263 
03264   // Gets the text streamed to this object so far as an std::string.
03265   // Each '\0' character in the buffer is replaced with "\\0".
03266   //
03267   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
03268   std::string GetString() const;
03269 
03270  private:
03271 
03272 #if GTEST_OS_SYMBIAN
03273   // These are needed as the Nokia Symbian Compiler cannot decide between
03274   // const T& and const T* in a function template. The Nokia compiler _can_
03275   // decide between class template specializations for T and T*, so a
03276   // tr1::type_traits-like is_pointer works, and we can overload on that.
03277   template <typename T>
03278   inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
03279     if (pointer == NULL) {
03280       *ss_ << "(null)";
03281     } else {
03282       *ss_ << pointer;
03283     }
03284   }
03285   template <typename T>
03286   inline void StreamHelper(internal::false_type /*is_pointer*/,
03287                            const T& value) {
03288     // See the comments in Message& operator <<(const T&) above for why
03289     // we need this using statement.
03290     using ::operator <<;
03291     *ss_ << value;
03292   }
03293 #endif  // GTEST_OS_SYMBIAN
03294 
03295   // We'll hold the text streamed to this object here.
03296   const internal::scoped_ptr< ::std::stringstream> ss_;
03297 
03298   // We declare (but don't implement) this to prevent the compiler
03299   // from implementing the assignment operator.
03300   void operator=(const Message&);
03301 };
03302 
03303 // Streams a Message to an ostream.
03304 inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
03305   return os << sb.GetString();
03306 }
03307 
03308 namespace internal {
03309 
03310 // Converts a streamable value to an std::string.  A NULL pointer is
03311 // converted to "(null)".  When the input value is a ::string,
03312 // ::std::string, ::wstring, or ::std::wstring object, each NUL
03313 // character in it is replaced with "\\0".
03314 template <typename T>
03315 std::string StreamableToString(const T& streamable) {
03316   return (Message() << streamable).GetString();
03317 }
03318 
03319 }  // namespace internal
03320 }  // namespace testing
03321 
03322 #endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
03323 // Copyright 2005, Google Inc.
03324 // All rights reserved.
03325 //
03326 // Redistribution and use in source and binary forms, with or without
03327 // modification, are permitted provided that the following conditions are
03328 // met:
03329 //
03330 //     * Redistributions of source code must retain the above copyright
03331 // notice, this list of conditions and the following disclaimer.
03332 //     * Redistributions in binary form must reproduce the above
03333 // copyright notice, this list of conditions and the following disclaimer
03334 // in the documentation and/or other materials provided with the
03335 // distribution.
03336 //     * Neither the name of Google Inc. nor the names of its
03337 // contributors may be used to endorse or promote products derived from
03338 // this software without specific prior written permission.
03339 //
03340 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
03341 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
03342 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
03343 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
03344 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
03345 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
03346 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
03347 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
03348 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
03349 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
03350 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
03351 //
03352 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
03353 //
03354 // The Google C++ Testing Framework (Google Test)
03355 //
03356 // This header file declares the String class and functions used internally by
03357 // Google Test.  They are subject to change without notice. They should not used
03358 // by code external to Google Test.
03359 //
03360 // This header file is #included by <gtest/internal/gtest-internal.h>.
03361 // It should not be #included by other files.
03362 
03363 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
03364 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
03365 
03366 #ifdef __BORLANDC__
03367 // string.h is not guaranteed to provide strcpy on C++ Builder.
03368 # include <mem.h>
03369 #endif
03370 
03371 #include <string.h>
03372 #include <string>
03373 
03374 
03375 namespace testing {
03376 namespace internal {
03377 
03378 // String - an abstract class holding static string utilities.
03379 class GTEST_API_ String {
03380  public:
03381   // Static utility methods
03382 
03383   // Clones a 0-terminated C string, allocating memory using new.  The
03384   // caller is responsible for deleting the return value using
03385   // delete[].  Returns the cloned string, or NULL if the input is
03386   // NULL.
03387   //
03388   // This is different from strdup() in string.h, which allocates
03389   // memory using malloc().
03390   static const char* CloneCString(const char* c_str);
03391 
03392 #if GTEST_OS_WINDOWS_MOBILE
03393   // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
03394   // able to pass strings to Win32 APIs on CE we need to convert them
03395   // to 'Unicode', UTF-16.
03396 
03397   // Creates a UTF-16 wide string from the given ANSI string, allocating
03398   // memory using new. The caller is responsible for deleting the return
03399   // value using delete[]. Returns the wide string, or NULL if the
03400   // input is NULL.
03401   //
03402   // The wide string is created using the ANSI codepage (CP_ACP) to
03403   // match the behaviour of the ANSI versions of Win32 calls and the
03404   // C runtime.
03405   static LPCWSTR AnsiToUtf16(const char* c_str);
03406 
03407   // Creates an ANSI string from the given wide string, allocating
03408   // memory using new. The caller is responsible for deleting the return
03409   // value using delete[]. Returns the ANSI string, or NULL if the
03410   // input is NULL.
03411   //
03412   // The returned string is created using the ANSI codepage (CP_ACP) to
03413   // match the behaviour of the ANSI versions of Win32 calls and the
03414   // C runtime.
03415   static const char* Utf16ToAnsi(LPCWSTR utf16_str);
03416 #endif
03417 
03418   // Compares two C strings.  Returns true iff they have the same content.
03419   //
03420   // Unlike strcmp(), this function can handle NULL argument(s).  A
03421   // NULL C string is considered different to any non-NULL C string,
03422   // including the empty string.
03423   static bool CStringEquals(const char* lhs, const char* rhs);
03424 
03425   // Converts a wide C string to a String using the UTF-8 encoding.
03426   // NULL will be converted to "(null)".  If an error occurred during
03427   // the conversion, "(failed to convert from wide string)" is
03428   // returned.
03429   static std::string ShowWideCString(const wchar_t* wide_c_str);
03430 
03431   // Compares two wide C strings.  Returns true iff they have the same
03432   // content.
03433   //
03434   // Unlike wcscmp(), this function can handle NULL argument(s).  A
03435   // NULL C string is considered different to any non-NULL C string,
03436   // including the empty string.
03437   static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
03438 
03439   // Compares two C strings, ignoring case.  Returns true iff they
03440   // have the same content.
03441   //
03442   // Unlike strcasecmp(), this function can handle NULL argument(s).
03443   // A NULL C string is considered different to any non-NULL C string,
03444   // including the empty string.
03445   static bool CaseInsensitiveCStringEquals(const char* lhs,
03446                                            const char* rhs);
03447 
03448   // Compares two wide C strings, ignoring case.  Returns true iff they
03449   // have the same content.
03450   //
03451   // Unlike wcscasecmp(), this function can handle NULL argument(s).
03452   // A NULL C string is considered different to any non-NULL wide C string,
03453   // including the empty string.
03454   // NB: The implementations on different platforms slightly differ.
03455   // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
03456   // environment variable. On GNU platform this method uses wcscasecmp
03457   // which compares according to LC_CTYPE category of the current locale.
03458   // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
03459   // current locale.
03460   static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
03461                                                const wchar_t* rhs);
03462 
03463   // Returns true iff the given string ends with the given suffix, ignoring
03464   // case. Any string is considered to end with an empty suffix.
03465   static bool EndsWithCaseInsensitive(
03466       const std::string& str, const std::string& suffix);
03467 
03468   // Formats an int value as "%02d".
03469   static std::string FormatIntWidth2(int value);  // "%02d" for width == 2
03470 
03471   // Formats an int value as "%X".
03472   static std::string FormatHexInt(int value);
03473 
03474   // Formats a byte as "%02X".
03475   static std::string FormatByte(unsigned char value);
03476 
03477  private:
03478   String();  // Not meant to be instantiated.
03479 };  // class String
03480 
03481 // Gets the content of the stringstream's buffer as an std::string.  Each '\0'
03482 // character in the buffer is replaced with "\\0".
03483 GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
03484 
03485 }  // namespace internal
03486 }  // namespace testing
03487 
03488 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
03489 // Copyright 2008, Google Inc.
03490 // All rights reserved.
03491 //
03492 // Redistribution and use in source and binary forms, with or without
03493 // modification, are permitted provided that the following conditions are
03494 // met:
03495 //
03496 //     * Redistributions of source code must retain the above copyright
03497 // notice, this list of conditions and the following disclaimer.
03498 //     * Redistributions in binary form must reproduce the above
03499 // copyright notice, this list of conditions and the following disclaimer
03500 // in the documentation and/or other materials provided with the
03501 // distribution.
03502 //     * Neither the name of Google Inc. nor the names of its
03503 // contributors may be used to endorse or promote products derived from
03504 // this software without specific prior written permission.
03505 //
03506 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
03507 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
03508 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
03509 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
03510 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
03511 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
03512 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
03513 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
03514 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
03515 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
03516 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
03517 //
03518 // Author: keith.ray@gmail.com (Keith Ray)
03519 //
03520 // Google Test filepath utilities
03521 //
03522 // This header file declares classes and functions used internally by
03523 // Google Test.  They are subject to change without notice.
03524 //
03525 // This file is #included in <gtest/internal/gtest-internal.h>.
03526 // Do not include this header file separately!
03527 
03528 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
03529 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
03530 
03531 
03532 namespace testing {
03533 namespace internal {
03534 
03535 // FilePath - a class for file and directory pathname manipulation which
03536 // handles platform-specific conventions (like the pathname separator).
03537 // Used for helper functions for naming files in a directory for xml output.
03538 // Except for Set methods, all methods are const or static, which provides an
03539 // "immutable value object" -- useful for peace of mind.
03540 // A FilePath with a value ending in a path separator ("like/this/") represents
03541 // a directory, otherwise it is assumed to represent a file. In either case,
03542 // it may or may not represent an actual file or directory in the file system.
03543 // Names are NOT checked for syntax correctness -- no checking for illegal
03544 // characters, malformed paths, etc.
03545 
03546 class GTEST_API_ FilePath {
03547  public:
03548   FilePath() : pathname_("") { }
03549   FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
03550 
03551   explicit FilePath(const std::string& pathname) : pathname_(pathname) {
03552     Normalize();
03553   }
03554 
03555   FilePath& operator=(const FilePath& rhs) {
03556     Set(rhs);
03557     return *this;
03558   }
03559 
03560   void Set(const FilePath& rhs) {
03561     pathname_ = rhs.pathname_;
03562   }
03563 
03564   const std::string& string() const { return pathname_; }
03565   const char* c_str() const { return pathname_.c_str(); }
03566 
03567   // Returns the current working directory, or "" if unsuccessful.
03568   static FilePath GetCurrentDir();
03569 
03570   // Given directory = "dir", base_name = "test", number = 0,
03571   // extension = "xml", returns "dir/test.xml". If number is greater
03572   // than zero (e.g., 12), returns "dir/test_12.xml".
03573   // On Windows platform, uses \ as the separator rather than /.
03574   static FilePath MakeFileName(const FilePath& directory,
03575                                const FilePath& base_name,
03576                                int number,
03577                                const char* extension);
03578 
03579   // Given directory = "dir", relative_path = "test.xml",
03580   // returns "dir/test.xml".
03581   // On Windows, uses \ as the separator rather than /.
03582   static FilePath ConcatPaths(const FilePath& directory,
03583                               const FilePath& relative_path);
03584 
03585   // Returns a pathname for a file that does not currently exist. The pathname
03586   // will be directory/base_name.extension or
03587   // directory/base_name_<number>.extension if directory/base_name.extension
03588   // already exists. The number will be incremented until a pathname is found
03589   // that does not already exist.
03590   // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
03591   // There could be a race condition if two or more processes are calling this
03592   // function at the same time -- they could both pick the same filename.
03593   static FilePath GenerateUniqueFileName(const FilePath& directory,
03594                                          const FilePath& base_name,
03595                                          const char* extension);
03596 
03597   // Returns true iff the path is "".
03598   bool IsEmpty() const { return pathname_.empty(); }
03599 
03600   // If input name has a trailing separator character, removes it and returns
03601   // the name, otherwise return the name string unmodified.
03602   // On Windows platform, uses \ as the separator, other platforms use /.
03603   FilePath RemoveTrailingPathSeparator() const;
03604 
03605   // Returns a copy of the FilePath with the directory part removed.
03606   // Example: FilePath("path/to/file").RemoveDirectoryName() returns
03607   // FilePath("file"). If there is no directory part ("just_a_file"), it returns
03608   // the FilePath unmodified. If there is no file part ("just_a_dir/") it
03609   // returns an empty FilePath ("").
03610   // On Windows platform, '\' is the path separator, otherwise it is '/'.
03611   FilePath RemoveDirectoryName() const;
03612 
03613   // RemoveFileName returns the directory path with the filename removed.
03614   // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
03615   // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
03616   // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
03617   // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
03618   // On Windows platform, '\' is the path separator, otherwise it is '/'.
03619   FilePath RemoveFileName() const;
03620 
03621   // Returns a copy of the FilePath with the case-insensitive extension removed.
03622   // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
03623   // FilePath("dir/file"). If a case-insensitive extension is not
03624   // found, returns a copy of the original FilePath.
03625   FilePath RemoveExtension(const char* extension) const;
03626 
03627   // Creates directories so that path exists. Returns true if successful or if
03628   // the directories already exist; returns false if unable to create
03629   // directories for any reason. Will also return false if the FilePath does
03630   // not represent a directory (that is, it doesn't end with a path separator).
03631   bool CreateDirectoriesRecursively() const;
03632 
03633   // Create the directory so that path exists. Returns true if successful or
03634   // if the directory already exists; returns false if unable to create the
03635   // directory for any reason, including if the parent directory does not
03636   // exist. Not named "CreateDirectory" because that's a macro on Windows.
03637   bool CreateFolder() const;
03638 
03639   // Returns true if FilePath describes something in the file-system,
03640   // either a file, directory, or whatever, and that something exists.
03641   bool FileOrDirectoryExists() const;
03642 
03643   // Returns true if pathname describes a directory in the file-system
03644   // that exists.
03645   bool DirectoryExists() const;
03646 
03647   // Returns true if FilePath ends with a path separator, which indicates that
03648   // it is intended to represent a directory. Returns false otherwise.
03649   // This does NOT check that a directory (or file) actually exists.
03650   bool IsDirectory() const;
03651 
03652   // Returns true if pathname describes a root directory. (Windows has one
03653   // root directory per disk drive.)
03654   bool IsRootDirectory() const;
03655 
03656   // Returns true if pathname describes an absolute path.
03657   bool IsAbsolutePath() const;
03658 
03659  private:
03660   // Replaces multiple consecutive separators with a single separator.
03661   // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
03662   // redundancies that might be in a pathname involving "." or "..".
03663   //
03664   // A pathname with multiple consecutive separators may occur either through
03665   // user error or as a result of some scripts or APIs that generate a pathname
03666   // with a trailing separator. On other platforms the same API or script
03667   // may NOT generate a pathname with a trailing "/". Then elsewhere that
03668   // pathname may have another "/" and pathname components added to it,
03669   // without checking for the separator already being there.
03670   // The script language and operating system may allow paths like "foo//bar"
03671   // but some of the functions in FilePath will not handle that correctly. In
03672   // particular, RemoveTrailingPathSeparator() only removes one separator, and
03673   // it is called in CreateDirectoriesRecursively() assuming that it will change
03674   // a pathname from directory syntax (trailing separator) to filename syntax.
03675   //
03676   // On Windows this method also replaces the alternate path separator '/' with
03677   // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
03678   // "bar\\foo".
03679 
03680   void Normalize();
03681 
03682   // Returns a pointer to the last occurence of a valid path separator in
03683   // the FilePath. On Windows, for example, both '/' and '\' are valid path
03684   // separators. Returns NULL if no path separator was found.
03685   const char* FindLastPathSeparator() const;
03686 
03687   std::string pathname_;
03688 };  // class FilePath
03689 
03690 }  // namespace internal
03691 }  // namespace testing
03692 
03693 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
03694 // This file was GENERATED by command:
03695 //     pump.py gtest-type-util.h.pump
03696 // DO NOT EDIT BY HAND!!!
03697 
03698 // Copyright 2008 Google Inc.
03699 // All Rights Reserved.
03700 //
03701 // Redistribution and use in source and binary forms, with or without
03702 // modification, are permitted provided that the following conditions are
03703 // met:
03704 //
03705 //     * Redistributions of source code must retain the above copyright
03706 // notice, this list of conditions and the following disclaimer.
03707 //     * Redistributions in binary form must reproduce the above
03708 // copyright notice, this list of conditions and the following disclaimer
03709 // in the documentation and/or other materials provided with the
03710 // distribution.
03711 //     * Neither the name of Google Inc. nor the names of its
03712 // contributors may be used to endorse or promote products derived from
03713 // this software without specific prior written permission.
03714 //
03715 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
03716 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
03717 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
03718 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
03719 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
03720 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
03721 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
03722 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
03723 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
03724 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
03725 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
03726 //
03727 // Author: wan@google.com (Zhanyong Wan)
03728 
03729 // Type utilities needed for implementing typed and type-parameterized
03730 // tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
03731 //
03732 // Currently we support at most 50 types in a list, and at most 50
03733 // type-parameterized tests in one type-parameterized test case.
03734 // Please contact googletestframework@googlegroups.com if you need
03735 // more.
03736 
03737 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
03738 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
03739 
03740 
03741 // #ifdef __GNUC__ is too general here.  It is possible to use gcc without using
03742 // libstdc++ (which is where cxxabi.h comes from).
03743 # if GTEST_HAS_CXXABI_H_
03744 #  include <cxxabi.h>
03745 # elif defined(__HP_aCC)
03746 #  include <acxx_demangle.h>
03747 # endif  // GTEST_HASH_CXXABI_H_
03748 
03749 namespace testing {
03750 namespace internal {
03751 
03752 // GetTypeName<T>() returns a human-readable name of type T.
03753 // NB: This function is also used in Google Mock, so don't move it inside of
03754 // the typed-test-only section below.
03755 template <typename T>
03756 std::string GetTypeName() {
03757 # if GTEST_HAS_RTTI
03758 
03759   const char* const name = typeid(T).name();
03760 #  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
03761   int status = 0;
03762   // gcc's implementation of typeid(T).name() mangles the type name,
03763   // so we have to demangle it.
03764 #   if GTEST_HAS_CXXABI_H_
03765   using abi::__cxa_demangle;
03766 #   endif  // GTEST_HAS_CXXABI_H_
03767   char* const readable_name = __cxa_demangle(name, 0, 0, &status);
03768   const std::string name_str(status == 0 ? readable_name : name);
03769   free(readable_name);
03770   return name_str;
03771 #  else
03772   return name;
03773 #  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC
03774 
03775 # else
03776 
03777   return "<type>";
03778 
03779 # endif  // GTEST_HAS_RTTI
03780 }
03781 
03782 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
03783 
03784 // AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
03785 // type.  This can be used as a compile-time assertion to ensure that
03786 // two types are equal.
03787 
03788 template <typename T1, typename T2>
03789 struct AssertTypeEq;
03790 
03791 template <typename T>
03792 struct AssertTypeEq<T, T> {
03793   typedef bool type;
03794 };
03795 
03796 // A unique type used as the default value for the arguments of class
03797 // template Types.  This allows us to simulate variadic templates
03798 // (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
03799 // support directly.
03800 struct None {};
03801 
03802 // The following family of struct and struct templates are used to
03803 // represent type lists.  In particular, TypesN<T1, T2, ..., TN>
03804 // represents a type list with N types (T1, T2, ..., and TN) in it.
03805 // Except for Types0, every struct in the family has two member types:
03806 // Head for the first type in the list, and Tail for the rest of the
03807 // list.
03808 
03809 // The empty type list.
03810 struct Types0 {};
03811 
03812 // Type lists of length 1, 2, 3, and so on.
03813 
03814 template <typename T1>
03815 struct Types1 {
03816   typedef T1 Head;
03817   typedef Types0 Tail;
03818 };
03819 template <typename T1, typename T2>
03820 struct Types2 {
03821   typedef T1 Head;
03822   typedef Types1<T2> Tail;
03823 };
03824 
03825 template <typename T1, typename T2, typename T3>
03826 struct Types3 {
03827   typedef T1 Head;
03828   typedef Types2<T2, T3> Tail;
03829 };
03830 
03831 template <typename T1, typename T2, typename T3, typename T4>
03832 struct Types4 {
03833   typedef T1 Head;
03834   typedef Types3<T2, T3, T4> Tail;
03835 };
03836 
03837 template <typename T1, typename T2, typename T3, typename T4, typename T5>
03838 struct Types5 {
03839   typedef T1 Head;
03840   typedef Types4<T2, T3, T4, T5> Tail;
03841 };
03842 
03843 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03844     typename T6>
03845 struct Types6 {
03846   typedef T1 Head;
03847   typedef Types5<T2, T3, T4, T5, T6> Tail;
03848 };
03849 
03850 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03851     typename T6, typename T7>
03852 struct Types7 {
03853   typedef T1 Head;
03854   typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
03855 };
03856 
03857 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03858     typename T6, typename T7, typename T8>
03859 struct Types8 {
03860   typedef T1 Head;
03861   typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
03862 };
03863 
03864 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03865     typename T6, typename T7, typename T8, typename T9>
03866 struct Types9 {
03867   typedef T1 Head;
03868   typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
03869 };
03870 
03871 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03872     typename T6, typename T7, typename T8, typename T9, typename T10>
03873 struct Types10 {
03874   typedef T1 Head;
03875   typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
03876 };
03877 
03878 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03879     typename T6, typename T7, typename T8, typename T9, typename T10,
03880     typename T11>
03881 struct Types11 {
03882   typedef T1 Head;
03883   typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
03884 };
03885 
03886 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03887     typename T6, typename T7, typename T8, typename T9, typename T10,
03888     typename T11, typename T12>
03889 struct Types12 {
03890   typedef T1 Head;
03891   typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
03892 };
03893 
03894 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03895     typename T6, typename T7, typename T8, typename T9, typename T10,
03896     typename T11, typename T12, typename T13>
03897 struct Types13 {
03898   typedef T1 Head;
03899   typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
03900 };
03901 
03902 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03903     typename T6, typename T7, typename T8, typename T9, typename T10,
03904     typename T11, typename T12, typename T13, typename T14>
03905 struct Types14 {
03906   typedef T1 Head;
03907   typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
03908 };
03909 
03910 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03911     typename T6, typename T7, typename T8, typename T9, typename T10,
03912     typename T11, typename T12, typename T13, typename T14, typename T15>
03913 struct Types15 {
03914   typedef T1 Head;
03915   typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
03916       T15> Tail;
03917 };
03918 
03919 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03920     typename T6, typename T7, typename T8, typename T9, typename T10,
03921     typename T11, typename T12, typename T13, typename T14, typename T15,
03922     typename T16>
03923 struct Types16 {
03924   typedef T1 Head;
03925   typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03926       T16> Tail;
03927 };
03928 
03929 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03930     typename T6, typename T7, typename T8, typename T9, typename T10,
03931     typename T11, typename T12, typename T13, typename T14, typename T15,
03932     typename T16, typename T17>
03933 struct Types17 {
03934   typedef T1 Head;
03935   typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03936       T16, T17> Tail;
03937 };
03938 
03939 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03940     typename T6, typename T7, typename T8, typename T9, typename T10,
03941     typename T11, typename T12, typename T13, typename T14, typename T15,
03942     typename T16, typename T17, typename T18>
03943 struct Types18 {
03944   typedef T1 Head;
03945   typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03946       T16, T17, T18> Tail;
03947 };
03948 
03949 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03950     typename T6, typename T7, typename T8, typename T9, typename T10,
03951     typename T11, typename T12, typename T13, typename T14, typename T15,
03952     typename T16, typename T17, typename T18, typename T19>
03953 struct Types19 {
03954   typedef T1 Head;
03955   typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03956       T16, T17, T18, T19> Tail;
03957 };
03958 
03959 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03960     typename T6, typename T7, typename T8, typename T9, typename T10,
03961     typename T11, typename T12, typename T13, typename T14, typename T15,
03962     typename T16, typename T17, typename T18, typename T19, typename T20>
03963 struct Types20 {
03964   typedef T1 Head;
03965   typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03966       T16, T17, T18, T19, T20> Tail;
03967 };
03968 
03969 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03970     typename T6, typename T7, typename T8, typename T9, typename T10,
03971     typename T11, typename T12, typename T13, typename T14, typename T15,
03972     typename T16, typename T17, typename T18, typename T19, typename T20,
03973     typename T21>
03974 struct Types21 {
03975   typedef T1 Head;
03976   typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03977       T16, T17, T18, T19, T20, T21> Tail;
03978 };
03979 
03980 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03981     typename T6, typename T7, typename T8, typename T9, typename T10,
03982     typename T11, typename T12, typename T13, typename T14, typename T15,
03983     typename T16, typename T17, typename T18, typename T19, typename T20,
03984     typename T21, typename T22>
03985 struct Types22 {
03986   typedef T1 Head;
03987   typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03988       T16, T17, T18, T19, T20, T21, T22> Tail;
03989 };
03990 
03991 template <typename T1, typename T2, typename T3, typename T4, typename T5,
03992     typename T6, typename T7, typename T8, typename T9, typename T10,
03993     typename T11, typename T12, typename T13, typename T14, typename T15,
03994     typename T16, typename T17, typename T18, typename T19, typename T20,
03995     typename T21, typename T22, typename T23>
03996 struct Types23 {
03997   typedef T1 Head;
03998   typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
03999       T16, T17, T18, T19, T20, T21, T22, T23> Tail;
04000 };
04001 
04002 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04003     typename T6, typename T7, typename T8, typename T9, typename T10,
04004     typename T11, typename T12, typename T13, typename T14, typename T15,
04005     typename T16, typename T17, typename T18, typename T19, typename T20,
04006     typename T21, typename T22, typename T23, typename T24>
04007 struct Types24 {
04008   typedef T1 Head;
04009   typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04010       T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
04011 };
04012 
04013 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04014     typename T6, typename T7, typename T8, typename T9, typename T10,
04015     typename T11, typename T12, typename T13, typename T14, typename T15,
04016     typename T16, typename T17, typename T18, typename T19, typename T20,
04017     typename T21, typename T22, typename T23, typename T24, typename T25>
04018 struct Types25 {
04019   typedef T1 Head;
04020   typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04021       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
04022 };
04023 
04024 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04025     typename T6, typename T7, typename T8, typename T9, typename T10,
04026     typename T11, typename T12, typename T13, typename T14, typename T15,
04027     typename T16, typename T17, typename T18, typename T19, typename T20,
04028     typename T21, typename T22, typename T23, typename T24, typename T25,
04029     typename T26>
04030 struct Types26 {
04031   typedef T1 Head;
04032   typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04033       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
04034 };
04035 
04036 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04037     typename T6, typename T7, typename T8, typename T9, typename T10,
04038     typename T11, typename T12, typename T13, typename T14, typename T15,
04039     typename T16, typename T17, typename T18, typename T19, typename T20,
04040     typename T21, typename T22, typename T23, typename T24, typename T25,
04041     typename T26, typename T27>
04042 struct Types27 {
04043   typedef T1 Head;
04044   typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04045       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
04046 };
04047 
04048 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04049     typename T6, typename T7, typename T8, typename T9, typename T10,
04050     typename T11, typename T12, typename T13, typename T14, typename T15,
04051     typename T16, typename T17, typename T18, typename T19, typename T20,
04052     typename T21, typename T22, typename T23, typename T24, typename T25,
04053     typename T26, typename T27, typename T28>
04054 struct Types28 {
04055   typedef T1 Head;
04056   typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04057       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
04058 };
04059 
04060 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04061     typename T6, typename T7, typename T8, typename T9, typename T10,
04062     typename T11, typename T12, typename T13, typename T14, typename T15,
04063     typename T16, typename T17, typename T18, typename T19, typename T20,
04064     typename T21, typename T22, typename T23, typename T24, typename T25,
04065     typename T26, typename T27, typename T28, typename T29>
04066 struct Types29 {
04067   typedef T1 Head;
04068   typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04069       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
04070       T29> Tail;
04071 };
04072 
04073 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04074     typename T6, typename T7, typename T8, typename T9, typename T10,
04075     typename T11, typename T12, typename T13, typename T14, typename T15,
04076     typename T16, typename T17, typename T18, typename T19, typename T20,
04077     typename T21, typename T22, typename T23, typename T24, typename T25,
04078     typename T26, typename T27, typename T28, typename T29, typename T30>
04079 struct Types30 {
04080   typedef T1 Head;
04081   typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04082       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04083       T30> Tail;
04084 };
04085 
04086 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04087     typename T6, typename T7, typename T8, typename T9, typename T10,
04088     typename T11, typename T12, typename T13, typename T14, typename T15,
04089     typename T16, typename T17, typename T18, typename T19, typename T20,
04090     typename T21, typename T22, typename T23, typename T24, typename T25,
04091     typename T26, typename T27, typename T28, typename T29, typename T30,
04092     typename T31>
04093 struct Types31 {
04094   typedef T1 Head;
04095   typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04096       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04097       T30, T31> Tail;
04098 };
04099 
04100 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04101     typename T6, typename T7, typename T8, typename T9, typename T10,
04102     typename T11, typename T12, typename T13, typename T14, typename T15,
04103     typename T16, typename T17, typename T18, typename T19, typename T20,
04104     typename T21, typename T22, typename T23, typename T24, typename T25,
04105     typename T26, typename T27, typename T28, typename T29, typename T30,
04106     typename T31, typename T32>
04107 struct Types32 {
04108   typedef T1 Head;
04109   typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04110       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04111       T30, T31, T32> Tail;
04112 };
04113 
04114 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04115     typename T6, typename T7, typename T8, typename T9, typename T10,
04116     typename T11, typename T12, typename T13, typename T14, typename T15,
04117     typename T16, typename T17, typename T18, typename T19, typename T20,
04118     typename T21, typename T22, typename T23, typename T24, typename T25,
04119     typename T26, typename T27, typename T28, typename T29, typename T30,
04120     typename T31, typename T32, typename T33>
04121 struct Types33 {
04122   typedef T1 Head;
04123   typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04124       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04125       T30, T31, T32, T33> Tail;
04126 };
04127 
04128 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04129     typename T6, typename T7, typename T8, typename T9, typename T10,
04130     typename T11, typename T12, typename T13, typename T14, typename T15,
04131     typename T16, typename T17, typename T18, typename T19, typename T20,
04132     typename T21, typename T22, typename T23, typename T24, typename T25,
04133     typename T26, typename T27, typename T28, typename T29, typename T30,
04134     typename T31, typename T32, typename T33, typename T34>
04135 struct Types34 {
04136   typedef T1 Head;
04137   typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04138       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04139       T30, T31, T32, T33, T34> Tail;
04140 };
04141 
04142 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04143     typename T6, typename T7, typename T8, typename T9, typename T10,
04144     typename T11, typename T12, typename T13, typename T14, typename T15,
04145     typename T16, typename T17, typename T18, typename T19, typename T20,
04146     typename T21, typename T22, typename T23, typename T24, typename T25,
04147     typename T26, typename T27, typename T28, typename T29, typename T30,
04148     typename T31, typename T32, typename T33, typename T34, typename T35>
04149 struct Types35 {
04150   typedef T1 Head;
04151   typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04152       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04153       T30, T31, T32, T33, T34, T35> Tail;
04154 };
04155 
04156 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04157     typename T6, typename T7, typename T8, typename T9, typename T10,
04158     typename T11, typename T12, typename T13, typename T14, typename T15,
04159     typename T16, typename T17, typename T18, typename T19, typename T20,
04160     typename T21, typename T22, typename T23, typename T24, typename T25,
04161     typename T26, typename T27, typename T28, typename T29, typename T30,
04162     typename T31, typename T32, typename T33, typename T34, typename T35,
04163     typename T36>
04164 struct Types36 {
04165   typedef T1 Head;
04166   typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04167       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04168       T30, T31, T32, T33, T34, T35, T36> Tail;
04169 };
04170 
04171 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04172     typename T6, typename T7, typename T8, typename T9, typename T10,
04173     typename T11, typename T12, typename T13, typename T14, typename T15,
04174     typename T16, typename T17, typename T18, typename T19, typename T20,
04175     typename T21, typename T22, typename T23, typename T24, typename T25,
04176     typename T26, typename T27, typename T28, typename T29, typename T30,
04177     typename T31, typename T32, typename T33, typename T34, typename T35,
04178     typename T36, typename T37>
04179 struct Types37 {
04180   typedef T1 Head;
04181   typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04182       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04183       T30, T31, T32, T33, T34, T35, T36, T37> Tail;
04184 };
04185 
04186 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04187     typename T6, typename T7, typename T8, typename T9, typename T10,
04188     typename T11, typename T12, typename T13, typename T14, typename T15,
04189     typename T16, typename T17, typename T18, typename T19, typename T20,
04190     typename T21, typename T22, typename T23, typename T24, typename T25,
04191     typename T26, typename T27, typename T28, typename T29, typename T30,
04192     typename T31, typename T32, typename T33, typename T34, typename T35,
04193     typename T36, typename T37, typename T38>
04194 struct Types38 {
04195   typedef T1 Head;
04196   typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04197       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04198       T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
04199 };
04200 
04201 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04202     typename T6, typename T7, typename T8, typename T9, typename T10,
04203     typename T11, typename T12, typename T13, typename T14, typename T15,
04204     typename T16, typename T17, typename T18, typename T19, typename T20,
04205     typename T21, typename T22, typename T23, typename T24, typename T25,
04206     typename T26, typename T27, typename T28, typename T29, typename T30,
04207     typename T31, typename T32, typename T33, typename T34, typename T35,
04208     typename T36, typename T37, typename T38, typename T39>
04209 struct Types39 {
04210   typedef T1 Head;
04211   typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04212       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04213       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
04214 };
04215 
04216 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04217     typename T6, typename T7, typename T8, typename T9, typename T10,
04218     typename T11, typename T12, typename T13, typename T14, typename T15,
04219     typename T16, typename T17, typename T18, typename T19, typename T20,
04220     typename T21, typename T22, typename T23, typename T24, typename T25,
04221     typename T26, typename T27, typename T28, typename T29, typename T30,
04222     typename T31, typename T32, typename T33, typename T34, typename T35,
04223     typename T36, typename T37, typename T38, typename T39, typename T40>
04224 struct Types40 {
04225   typedef T1 Head;
04226   typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04227       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04228       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
04229 };
04230 
04231 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04232     typename T6, typename T7, typename T8, typename T9, typename T10,
04233     typename T11, typename T12, typename T13, typename T14, typename T15,
04234     typename T16, typename T17, typename T18, typename T19, typename T20,
04235     typename T21, typename T22, typename T23, typename T24, typename T25,
04236     typename T26, typename T27, typename T28, typename T29, typename T30,
04237     typename T31, typename T32, typename T33, typename T34, typename T35,
04238     typename T36, typename T37, typename T38, typename T39, typename T40,
04239     typename T41>
04240 struct Types41 {
04241   typedef T1 Head;
04242   typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04243       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04244       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
04245 };
04246 
04247 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04248     typename T6, typename T7, typename T8, typename T9, typename T10,
04249     typename T11, typename T12, typename T13, typename T14, typename T15,
04250     typename T16, typename T17, typename T18, typename T19, typename T20,
04251     typename T21, typename T22, typename T23, typename T24, typename T25,
04252     typename T26, typename T27, typename T28, typename T29, typename T30,
04253     typename T31, typename T32, typename T33, typename T34, typename T35,
04254     typename T36, typename T37, typename T38, typename T39, typename T40,
04255     typename T41, typename T42>
04256 struct Types42 {
04257   typedef T1 Head;
04258   typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04259       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04260       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
04261 };
04262 
04263 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04264     typename T6, typename T7, typename T8, typename T9, typename T10,
04265     typename T11, typename T12, typename T13, typename T14, typename T15,
04266     typename T16, typename T17, typename T18, typename T19, typename T20,
04267     typename T21, typename T22, typename T23, typename T24, typename T25,
04268     typename T26, typename T27, typename T28, typename T29, typename T30,
04269     typename T31, typename T32, typename T33, typename T34, typename T35,
04270     typename T36, typename T37, typename T38, typename T39, typename T40,
04271     typename T41, typename T42, typename T43>
04272 struct Types43 {
04273   typedef T1 Head;
04274   typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04275       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04276       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
04277       T43> Tail;
04278 };
04279 
04280 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04281     typename T6, typename T7, typename T8, typename T9, typename T10,
04282     typename T11, typename T12, typename T13, typename T14, typename T15,
04283     typename T16, typename T17, typename T18, typename T19, typename T20,
04284     typename T21, typename T22, typename T23, typename T24, typename T25,
04285     typename T26, typename T27, typename T28, typename T29, typename T30,
04286     typename T31, typename T32, typename T33, typename T34, typename T35,
04287     typename T36, typename T37, typename T38, typename T39, typename T40,
04288     typename T41, typename T42, typename T43, typename T44>
04289 struct Types44 {
04290   typedef T1 Head;
04291   typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04292       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04293       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04294       T44> Tail;
04295 };
04296 
04297 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04298     typename T6, typename T7, typename T8, typename T9, typename T10,
04299     typename T11, typename T12, typename T13, typename T14, typename T15,
04300     typename T16, typename T17, typename T18, typename T19, typename T20,
04301     typename T21, typename T22, typename T23, typename T24, typename T25,
04302     typename T26, typename T27, typename T28, typename T29, typename T30,
04303     typename T31, typename T32, typename T33, typename T34, typename T35,
04304     typename T36, typename T37, typename T38, typename T39, typename T40,
04305     typename T41, typename T42, typename T43, typename T44, typename T45>
04306 struct Types45 {
04307   typedef T1 Head;
04308   typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04309       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04310       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04311       T44, T45> Tail;
04312 };
04313 
04314 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04315     typename T6, typename T7, typename T8, typename T9, typename T10,
04316     typename T11, typename T12, typename T13, typename T14, typename T15,
04317     typename T16, typename T17, typename T18, typename T19, typename T20,
04318     typename T21, typename T22, typename T23, typename T24, typename T25,
04319     typename T26, typename T27, typename T28, typename T29, typename T30,
04320     typename T31, typename T32, typename T33, typename T34, typename T35,
04321     typename T36, typename T37, typename T38, typename T39, typename T40,
04322     typename T41, typename T42, typename T43, typename T44, typename T45,
04323     typename T46>
04324 struct Types46 {
04325   typedef T1 Head;
04326   typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04327       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04328       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04329       T44, T45, T46> Tail;
04330 };
04331 
04332 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04333     typename T6, typename T7, typename T8, typename T9, typename T10,
04334     typename T11, typename T12, typename T13, typename T14, typename T15,
04335     typename T16, typename T17, typename T18, typename T19, typename T20,
04336     typename T21, typename T22, typename T23, typename T24, typename T25,
04337     typename T26, typename T27, typename T28, typename T29, typename T30,
04338     typename T31, typename T32, typename T33, typename T34, typename T35,
04339     typename T36, typename T37, typename T38, typename T39, typename T40,
04340     typename T41, typename T42, typename T43, typename T44, typename T45,
04341     typename T46, typename T47>
04342 struct Types47 {
04343   typedef T1 Head;
04344   typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04345       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04346       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04347       T44, T45, T46, T47> Tail;
04348 };
04349 
04350 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04351     typename T6, typename T7, typename T8, typename T9, typename T10,
04352     typename T11, typename T12, typename T13, typename T14, typename T15,
04353     typename T16, typename T17, typename T18, typename T19, typename T20,
04354     typename T21, typename T22, typename T23, typename T24, typename T25,
04355     typename T26, typename T27, typename T28, typename T29, typename T30,
04356     typename T31, typename T32, typename T33, typename T34, typename T35,
04357     typename T36, typename T37, typename T38, typename T39, typename T40,
04358     typename T41, typename T42, typename T43, typename T44, typename T45,
04359     typename T46, typename T47, typename T48>
04360 struct Types48 {
04361   typedef T1 Head;
04362   typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04363       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04364       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04365       T44, T45, T46, T47, T48> Tail;
04366 };
04367 
04368 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04369     typename T6, typename T7, typename T8, typename T9, typename T10,
04370     typename T11, typename T12, typename T13, typename T14, typename T15,
04371     typename T16, typename T17, typename T18, typename T19, typename T20,
04372     typename T21, typename T22, typename T23, typename T24, typename T25,
04373     typename T26, typename T27, typename T28, typename T29, typename T30,
04374     typename T31, typename T32, typename T33, typename T34, typename T35,
04375     typename T36, typename T37, typename T38, typename T39, typename T40,
04376     typename T41, typename T42, typename T43, typename T44, typename T45,
04377     typename T46, typename T47, typename T48, typename T49>
04378 struct Types49 {
04379   typedef T1 Head;
04380   typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04381       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04382       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04383       T44, T45, T46, T47, T48, T49> Tail;
04384 };
04385 
04386 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04387     typename T6, typename T7, typename T8, typename T9, typename T10,
04388     typename T11, typename T12, typename T13, typename T14, typename T15,
04389     typename T16, typename T17, typename T18, typename T19, typename T20,
04390     typename T21, typename T22, typename T23, typename T24, typename T25,
04391     typename T26, typename T27, typename T28, typename T29, typename T30,
04392     typename T31, typename T32, typename T33, typename T34, typename T35,
04393     typename T36, typename T37, typename T38, typename T39, typename T40,
04394     typename T41, typename T42, typename T43, typename T44, typename T45,
04395     typename T46, typename T47, typename T48, typename T49, typename T50>
04396 struct Types50 {
04397   typedef T1 Head;
04398   typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04399       T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04400       T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
04401       T44, T45, T46, T47, T48, T49, T50> Tail;
04402 };
04403 
04404 
04405 }  // namespace internal
04406 
04407 // We don't want to require the users to write TypesN<...> directly,
04408 // as that would require them to count the length.  Types<...> is much
04409 // easier to write, but generates horrible messages when there is a
04410 // compiler error, as gcc insists on printing out each template
04411 // argument, even if it has the default value (this means Types<int>
04412 // will appear as Types<int, None, None, ..., None> in the compiler
04413 // errors).
04414 //
04415 // Our solution is to combine the best part of the two approaches: a
04416 // user would write Types<T1, ..., TN>, and Google Test will translate
04417 // that to TypesN<T1, ..., TN> internally to make error messages
04418 // readable.  The translation is done by the 'type' member of the
04419 // Types template.
04420 template <typename T1 = internal::None, typename T2 = internal::None,
04421     typename T3 = internal::None, typename T4 = internal::None,
04422     typename T5 = internal::None, typename T6 = internal::None,
04423     typename T7 = internal::None, typename T8 = internal::None,
04424     typename T9 = internal::None, typename T10 = internal::None,
04425     typename T11 = internal::None, typename T12 = internal::None,
04426     typename T13 = internal::None, typename T14 = internal::None,
04427     typename T15 = internal::None, typename T16 = internal::None,
04428     typename T17 = internal::None, typename T18 = internal::None,
04429     typename T19 = internal::None, typename T20 = internal::None,
04430     typename T21 = internal::None, typename T22 = internal::None,
04431     typename T23 = internal::None, typename T24 = internal::None,
04432     typename T25 = internal::None, typename T26 = internal::None,
04433     typename T27 = internal::None, typename T28 = internal::None,
04434     typename T29 = internal::None, typename T30 = internal::None,
04435     typename T31 = internal::None, typename T32 = internal::None,
04436     typename T33 = internal::None, typename T34 = internal::None,
04437     typename T35 = internal::None, typename T36 = internal::None,
04438     typename T37 = internal::None, typename T38 = internal::None,
04439     typename T39 = internal::None, typename T40 = internal::None,
04440     typename T41 = internal::None, typename T42 = internal::None,
04441     typename T43 = internal::None, typename T44 = internal::None,
04442     typename T45 = internal::None, typename T46 = internal::None,
04443     typename T47 = internal::None, typename T48 = internal::None,
04444     typename T49 = internal::None, typename T50 = internal::None>
04445 struct Types {
04446   typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04447       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04448       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
04449       T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
04450 };
04451 
04452 template <>
04453 struct Types<internal::None, internal::None, internal::None, internal::None,
04454     internal::None, internal::None, internal::None, internal::None,
04455     internal::None, internal::None, internal::None, internal::None,
04456     internal::None, internal::None, internal::None, internal::None,
04457     internal::None, internal::None, internal::None, internal::None,
04458     internal::None, internal::None, internal::None, internal::None,
04459     internal::None, internal::None, internal::None, internal::None,
04460     internal::None, internal::None, internal::None, internal::None,
04461     internal::None, internal::None, internal::None, internal::None,
04462     internal::None, internal::None, internal::None, internal::None,
04463     internal::None, internal::None, internal::None, internal::None,
04464     internal::None, internal::None, internal::None, internal::None,
04465     internal::None, internal::None> {
04466   typedef internal::Types0 type;
04467 };
04468 template <typename T1>
04469 struct Types<T1, internal::None, internal::None, internal::None,
04470     internal::None, internal::None, internal::None, internal::None,
04471     internal::None, internal::None, internal::None, internal::None,
04472     internal::None, internal::None, internal::None, internal::None,
04473     internal::None, internal::None, internal::None, internal::None,
04474     internal::None, internal::None, internal::None, internal::None,
04475     internal::None, internal::None, internal::None, internal::None,
04476     internal::None, internal::None, internal::None, internal::None,
04477     internal::None, internal::None, internal::None, internal::None,
04478     internal::None, internal::None, internal::None, internal::None,
04479     internal::None, internal::None, internal::None, internal::None,
04480     internal::None, internal::None, internal::None, internal::None,
04481     internal::None, internal::None> {
04482   typedef internal::Types1<T1> type;
04483 };
04484 template <typename T1, typename T2>
04485 struct Types<T1, T2, internal::None, internal::None, internal::None,
04486     internal::None, internal::None, internal::None, internal::None,
04487     internal::None, internal::None, internal::None, internal::None,
04488     internal::None, internal::None, internal::None, internal::None,
04489     internal::None, internal::None, internal::None, internal::None,
04490     internal::None, internal::None, internal::None, internal::None,
04491     internal::None, internal::None, internal::None, internal::None,
04492     internal::None, internal::None, internal::None, internal::None,
04493     internal::None, internal::None, internal::None, internal::None,
04494     internal::None, internal::None, internal::None, internal::None,
04495     internal::None, internal::None, internal::None, internal::None,
04496     internal::None, internal::None, internal::None, internal::None,
04497     internal::None> {
04498   typedef internal::Types2<T1, T2> type;
04499 };
04500 template <typename T1, typename T2, typename T3>
04501 struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
04502     internal::None, internal::None, internal::None, internal::None,
04503     internal::None, internal::None, internal::None, internal::None,
04504     internal::None, internal::None, internal::None, internal::None,
04505     internal::None, internal::None, internal::None, internal::None,
04506     internal::None, internal::None, internal::None, internal::None,
04507     internal::None, internal::None, internal::None, internal::None,
04508     internal::None, internal::None, internal::None, internal::None,
04509     internal::None, internal::None, internal::None, internal::None,
04510     internal::None, internal::None, internal::None, internal::None,
04511     internal::None, internal::None, internal::None, internal::None,
04512     internal::None, internal::None, internal::None, internal::None> {
04513   typedef internal::Types3<T1, T2, T3> type;
04514 };
04515 template <typename T1, typename T2, typename T3, typename T4>
04516 struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
04517     internal::None, internal::None, internal::None, internal::None,
04518     internal::None, internal::None, internal::None, internal::None,
04519     internal::None, internal::None, internal::None, internal::None,
04520     internal::None, internal::None, internal::None, internal::None,
04521     internal::None, internal::None, internal::None, internal::None,
04522     internal::None, internal::None, internal::None, internal::None,
04523     internal::None, internal::None, internal::None, internal::None,
04524     internal::None, internal::None, internal::None, internal::None,
04525     internal::None, internal::None, internal::None, internal::None,
04526     internal::None, internal::None, internal::None, internal::None,
04527     internal::None, internal::None, internal::None> {
04528   typedef internal::Types4<T1, T2, T3, T4> type;
04529 };
04530 template <typename T1, typename T2, typename T3, typename T4, typename T5>
04531 struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
04532     internal::None, internal::None, internal::None, internal::None,
04533     internal::None, internal::None, internal::None, internal::None,
04534     internal::None, internal::None, internal::None, internal::None,
04535     internal::None, internal::None, internal::None, internal::None,
04536     internal::None, internal::None, internal::None, internal::None,
04537     internal::None, internal::None, internal::None, internal::None,
04538     internal::None, internal::None, internal::None, internal::None,
04539     internal::None, internal::None, internal::None, internal::None,
04540     internal::None, internal::None, internal::None, internal::None,
04541     internal::None, internal::None, internal::None, internal::None,
04542     internal::None, internal::None, internal::None> {
04543   typedef internal::Types5<T1, T2, T3, T4, T5> type;
04544 };
04545 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04546     typename T6>
04547 struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
04548     internal::None, internal::None, internal::None, internal::None,
04549     internal::None, internal::None, internal::None, internal::None,
04550     internal::None, internal::None, internal::None, internal::None,
04551     internal::None, internal::None, internal::None, internal::None,
04552     internal::None, internal::None, internal::None, internal::None,
04553     internal::None, internal::None, internal::None, internal::None,
04554     internal::None, internal::None, internal::None, internal::None,
04555     internal::None, internal::None, internal::None, internal::None,
04556     internal::None, internal::None, internal::None, internal::None,
04557     internal::None, internal::None, internal::None, internal::None,
04558     internal::None, internal::None> {
04559   typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
04560 };
04561 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04562     typename T6, typename T7>
04563 struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
04564     internal::None, internal::None, internal::None, internal::None,
04565     internal::None, internal::None, internal::None, internal::None,
04566     internal::None, internal::None, internal::None, internal::None,
04567     internal::None, internal::None, internal::None, internal::None,
04568     internal::None, internal::None, internal::None, internal::None,
04569     internal::None, internal::None, internal::None, internal::None,
04570     internal::None, internal::None, internal::None, internal::None,
04571     internal::None, internal::None, internal::None, internal::None,
04572     internal::None, internal::None, internal::None, internal::None,
04573     internal::None, internal::None, internal::None, internal::None,
04574     internal::None> {
04575   typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
04576 };
04577 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04578     typename T6, typename T7, typename T8>
04579 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
04580     internal::None, internal::None, internal::None, internal::None,
04581     internal::None, internal::None, internal::None, internal::None,
04582     internal::None, internal::None, internal::None, internal::None,
04583     internal::None, internal::None, internal::None, internal::None,
04584     internal::None, internal::None, internal::None, internal::None,
04585     internal::None, internal::None, internal::None, internal::None,
04586     internal::None, internal::None, internal::None, internal::None,
04587     internal::None, internal::None, internal::None, internal::None,
04588     internal::None, internal::None, internal::None, internal::None,
04589     internal::None, internal::None, internal::None, internal::None> {
04590   typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
04591 };
04592 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04593     typename T6, typename T7, typename T8, typename T9>
04594 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
04595     internal::None, internal::None, internal::None, internal::None,
04596     internal::None, internal::None, internal::None, internal::None,
04597     internal::None, internal::None, internal::None, internal::None,
04598     internal::None, internal::None, internal::None, internal::None,
04599     internal::None, internal::None, internal::None, internal::None,
04600     internal::None, internal::None, internal::None, internal::None,
04601     internal::None, internal::None, internal::None, internal::None,
04602     internal::None, internal::None, internal::None, internal::None,
04603     internal::None, internal::None, internal::None, internal::None,
04604     internal::None, internal::None, internal::None, internal::None> {
04605   typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
04606 };
04607 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04608     typename T6, typename T7, typename T8, typename T9, typename T10>
04609 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
04610     internal::None, internal::None, internal::None, internal::None,
04611     internal::None, internal::None, internal::None, internal::None,
04612     internal::None, internal::None, internal::None, internal::None,
04613     internal::None, internal::None, internal::None, internal::None,
04614     internal::None, internal::None, internal::None, internal::None,
04615     internal::None, internal::None, internal::None, internal::None,
04616     internal::None, internal::None, internal::None, internal::None,
04617     internal::None, internal::None, internal::None, internal::None,
04618     internal::None, internal::None, internal::None, internal::None,
04619     internal::None, internal::None, internal::None> {
04620   typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
04621 };
04622 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04623     typename T6, typename T7, typename T8, typename T9, typename T10,
04624     typename T11>
04625 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
04626     internal::None, internal::None, internal::None, internal::None,
04627     internal::None, internal::None, internal::None, internal::None,
04628     internal::None, internal::None, internal::None, internal::None,
04629     internal::None, internal::None, internal::None, internal::None,
04630     internal::None, internal::None, internal::None, internal::None,
04631     internal::None, internal::None, internal::None, internal::None,
04632     internal::None, internal::None, internal::None, internal::None,
04633     internal::None, internal::None, internal::None, internal::None,
04634     internal::None, internal::None, internal::None, internal::None,
04635     internal::None, internal::None> {
04636   typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
04637 };
04638 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04639     typename T6, typename T7, typename T8, typename T9, typename T10,
04640     typename T11, typename T12>
04641 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
04642     internal::None, internal::None, internal::None, internal::None,
04643     internal::None, internal::None, internal::None, internal::None,
04644     internal::None, internal::None, internal::None, internal::None,
04645     internal::None, internal::None, internal::None, internal::None,
04646     internal::None, internal::None, internal::None, internal::None,
04647     internal::None, internal::None, internal::None, internal::None,
04648     internal::None, internal::None, internal::None, internal::None,
04649     internal::None, internal::None, internal::None, internal::None,
04650     internal::None, internal::None, internal::None, internal::None,
04651     internal::None> {
04652   typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
04653       T12> type;
04654 };
04655 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04656     typename T6, typename T7, typename T8, typename T9, typename T10,
04657     typename T11, typename T12, typename T13>
04658 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
04659     internal::None, internal::None, internal::None, internal::None,
04660     internal::None, internal::None, internal::None, internal::None,
04661     internal::None, internal::None, internal::None, internal::None,
04662     internal::None, internal::None, internal::None, internal::None,
04663     internal::None, internal::None, internal::None, internal::None,
04664     internal::None, internal::None, internal::None, internal::None,
04665     internal::None, internal::None, internal::None, internal::None,
04666     internal::None, internal::None, internal::None, internal::None,
04667     internal::None, internal::None, internal::None, internal::None,
04668     internal::None> {
04669   typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04670       T13> type;
04671 };
04672 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04673     typename T6, typename T7, typename T8, typename T9, typename T10,
04674     typename T11, typename T12, typename T13, typename T14>
04675 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
04676     internal::None, internal::None, internal::None, internal::None,
04677     internal::None, internal::None, internal::None, internal::None,
04678     internal::None, internal::None, internal::None, internal::None,
04679     internal::None, internal::None, internal::None, internal::None,
04680     internal::None, internal::None, internal::None, internal::None,
04681     internal::None, internal::None, internal::None, internal::None,
04682     internal::None, internal::None, internal::None, internal::None,
04683     internal::None, internal::None, internal::None, internal::None,
04684     internal::None, internal::None, internal::None, internal::None> {
04685   typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04686       T13, T14> type;
04687 };
04688 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04689     typename T6, typename T7, typename T8, typename T9, typename T10,
04690     typename T11, typename T12, typename T13, typename T14, typename T15>
04691 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04692     internal::None, internal::None, internal::None, internal::None,
04693     internal::None, internal::None, internal::None, internal::None,
04694     internal::None, internal::None, internal::None, internal::None,
04695     internal::None, internal::None, internal::None, internal::None,
04696     internal::None, internal::None, internal::None, internal::None,
04697     internal::None, internal::None, internal::None, internal::None,
04698     internal::None, internal::None, internal::None, internal::None,
04699     internal::None, internal::None, internal::None, internal::None,
04700     internal::None, internal::None, internal::None> {
04701   typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04702       T13, T14, T15> type;
04703 };
04704 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04705     typename T6, typename T7, typename T8, typename T9, typename T10,
04706     typename T11, typename T12, typename T13, typename T14, typename T15,
04707     typename T16>
04708 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04709     T16, internal::None, internal::None, internal::None, internal::None,
04710     internal::None, internal::None, internal::None, internal::None,
04711     internal::None, internal::None, internal::None, internal::None,
04712     internal::None, internal::None, internal::None, internal::None,
04713     internal::None, internal::None, internal::None, internal::None,
04714     internal::None, internal::None, internal::None, internal::None,
04715     internal::None, internal::None, internal::None, internal::None,
04716     internal::None, internal::None, internal::None, internal::None,
04717     internal::None, internal::None> {
04718   typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04719       T13, T14, T15, T16> type;
04720 };
04721 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04722     typename T6, typename T7, typename T8, typename T9, typename T10,
04723     typename T11, typename T12, typename T13, typename T14, typename T15,
04724     typename T16, typename T17>
04725 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04726     T16, T17, internal::None, internal::None, internal::None, internal::None,
04727     internal::None, internal::None, internal::None, internal::None,
04728     internal::None, internal::None, internal::None, internal::None,
04729     internal::None, internal::None, internal::None, internal::None,
04730     internal::None, internal::None, internal::None, internal::None,
04731     internal::None, internal::None, internal::None, internal::None,
04732     internal::None, internal::None, internal::None, internal::None,
04733     internal::None, internal::None, internal::None, internal::None,
04734     internal::None> {
04735   typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04736       T13, T14, T15, T16, T17> type;
04737 };
04738 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04739     typename T6, typename T7, typename T8, typename T9, typename T10,
04740     typename T11, typename T12, typename T13, typename T14, typename T15,
04741     typename T16, typename T17, typename T18>
04742 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04743     T16, T17, T18, internal::None, internal::None, internal::None,
04744     internal::None, internal::None, internal::None, internal::None,
04745     internal::None, internal::None, internal::None, internal::None,
04746     internal::None, internal::None, internal::None, internal::None,
04747     internal::None, internal::None, internal::None, internal::None,
04748     internal::None, internal::None, internal::None, internal::None,
04749     internal::None, internal::None, internal::None, internal::None,
04750     internal::None, internal::None, internal::None, internal::None,
04751     internal::None> {
04752   typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04753       T13, T14, T15, T16, T17, T18> type;
04754 };
04755 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04756     typename T6, typename T7, typename T8, typename T9, typename T10,
04757     typename T11, typename T12, typename T13, typename T14, typename T15,
04758     typename T16, typename T17, typename T18, typename T19>
04759 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04760     T16, T17, T18, T19, internal::None, internal::None, internal::None,
04761     internal::None, internal::None, internal::None, internal::None,
04762     internal::None, internal::None, internal::None, internal::None,
04763     internal::None, internal::None, internal::None, internal::None,
04764     internal::None, internal::None, internal::None, internal::None,
04765     internal::None, internal::None, internal::None, internal::None,
04766     internal::None, internal::None, internal::None, internal::None,
04767     internal::None, internal::None, internal::None, internal::None> {
04768   typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04769       T13, T14, T15, T16, T17, T18, T19> type;
04770 };
04771 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04772     typename T6, typename T7, typename T8, typename T9, typename T10,
04773     typename T11, typename T12, typename T13, typename T14, typename T15,
04774     typename T16, typename T17, typename T18, typename T19, typename T20>
04775 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04776     T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
04777     internal::None, internal::None, internal::None, internal::None,
04778     internal::None, internal::None, internal::None, internal::None,
04779     internal::None, internal::None, internal::None, internal::None,
04780     internal::None, internal::None, internal::None, internal::None,
04781     internal::None, internal::None, internal::None, internal::None,
04782     internal::None, internal::None, internal::None, internal::None,
04783     internal::None, internal::None, internal::None> {
04784   typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04785       T13, T14, T15, T16, T17, T18, T19, T20> type;
04786 };
04787 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04788     typename T6, typename T7, typename T8, typename T9, typename T10,
04789     typename T11, typename T12, typename T13, typename T14, typename T15,
04790     typename T16, typename T17, typename T18, typename T19, typename T20,
04791     typename T21>
04792 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04793     T16, T17, T18, T19, T20, T21, internal::None, internal::None,
04794     internal::None, internal::None, internal::None, internal::None,
04795     internal::None, internal::None, internal::None, internal::None,
04796     internal::None, internal::None, internal::None, internal::None,
04797     internal::None, internal::None, internal::None, internal::None,
04798     internal::None, internal::None, internal::None, internal::None,
04799     internal::None, internal::None, internal::None, internal::None,
04800     internal::None, internal::None, internal::None> {
04801   typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04802       T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
04803 };
04804 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04805     typename T6, typename T7, typename T8, typename T9, typename T10,
04806     typename T11, typename T12, typename T13, typename T14, typename T15,
04807     typename T16, typename T17, typename T18, typename T19, typename T20,
04808     typename T21, typename T22>
04809 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04810     T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
04811     internal::None, internal::None, internal::None, internal::None,
04812     internal::None, internal::None, internal::None, internal::None,
04813     internal::None, internal::None, internal::None, internal::None,
04814     internal::None, internal::None, internal::None, internal::None,
04815     internal::None, internal::None, internal::None, internal::None,
04816     internal::None, internal::None, internal::None, internal::None,
04817     internal::None, internal::None> {
04818   typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04819       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
04820 };
04821 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04822     typename T6, typename T7, typename T8, typename T9, typename T10,
04823     typename T11, typename T12, typename T13, typename T14, typename T15,
04824     typename T16, typename T17, typename T18, typename T19, typename T20,
04825     typename T21, typename T22, typename T23>
04826 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04827     T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
04828     internal::None, internal::None, internal::None, internal::None,
04829     internal::None, internal::None, internal::None, internal::None,
04830     internal::None, internal::None, internal::None, internal::None,
04831     internal::None, internal::None, internal::None, internal::None,
04832     internal::None, internal::None, internal::None, internal::None,
04833     internal::None, internal::None, internal::None, internal::None,
04834     internal::None> {
04835   typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04836       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
04837 };
04838 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04839     typename T6, typename T7, typename T8, typename T9, typename T10,
04840     typename T11, typename T12, typename T13, typename T14, typename T15,
04841     typename T16, typename T17, typename T18, typename T19, typename T20,
04842     typename T21, typename T22, typename T23, typename T24>
04843 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04844     T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
04845     internal::None, internal::None, internal::None, internal::None,
04846     internal::None, internal::None, internal::None, internal::None,
04847     internal::None, internal::None, internal::None, internal::None,
04848     internal::None, internal::None, internal::None, internal::None,
04849     internal::None, internal::None, internal::None, internal::None,
04850     internal::None, internal::None, internal::None, internal::None,
04851     internal::None> {
04852   typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04853       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
04854 };
04855 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04856     typename T6, typename T7, typename T8, typename T9, typename T10,
04857     typename T11, typename T12, typename T13, typename T14, typename T15,
04858     typename T16, typename T17, typename T18, typename T19, typename T20,
04859     typename T21, typename T22, typename T23, typename T24, typename T25>
04860 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04861     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
04862     internal::None, internal::None, internal::None, internal::None,
04863     internal::None, internal::None, internal::None, internal::None,
04864     internal::None, internal::None, internal::None, internal::None,
04865     internal::None, internal::None, internal::None, internal::None,
04866     internal::None, internal::None, internal::None, internal::None,
04867     internal::None, internal::None, internal::None, internal::None> {
04868   typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04869       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
04870 };
04871 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04872     typename T6, typename T7, typename T8, typename T9, typename T10,
04873     typename T11, typename T12, typename T13, typename T14, typename T15,
04874     typename T16, typename T17, typename T18, typename T19, typename T20,
04875     typename T21, typename T22, typename T23, typename T24, typename T25,
04876     typename T26>
04877 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04878     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
04879     internal::None, internal::None, internal::None, internal::None,
04880     internal::None, internal::None, internal::None, internal::None,
04881     internal::None, internal::None, internal::None, internal::None,
04882     internal::None, internal::None, internal::None, internal::None,
04883     internal::None, internal::None, internal::None, internal::None,
04884     internal::None, internal::None, internal::None> {
04885   typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04886       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
04887       T26> type;
04888 };
04889 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04890     typename T6, typename T7, typename T8, typename T9, typename T10,
04891     typename T11, typename T12, typename T13, typename T14, typename T15,
04892     typename T16, typename T17, typename T18, typename T19, typename T20,
04893     typename T21, typename T22, typename T23, typename T24, typename T25,
04894     typename T26, typename T27>
04895 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04896     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
04897     internal::None, internal::None, internal::None, internal::None,
04898     internal::None, internal::None, internal::None, internal::None,
04899     internal::None, internal::None, internal::None, internal::None,
04900     internal::None, internal::None, internal::None, internal::None,
04901     internal::None, internal::None, internal::None, internal::None,
04902     internal::None, internal::None> {
04903   typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04904       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04905       T27> type;
04906 };
04907 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04908     typename T6, typename T7, typename T8, typename T9, typename T10,
04909     typename T11, typename T12, typename T13, typename T14, typename T15,
04910     typename T16, typename T17, typename T18, typename T19, typename T20,
04911     typename T21, typename T22, typename T23, typename T24, typename T25,
04912     typename T26, typename T27, typename T28>
04913 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04914     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
04915     internal::None, internal::None, internal::None, internal::None,
04916     internal::None, internal::None, internal::None, internal::None,
04917     internal::None, internal::None, internal::None, internal::None,
04918     internal::None, internal::None, internal::None, internal::None,
04919     internal::None, internal::None, internal::None, internal::None,
04920     internal::None, internal::None> {
04921   typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04922       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04923       T27, T28> type;
04924 };
04925 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04926     typename T6, typename T7, typename T8, typename T9, typename T10,
04927     typename T11, typename T12, typename T13, typename T14, typename T15,
04928     typename T16, typename T17, typename T18, typename T19, typename T20,
04929     typename T21, typename T22, typename T23, typename T24, typename T25,
04930     typename T26, typename T27, typename T28, typename T29>
04931 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04932     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
04933     internal::None, internal::None, internal::None, internal::None,
04934     internal::None, internal::None, internal::None, internal::None,
04935     internal::None, internal::None, internal::None, internal::None,
04936     internal::None, internal::None, internal::None, internal::None,
04937     internal::None, internal::None, internal::None, internal::None,
04938     internal::None> {
04939   typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04940       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04941       T27, T28, T29> type;
04942 };
04943 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04944     typename T6, typename T7, typename T8, typename T9, typename T10,
04945     typename T11, typename T12, typename T13, typename T14, typename T15,
04946     typename T16, typename T17, typename T18, typename T19, typename T20,
04947     typename T21, typename T22, typename T23, typename T24, typename T25,
04948     typename T26, typename T27, typename T28, typename T29, typename T30>
04949 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04950     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04951     internal::None, internal::None, internal::None, internal::None,
04952     internal::None, internal::None, internal::None, internal::None,
04953     internal::None, internal::None, internal::None, internal::None,
04954     internal::None, internal::None, internal::None, internal::None,
04955     internal::None, internal::None, internal::None, internal::None> {
04956   typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04957       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04958       T27, T28, T29, T30> type;
04959 };
04960 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04961     typename T6, typename T7, typename T8, typename T9, typename T10,
04962     typename T11, typename T12, typename T13, typename T14, typename T15,
04963     typename T16, typename T17, typename T18, typename T19, typename T20,
04964     typename T21, typename T22, typename T23, typename T24, typename T25,
04965     typename T26, typename T27, typename T28, typename T29, typename T30,
04966     typename T31>
04967 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04968     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04969     T31, internal::None, internal::None, internal::None, internal::None,
04970     internal::None, internal::None, internal::None, internal::None,
04971     internal::None, internal::None, internal::None, internal::None,
04972     internal::None, internal::None, internal::None, internal::None,
04973     internal::None, internal::None, internal::None> {
04974   typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04975       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04976       T27, T28, T29, T30, T31> type;
04977 };
04978 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04979     typename T6, typename T7, typename T8, typename T9, typename T10,
04980     typename T11, typename T12, typename T13, typename T14, typename T15,
04981     typename T16, typename T17, typename T18, typename T19, typename T20,
04982     typename T21, typename T22, typename T23, typename T24, typename T25,
04983     typename T26, typename T27, typename T28, typename T29, typename T30,
04984     typename T31, typename T32>
04985 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
04986     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
04987     T31, T32, internal::None, internal::None, internal::None, internal::None,
04988     internal::None, internal::None, internal::None, internal::None,
04989     internal::None, internal::None, internal::None, internal::None,
04990     internal::None, internal::None, internal::None, internal::None,
04991     internal::None, internal::None> {
04992   typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
04993       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
04994       T27, T28, T29, T30, T31, T32> type;
04995 };
04996 template <typename T1, typename T2, typename T3, typename T4, typename T5,
04997     typename T6, typename T7, typename T8, typename T9, typename T10,
04998     typename T11, typename T12, typename T13, typename T14, typename T15,
04999     typename T16, typename T17, typename T18, typename T19, typename T20,
05000     typename T21, typename T22, typename T23, typename T24, typename T25,
05001     typename T26, typename T27, typename T28, typename T29, typename T30,
05002     typename T31, typename T32, typename T33>
05003 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05004     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05005     T31, T32, T33, internal::None, internal::None, internal::None,
05006     internal::None, internal::None, internal::None, internal::None,
05007     internal::None, internal::None, internal::None, internal::None,
05008     internal::None, internal::None, internal::None, internal::None,
05009     internal::None, internal::None> {
05010   typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05011       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05012       T27, T28, T29, T30, T31, T32, T33> type;
05013 };
05014 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05015     typename T6, typename T7, typename T8, typename T9, typename T10,
05016     typename T11, typename T12, typename T13, typename T14, typename T15,
05017     typename T16, typename T17, typename T18, typename T19, typename T20,
05018     typename T21, typename T22, typename T23, typename T24, typename T25,
05019     typename T26, typename T27, typename T28, typename T29, typename T30,
05020     typename T31, typename T32, typename T33, typename T34>
05021 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05022     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05023     T31, T32, T33, T34, internal::None, internal::None, internal::None,
05024     internal::None, internal::None, internal::None, internal::None,
05025     internal::None, internal::None, internal::None, internal::None,
05026     internal::None, internal::None, internal::None, internal::None,
05027     internal::None> {
05028   typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05029       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05030       T27, T28, T29, T30, T31, T32, T33, T34> type;
05031 };
05032 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05033     typename T6, typename T7, typename T8, typename T9, typename T10,
05034     typename T11, typename T12, typename T13, typename T14, typename T15,
05035     typename T16, typename T17, typename T18, typename T19, typename T20,
05036     typename T21, typename T22, typename T23, typename T24, typename T25,
05037     typename T26, typename T27, typename T28, typename T29, typename T30,
05038     typename T31, typename T32, typename T33, typename T34, typename T35>
05039 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05040     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05041     T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
05042     internal::None, internal::None, internal::None, internal::None,
05043     internal::None, internal::None, internal::None, internal::None,
05044     internal::None, internal::None, internal::None, internal::None> {
05045   typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05046       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05047       T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
05048 };
05049 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05050     typename T6, typename T7, typename T8, typename T9, typename T10,
05051     typename T11, typename T12, typename T13, typename T14, typename T15,
05052     typename T16, typename T17, typename T18, typename T19, typename T20,
05053     typename T21, typename T22, typename T23, typename T24, typename T25,
05054     typename T26, typename T27, typename T28, typename T29, typename T30,
05055     typename T31, typename T32, typename T33, typename T34, typename T35,
05056     typename T36>
05057 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05058     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05059     T31, T32, T33, T34, T35, T36, internal::None, internal::None,
05060     internal::None, internal::None, internal::None, internal::None,
05061     internal::None, internal::None, internal::None, internal::None,
05062     internal::None, internal::None, internal::None, internal::None> {
05063   typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05064       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05065       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
05066 };
05067 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05068     typename T6, typename T7, typename T8, typename T9, typename T10,
05069     typename T11, typename T12, typename T13, typename T14, typename T15,
05070     typename T16, typename T17, typename T18, typename T19, typename T20,
05071     typename T21, typename T22, typename T23, typename T24, typename T25,
05072     typename T26, typename T27, typename T28, typename T29, typename T30,
05073     typename T31, typename T32, typename T33, typename T34, typename T35,
05074     typename T36, typename T37>
05075 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05076     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05077     T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
05078     internal::None, internal::None, internal::None, internal::None,
05079     internal::None, internal::None, internal::None, internal::None,
05080     internal::None, internal::None, internal::None> {
05081   typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05082       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05083       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
05084 };
05085 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05086     typename T6, typename T7, typename T8, typename T9, typename T10,
05087     typename T11, typename T12, typename T13, typename T14, typename T15,
05088     typename T16, typename T17, typename T18, typename T19, typename T20,
05089     typename T21, typename T22, typename T23, typename T24, typename T25,
05090     typename T26, typename T27, typename T28, typename T29, typename T30,
05091     typename T31, typename T32, typename T33, typename T34, typename T35,
05092     typename T36, typename T37, typename T38>
05093 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05094     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05095     T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
05096     internal::None, internal::None, internal::None, internal::None,
05097     internal::None, internal::None, internal::None, internal::None,
05098     internal::None, internal::None> {
05099   typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05100       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05101       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
05102 };
05103 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05104     typename T6, typename T7, typename T8, typename T9, typename T10,
05105     typename T11, typename T12, typename T13, typename T14, typename T15,
05106     typename T16, typename T17, typename T18, typename T19, typename T20,
05107     typename T21, typename T22, typename T23, typename T24, typename T25,
05108     typename T26, typename T27, typename T28, typename T29, typename T30,
05109     typename T31, typename T32, typename T33, typename T34, typename T35,
05110     typename T36, typename T37, typename T38, typename T39>
05111 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05112     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05113     T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
05114     internal::None, internal::None, internal::None, internal::None,
05115     internal::None, internal::None, internal::None, internal::None,
05116     internal::None, internal::None> {
05117   typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05118       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05119       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
05120 };
05121 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05122     typename T6, typename T7, typename T8, typename T9, typename T10,
05123     typename T11, typename T12, typename T13, typename T14, typename T15,
05124     typename T16, typename T17, typename T18, typename T19, typename T20,
05125     typename T21, typename T22, typename T23, typename T24, typename T25,
05126     typename T26, typename T27, typename T28, typename T29, typename T30,
05127     typename T31, typename T32, typename T33, typename T34, typename T35,
05128     typename T36, typename T37, typename T38, typename T39, typename T40>
05129 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05130     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05131     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
05132     internal::None, internal::None, internal::None, internal::None,
05133     internal::None, internal::None, internal::None, internal::None,
05134     internal::None> {
05135   typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05136       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05137       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
05138       T40> type;
05139 };
05140 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05141     typename T6, typename T7, typename T8, typename T9, typename T10,
05142     typename T11, typename T12, typename T13, typename T14, typename T15,
05143     typename T16, typename T17, typename T18, typename T19, typename T20,
05144     typename T21, typename T22, typename T23, typename T24, typename T25,
05145     typename T26, typename T27, typename T28, typename T29, typename T30,
05146     typename T31, typename T32, typename T33, typename T34, typename T35,
05147     typename T36, typename T37, typename T38, typename T39, typename T40,
05148     typename T41>
05149 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05150     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05151     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
05152     internal::None, internal::None, internal::None, internal::None,
05153     internal::None, internal::None, internal::None, internal::None> {
05154   typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05155       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05156       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05157       T41> type;
05158 };
05159 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05160     typename T6, typename T7, typename T8, typename T9, typename T10,
05161     typename T11, typename T12, typename T13, typename T14, typename T15,
05162     typename T16, typename T17, typename T18, typename T19, typename T20,
05163     typename T21, typename T22, typename T23, typename T24, typename T25,
05164     typename T26, typename T27, typename T28, typename T29, typename T30,
05165     typename T31, typename T32, typename T33, typename T34, typename T35,
05166     typename T36, typename T37, typename T38, typename T39, typename T40,
05167     typename T41, typename T42>
05168 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05169     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05170     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
05171     internal::None, internal::None, internal::None, internal::None,
05172     internal::None, internal::None, internal::None> {
05173   typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05174       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05175       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05176       T41, T42> type;
05177 };
05178 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05179     typename T6, typename T7, typename T8, typename T9, typename T10,
05180     typename T11, typename T12, typename T13, typename T14, typename T15,
05181     typename T16, typename T17, typename T18, typename T19, typename T20,
05182     typename T21, typename T22, typename T23, typename T24, typename T25,
05183     typename T26, typename T27, typename T28, typename T29, typename T30,
05184     typename T31, typename T32, typename T33, typename T34, typename T35,
05185     typename T36, typename T37, typename T38, typename T39, typename T40,
05186     typename T41, typename T42, typename T43>
05187 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05188     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05189     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
05190     internal::None, internal::None, internal::None, internal::None,
05191     internal::None, internal::None, internal::None> {
05192   typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05193       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05194       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05195       T41, T42, T43> type;
05196 };
05197 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05198     typename T6, typename T7, typename T8, typename T9, typename T10,
05199     typename T11, typename T12, typename T13, typename T14, typename T15,
05200     typename T16, typename T17, typename T18, typename T19, typename T20,
05201     typename T21, typename T22, typename T23, typename T24, typename T25,
05202     typename T26, typename T27, typename T28, typename T29, typename T30,
05203     typename T31, typename T32, typename T33, typename T34, typename T35,
05204     typename T36, typename T37, typename T38, typename T39, typename T40,
05205     typename T41, typename T42, typename T43, typename T44>
05206 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05207     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05208     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
05209     internal::None, internal::None, internal::None, internal::None,
05210     internal::None, internal::None> {
05211   typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05212       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05213       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05214       T41, T42, T43, T44> type;
05215 };
05216 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05217     typename T6, typename T7, typename T8, typename T9, typename T10,
05218     typename T11, typename T12, typename T13, typename T14, typename T15,
05219     typename T16, typename T17, typename T18, typename T19, typename T20,
05220     typename T21, typename T22, typename T23, typename T24, typename T25,
05221     typename T26, typename T27, typename T28, typename T29, typename T30,
05222     typename T31, typename T32, typename T33, typename T34, typename T35,
05223     typename T36, typename T37, typename T38, typename T39, typename T40,
05224     typename T41, typename T42, typename T43, typename T44, typename T45>
05225 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05226     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05227     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05228     internal::None, internal::None, internal::None, internal::None,
05229     internal::None> {
05230   typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05231       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05232       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05233       T41, T42, T43, T44, T45> type;
05234 };
05235 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05236     typename T6, typename T7, typename T8, typename T9, typename T10,
05237     typename T11, typename T12, typename T13, typename T14, typename T15,
05238     typename T16, typename T17, typename T18, typename T19, typename T20,
05239     typename T21, typename T22, typename T23, typename T24, typename T25,
05240     typename T26, typename T27, typename T28, typename T29, typename T30,
05241     typename T31, typename T32, typename T33, typename T34, typename T35,
05242     typename T36, typename T37, typename T38, typename T39, typename T40,
05243     typename T41, typename T42, typename T43, typename T44, typename T45,
05244     typename T46>
05245 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05246     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05247     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05248     T46, internal::None, internal::None, internal::None, internal::None> {
05249   typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05250       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05251       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05252       T41, T42, T43, T44, T45, T46> type;
05253 };
05254 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05255     typename T6, typename T7, typename T8, typename T9, typename T10,
05256     typename T11, typename T12, typename T13, typename T14, typename T15,
05257     typename T16, typename T17, typename T18, typename T19, typename T20,
05258     typename T21, typename T22, typename T23, typename T24, typename T25,
05259     typename T26, typename T27, typename T28, typename T29, typename T30,
05260     typename T31, typename T32, typename T33, typename T34, typename T35,
05261     typename T36, typename T37, typename T38, typename T39, typename T40,
05262     typename T41, typename T42, typename T43, typename T44, typename T45,
05263     typename T46, typename T47>
05264 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05265     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05266     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05267     T46, T47, internal::None, internal::None, internal::None> {
05268   typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05269       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05270       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05271       T41, T42, T43, T44, T45, T46, T47> type;
05272 };
05273 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05274     typename T6, typename T7, typename T8, typename T9, typename T10,
05275     typename T11, typename T12, typename T13, typename T14, typename T15,
05276     typename T16, typename T17, typename T18, typename T19, typename T20,
05277     typename T21, typename T22, typename T23, typename T24, typename T25,
05278     typename T26, typename T27, typename T28, typename T29, typename T30,
05279     typename T31, typename T32, typename T33, typename T34, typename T35,
05280     typename T36, typename T37, typename T38, typename T39, typename T40,
05281     typename T41, typename T42, typename T43, typename T44, typename T45,
05282     typename T46, typename T47, typename T48>
05283 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05284     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05285     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05286     T46, T47, T48, internal::None, internal::None> {
05287   typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05288       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05289       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05290       T41, T42, T43, T44, T45, T46, T47, T48> type;
05291 };
05292 template <typename T1, typename T2, typename T3, typename T4, typename T5,
05293     typename T6, typename T7, typename T8, typename T9, typename T10,
05294     typename T11, typename T12, typename T13, typename T14, typename T15,
05295     typename T16, typename T17, typename T18, typename T19, typename T20,
05296     typename T21, typename T22, typename T23, typename T24, typename T25,
05297     typename T26, typename T27, typename T28, typename T29, typename T30,
05298     typename T31, typename T32, typename T33, typename T34, typename T35,
05299     typename T36, typename T37, typename T38, typename T39, typename T40,
05300     typename T41, typename T42, typename T43, typename T44, typename T45,
05301     typename T46, typename T47, typename T48, typename T49>
05302 struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
05303     T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
05304     T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
05305     T46, T47, T48, T49, internal::None> {
05306   typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
05307       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
05308       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
05309       T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
05310 };
05311 
05312 namespace internal {
05313 
05314 # define GTEST_TEMPLATE_ template <typename T> class
05315 
05316 // The template "selector" struct TemplateSel<Tmpl> is used to
05317 // represent Tmpl, which must be a class template with one type
05318 // parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined
05319 // as the type Tmpl<T>.  This allows us to actually instantiate the
05320 // template "selected" by TemplateSel<Tmpl>.
05321 //
05322 // This trick is necessary for simulating typedef for class templates,
05323 // which C++ doesn't support directly.
05324 template <GTEST_TEMPLATE_ Tmpl>
05325 struct TemplateSel {
05326   template <typename T>
05327   struct Bind {
05328     typedef Tmpl<T> type;
05329   };
05330 };
05331 
05332 # define GTEST_BIND_(TmplSel, T) \
05333   TmplSel::template Bind<T>::type
05334 
05335 // A unique struct template used as the default value for the
05336 // arguments of class template Templates.  This allows us to simulate
05337 // variadic templates (e.g. Templates<int>, Templates<int, double>,
05338 // and etc), which C++ doesn't support directly.
05339 template <typename T>
05340 struct NoneT {};
05341 
05342 // The following family of struct and struct templates are used to
05343 // represent template lists.  In particular, TemplatesN<T1, T2, ...,
05344 // TN> represents a list of N templates (T1, T2, ..., and TN).  Except
05345 // for Templates0, every struct in the family has two member types:
05346 // Head for the selector of the first template in the list, and Tail
05347 // for the rest of the list.
05348 
05349 // The empty template list.
05350 struct Templates0 {};
05351 
05352 // Template lists of length 1, 2, 3, and so on.
05353 
05354 template <GTEST_TEMPLATE_ T1>
05355 struct Templates1 {
05356   typedef TemplateSel<T1> Head;
05357   typedef Templates0 Tail;
05358 };
05359 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
05360 struct Templates2 {
05361   typedef TemplateSel<T1> Head;
05362   typedef Templates1<T2> Tail;
05363 };
05364 
05365 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
05366 struct Templates3 {
05367   typedef TemplateSel<T1> Head;
05368   typedef Templates2<T2, T3> Tail;
05369 };
05370 
05371 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05372     GTEST_TEMPLATE_ T4>
05373 struct Templates4 {
05374   typedef TemplateSel<T1> Head;
05375   typedef Templates3<T2, T3, T4> Tail;
05376 };
05377 
05378 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05379     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
05380 struct Templates5 {
05381   typedef TemplateSel<T1> Head;
05382   typedef Templates4<T2, T3, T4, T5> Tail;
05383 };
05384 
05385 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05386     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
05387 struct Templates6 {
05388   typedef TemplateSel<T1> Head;
05389   typedef Templates5<T2, T3, T4, T5, T6> Tail;
05390 };
05391 
05392 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05393     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05394     GTEST_TEMPLATE_ T7>
05395 struct Templates7 {
05396   typedef TemplateSel<T1> Head;
05397   typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
05398 };
05399 
05400 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05401     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05402     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
05403 struct Templates8 {
05404   typedef TemplateSel<T1> Head;
05405   typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
05406 };
05407 
05408 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05409     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05410     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
05411 struct Templates9 {
05412   typedef TemplateSel<T1> Head;
05413   typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
05414 };
05415 
05416 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05417     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05418     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05419     GTEST_TEMPLATE_ T10>
05420 struct Templates10 {
05421   typedef TemplateSel<T1> Head;
05422   typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
05423 };
05424 
05425 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05426     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05427     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05428     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
05429 struct Templates11 {
05430   typedef TemplateSel<T1> Head;
05431   typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
05432 };
05433 
05434 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05435     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05436     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05437     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
05438 struct Templates12 {
05439   typedef TemplateSel<T1> Head;
05440   typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
05441 };
05442 
05443 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05444     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05445     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05446     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05447     GTEST_TEMPLATE_ T13>
05448 struct Templates13 {
05449   typedef TemplateSel<T1> Head;
05450   typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
05451 };
05452 
05453 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05454     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05455     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05456     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05457     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
05458 struct Templates14 {
05459   typedef TemplateSel<T1> Head;
05460   typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
05461       T14> Tail;
05462 };
05463 
05464 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05465     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05466     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05467     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05468     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
05469 struct Templates15 {
05470   typedef TemplateSel<T1> Head;
05471   typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05472       T15> Tail;
05473 };
05474 
05475 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05476     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05477     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05478     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05479     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05480     GTEST_TEMPLATE_ T16>
05481 struct Templates16 {
05482   typedef TemplateSel<T1> Head;
05483   typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05484       T15, T16> Tail;
05485 };
05486 
05487 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05488     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05489     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05490     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05491     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05492     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
05493 struct Templates17 {
05494   typedef TemplateSel<T1> Head;
05495   typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05496       T15, T16, T17> Tail;
05497 };
05498 
05499 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05500     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05501     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05502     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05503     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05504     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
05505 struct Templates18 {
05506   typedef TemplateSel<T1> Head;
05507   typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05508       T15, T16, T17, T18> Tail;
05509 };
05510 
05511 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05512     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05513     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05514     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05515     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05516     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05517     GTEST_TEMPLATE_ T19>
05518 struct Templates19 {
05519   typedef TemplateSel<T1> Head;
05520   typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05521       T15, T16, T17, T18, T19> Tail;
05522 };
05523 
05524 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05525     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05526     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05527     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05528     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05529     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05530     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
05531 struct Templates20 {
05532   typedef TemplateSel<T1> Head;
05533   typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05534       T15, T16, T17, T18, T19, T20> Tail;
05535 };
05536 
05537 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05538     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05539     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05540     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05541     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05542     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05543     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
05544 struct Templates21 {
05545   typedef TemplateSel<T1> Head;
05546   typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05547       T15, T16, T17, T18, T19, T20, T21> Tail;
05548 };
05549 
05550 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05551     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05552     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05553     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05554     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05555     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05556     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05557     GTEST_TEMPLATE_ T22>
05558 struct Templates22 {
05559   typedef TemplateSel<T1> Head;
05560   typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05561       T15, T16, T17, T18, T19, T20, T21, T22> Tail;
05562 };
05563 
05564 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05565     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05566     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05567     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05568     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05569     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05570     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05571     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
05572 struct Templates23 {
05573   typedef TemplateSel<T1> Head;
05574   typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05575       T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
05576 };
05577 
05578 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05579     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05580     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05581     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05582     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05583     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05584     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05585     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
05586 struct Templates24 {
05587   typedef TemplateSel<T1> Head;
05588   typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05589       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
05590 };
05591 
05592 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05593     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05594     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05595     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05596     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05597     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05598     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05599     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05600     GTEST_TEMPLATE_ T25>
05601 struct Templates25 {
05602   typedef TemplateSel<T1> Head;
05603   typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05604       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
05605 };
05606 
05607 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05608     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05609     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05610     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05611     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05612     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05613     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05614     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05615     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
05616 struct Templates26 {
05617   typedef TemplateSel<T1> Head;
05618   typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05619       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
05620 };
05621 
05622 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05623     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05624     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05625     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05626     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05627     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05628     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05629     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05630     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
05631 struct Templates27 {
05632   typedef TemplateSel<T1> Head;
05633   typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05634       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
05635 };
05636 
05637 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05638     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05639     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05640     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05641     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05642     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05643     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05644     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05645     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05646     GTEST_TEMPLATE_ T28>
05647 struct Templates28 {
05648   typedef TemplateSel<T1> Head;
05649   typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05650       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
05651       T28> Tail;
05652 };
05653 
05654 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05655     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05656     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05657     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05658     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05659     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05660     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05661     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05662     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05663     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
05664 struct Templates29 {
05665   typedef TemplateSel<T1> Head;
05666   typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05667       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05668       T29> Tail;
05669 };
05670 
05671 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05672     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05673     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05674     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05675     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05676     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05677     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05678     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05679     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05680     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
05681 struct Templates30 {
05682   typedef TemplateSel<T1> Head;
05683   typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05684       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05685       T29, T30> Tail;
05686 };
05687 
05688 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05689     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05690     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05691     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05692     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05693     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05694     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05695     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05696     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05697     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05698     GTEST_TEMPLATE_ T31>
05699 struct Templates31 {
05700   typedef TemplateSel<T1> Head;
05701   typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05702       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05703       T29, T30, T31> Tail;
05704 };
05705 
05706 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05707     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05708     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05709     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05710     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05711     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05712     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05713     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05714     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05715     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05716     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
05717 struct Templates32 {
05718   typedef TemplateSel<T1> Head;
05719   typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05720       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05721       T29, T30, T31, T32> Tail;
05722 };
05723 
05724 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05725     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05726     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05727     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05728     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05729     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05730     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05731     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05732     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05733     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05734     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
05735 struct Templates33 {
05736   typedef TemplateSel<T1> Head;
05737   typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05738       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05739       T29, T30, T31, T32, T33> Tail;
05740 };
05741 
05742 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05743     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05744     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05745     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05746     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05747     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05748     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05749     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05750     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05751     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05752     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05753     GTEST_TEMPLATE_ T34>
05754 struct Templates34 {
05755   typedef TemplateSel<T1> Head;
05756   typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05757       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05758       T29, T30, T31, T32, T33, T34> Tail;
05759 };
05760 
05761 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05762     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05763     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05764     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05765     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05766     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05767     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05768     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05769     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05770     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05771     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05772     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
05773 struct Templates35 {
05774   typedef TemplateSel<T1> Head;
05775   typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05776       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05777       T29, T30, T31, T32, T33, T34, T35> Tail;
05778 };
05779 
05780 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05781     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05782     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05783     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05784     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05785     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05786     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05787     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05788     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05789     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05790     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05791     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
05792 struct Templates36 {
05793   typedef TemplateSel<T1> Head;
05794   typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05795       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05796       T29, T30, T31, T32, T33, T34, T35, T36> Tail;
05797 };
05798 
05799 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05800     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05801     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05802     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05803     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05804     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05805     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05806     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05807     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05808     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05809     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05810     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05811     GTEST_TEMPLATE_ T37>
05812 struct Templates37 {
05813   typedef TemplateSel<T1> Head;
05814   typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05815       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05816       T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
05817 };
05818 
05819 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05820     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05821     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05822     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05823     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05824     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05825     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05826     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05827     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05828     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05829     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05830     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05831     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
05832 struct Templates38 {
05833   typedef TemplateSel<T1> Head;
05834   typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05835       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05836       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
05837 };
05838 
05839 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05840     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05841     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05842     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05843     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05844     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05845     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05846     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05847     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05848     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05849     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05850     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05851     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
05852 struct Templates39 {
05853   typedef TemplateSel<T1> Head;
05854   typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05855       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05856       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
05857 };
05858 
05859 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05860     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05861     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05862     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05863     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05864     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05865     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05866     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05867     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05868     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05869     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05870     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05871     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05872     GTEST_TEMPLATE_ T40>
05873 struct Templates40 {
05874   typedef TemplateSel<T1> Head;
05875   typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05876       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05877       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
05878 };
05879 
05880 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05881     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05882     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05883     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05884     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05885     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05886     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05887     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05888     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05889     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05890     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05891     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05892     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05893     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
05894 struct Templates41 {
05895   typedef TemplateSel<T1> Head;
05896   typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05897       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05898       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
05899 };
05900 
05901 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05902     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05903     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05904     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05905     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05906     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05907     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05908     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05909     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05910     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05911     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05912     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05913     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05914     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
05915 struct Templates42 {
05916   typedef TemplateSel<T1> Head;
05917   typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05918       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05919       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
05920       T42> Tail;
05921 };
05922 
05923 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05924     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05925     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05926     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05927     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05928     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05929     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05930     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05931     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05932     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05933     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05934     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05935     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05936     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05937     GTEST_TEMPLATE_ T43>
05938 struct Templates43 {
05939   typedef TemplateSel<T1> Head;
05940   typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05941       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05942       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05943       T43> Tail;
05944 };
05945 
05946 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05947     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05948     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05949     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05950     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05951     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05952     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05953     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05954     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05955     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05956     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05957     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05958     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05959     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05960     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
05961 struct Templates44 {
05962   typedef TemplateSel<T1> Head;
05963   typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05964       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05965       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05966       T43, T44> Tail;
05967 };
05968 
05969 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05970     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05971     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05972     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05973     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05974     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05975     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05976     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
05977     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
05978     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
05979     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
05980     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
05981     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
05982     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
05983     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
05984 struct Templates45 {
05985   typedef TemplateSel<T1> Head;
05986   typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
05987       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
05988       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
05989       T43, T44, T45> Tail;
05990 };
05991 
05992 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
05993     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
05994     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
05995     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
05996     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
05997     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
05998     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
05999     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06000     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06001     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06002     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06003     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06004     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06005     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06006     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06007     GTEST_TEMPLATE_ T46>
06008 struct Templates46 {
06009   typedef TemplateSel<T1> Head;
06010   typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06011       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06012       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
06013       T43, T44, T45, T46> Tail;
06014 };
06015 
06016 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06017     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06018     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06019     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06020     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06021     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06022     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06023     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06024     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06025     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06026     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06027     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06028     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06029     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06030     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06031     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
06032 struct Templates47 {
06033   typedef TemplateSel<T1> Head;
06034   typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06035       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06036       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
06037       T43, T44, T45, T46, T47> Tail;
06038 };
06039 
06040 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06041     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06042     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06043     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06044     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06045     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06046     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06047     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06048     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06049     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06050     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06051     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06052     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06053     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06054     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06055     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
06056 struct Templates48 {
06057   typedef TemplateSel<T1> Head;
06058   typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06059       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06060       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
06061       T43, T44, T45, T46, T47, T48> Tail;
06062 };
06063 
06064 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06065     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06066     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06067     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06068     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06069     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06070     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06071     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06072     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06073     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06074     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06075     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06076     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06077     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06078     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06079     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
06080     GTEST_TEMPLATE_ T49>
06081 struct Templates49 {
06082   typedef TemplateSel<T1> Head;
06083   typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06084       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06085       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
06086       T43, T44, T45, T46, T47, T48, T49> Tail;
06087 };
06088 
06089 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06090     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06091     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06092     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06093     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06094     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06095     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06096     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06097     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06098     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06099     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06100     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06101     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06102     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06103     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06104     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
06105     GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
06106 struct Templates50 {
06107   typedef TemplateSel<T1> Head;
06108   typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06109       T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06110       T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
06111       T43, T44, T45, T46, T47, T48, T49, T50> Tail;
06112 };
06113 
06114 
06115 // We don't want to require the users to write TemplatesN<...> directly,
06116 // as that would require them to count the length.  Templates<...> is much
06117 // easier to write, but generates horrible messages when there is a
06118 // compiler error, as gcc insists on printing out each template
06119 // argument, even if it has the default value (this means Templates<list>
06120 // will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
06121 // errors).
06122 //
06123 // Our solution is to combine the best part of the two approaches: a
06124 // user would write Templates<T1, ..., TN>, and Google Test will translate
06125 // that to TemplatesN<T1, ..., TN> internally to make error messages
06126 // readable.  The translation is done by the 'type' member of the
06127 // Templates template.
06128 template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
06129     GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
06130     GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
06131     GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
06132     GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
06133     GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
06134     GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
06135     GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
06136     GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
06137     GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
06138     GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
06139     GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
06140     GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
06141     GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
06142     GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
06143     GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
06144     GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
06145     GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
06146     GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
06147     GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
06148     GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
06149     GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
06150     GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
06151     GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
06152     GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
06153 struct Templates {
06154   typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06155       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06156       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06157       T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
06158 };
06159 
06160 template <>
06161 struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06162     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06163     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06164     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06165     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06166     NoneT> {
06167   typedef Templates0 type;
06168 };
06169 template <GTEST_TEMPLATE_ T1>
06170 struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06171     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06172     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06173     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06174     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06175     NoneT> {
06176   typedef Templates1<T1> type;
06177 };
06178 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
06179 struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06180     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06181     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06182     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06183     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06184     NoneT> {
06185   typedef Templates2<T1, T2> type;
06186 };
06187 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
06188 struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06189     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06190     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06191     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06192     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06193   typedef Templates3<T1, T2, T3> type;
06194 };
06195 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06196     GTEST_TEMPLATE_ T4>
06197 struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06198     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06199     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06200     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06201     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06202   typedef Templates4<T1, T2, T3, T4> type;
06203 };
06204 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06205     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
06206 struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06207     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06208     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06209     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06210     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06211   typedef Templates5<T1, T2, T3, T4, T5> type;
06212 };
06213 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06214     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
06215 struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
06216     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06217     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06218     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06219     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06220   typedef Templates6<T1, T2, T3, T4, T5, T6> type;
06221 };
06222 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06223     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06224     GTEST_TEMPLATE_ T7>
06225 struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
06226     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06227     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06228     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06229     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06230   typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
06231 };
06232 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06233     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06234     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
06235 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
06236     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06237     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06238     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06239     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06240   typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
06241 };
06242 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06243     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06244     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
06245 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
06246     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06247     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06248     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06249     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06250   typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
06251 };
06252 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06253     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06254     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06255     GTEST_TEMPLATE_ T10>
06256 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
06257     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06258     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06259     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06260     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06261   typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
06262 };
06263 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06264     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06265     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06266     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
06267 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
06268     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06269     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06270     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06271     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06272   typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
06273 };
06274 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06275     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06276     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06277     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
06278 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
06279     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06280     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06281     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06282     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06283   typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
06284 };
06285 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06286     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06287     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06288     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06289     GTEST_TEMPLATE_ T13>
06290 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
06291     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06292     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06293     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06294     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06295   typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
06296       T13> type;
06297 };
06298 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06299     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06300     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06301     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06302     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
06303 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06304     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06305     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06306     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06307     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06308   typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06309       T14> type;
06310 };
06311 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06312     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06313     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06314     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06315     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
06316 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06317     T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06318     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06319     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06320     NoneT, NoneT, NoneT, NoneT, NoneT> {
06321   typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06322       T14, T15> type;
06323 };
06324 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06325     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06326     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06327     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06328     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06329     GTEST_TEMPLATE_ T16>
06330 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06331     T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06332     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06333     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06334     NoneT, NoneT, NoneT, NoneT, NoneT> {
06335   typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06336       T14, T15, T16> type;
06337 };
06338 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06339     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06340     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06341     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06342     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06343     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
06344 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06345     T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06346     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06347     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06348     NoneT, NoneT, NoneT, NoneT, NoneT> {
06349   typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06350       T14, T15, T16, T17> type;
06351 };
06352 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06353     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06354     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06355     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06356     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06357     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
06358 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06359     T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06360     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06361     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06362     NoneT, NoneT, NoneT, NoneT> {
06363   typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06364       T14, T15, T16, T17, T18> type;
06365 };
06366 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06367     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06368     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06369     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06370     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06371     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06372     GTEST_TEMPLATE_ T19>
06373 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06374     T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06375     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06376     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06377     NoneT, NoneT, NoneT, NoneT> {
06378   typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06379       T14, T15, T16, T17, T18, T19> type;
06380 };
06381 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06382     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06383     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06384     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06385     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06386     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06387     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
06388 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06389     T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06390     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06391     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06392     NoneT, NoneT, NoneT, NoneT> {
06393   typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06394       T14, T15, T16, T17, T18, T19, T20> type;
06395 };
06396 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06397     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06398     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06399     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06400     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06401     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06402     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
06403 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06404     T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
06405     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06406     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06407     NoneT, NoneT, NoneT, NoneT> {
06408   typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06409       T14, T15, T16, T17, T18, T19, T20, T21> type;
06410 };
06411 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06412     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06413     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06414     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06415     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06416     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06417     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06418     GTEST_TEMPLATE_ T22>
06419 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06420     T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
06421     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06422     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06423     NoneT, NoneT, NoneT> {
06424   typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06425       T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
06426 };
06427 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06428     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06429     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06430     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06431     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06432     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06433     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06434     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
06435 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06436     T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
06437     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06438     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06439     NoneT, NoneT, NoneT> {
06440   typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06441       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
06442 };
06443 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06444     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06445     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06446     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06447     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06448     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06449     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06450     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
06451 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06452     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
06453     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06454     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06455     NoneT, NoneT, NoneT> {
06456   typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06457       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
06458 };
06459 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06460     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06461     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06462     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06463     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06464     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06465     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06466     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06467     GTEST_TEMPLATE_ T25>
06468 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06469     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
06470     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06471     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06472     NoneT, NoneT> {
06473   typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06474       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
06475 };
06476 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06477     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06478     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06479     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06480     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06481     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06482     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06483     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06484     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
06485 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06486     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
06487     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06488     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06489     NoneT, NoneT> {
06490   typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06491       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
06492 };
06493 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06494     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06495     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06496     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06497     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06498     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06499     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06500     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06501     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
06502 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06503     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
06504     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06505     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06506     NoneT, NoneT> {
06507   typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06508       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
06509       T27> type;
06510 };
06511 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06512     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06513     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06514     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06515     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06516     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06517     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06518     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06519     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06520     GTEST_TEMPLATE_ T28>
06521 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06522     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
06523     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06524     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06525     NoneT, NoneT> {
06526   typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06527       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06528       T28> type;
06529 };
06530 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06531     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06532     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06533     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06534     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06535     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06536     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06537     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06538     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06539     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
06540 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06541     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06542     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06543     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06544     NoneT> {
06545   typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06546       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06547       T28, T29> type;
06548 };
06549 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06550     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06551     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06552     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06553     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06554     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06555     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06556     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06557     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06558     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
06559 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06560     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06561     T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06562     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06563   typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06564       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06565       T28, T29, T30> type;
06566 };
06567 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06568     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06569     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06570     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06571     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06572     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06573     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06574     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06575     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06576     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06577     GTEST_TEMPLATE_ T31>
06578 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06579     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06580     T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06581     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06582   typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06583       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06584       T28, T29, T30, T31> type;
06585 };
06586 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06587     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06588     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06589     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06590     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06591     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06592     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06593     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06594     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06595     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06596     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
06597 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06598     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06599     T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06600     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06601   typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06602       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06603       T28, T29, T30, T31, T32> type;
06604 };
06605 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06606     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06607     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06608     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06609     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06610     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06611     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06612     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06613     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06614     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06615     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
06616 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06617     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06618     T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06619     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06620   typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06621       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06622       T28, T29, T30, T31, T32, T33> type;
06623 };
06624 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06625     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06626     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06627     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06628     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06629     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06630     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06631     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06632     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06633     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06634     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06635     GTEST_TEMPLATE_ T34>
06636 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06637     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06638     T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06639     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06640   typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06641       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06642       T28, T29, T30, T31, T32, T33, T34> type;
06643 };
06644 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06645     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06646     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06647     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06648     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06649     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06650     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06651     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06652     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06653     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06654     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06655     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
06656 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06657     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06658     T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
06659     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06660   typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06661       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06662       T28, T29, T30, T31, T32, T33, T34, T35> type;
06663 };
06664 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06665     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06666     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06667     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06668     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06669     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06670     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06671     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06672     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06673     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06674     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06675     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
06676 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06677     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06678     T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
06679     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06680   typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06681       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06682       T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
06683 };
06684 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06685     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06686     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06687     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06688     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06689     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06690     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06691     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06692     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06693     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06694     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06695     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06696     GTEST_TEMPLATE_ T37>
06697 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06698     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06699     T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
06700     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06701   typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06702       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06703       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
06704 };
06705 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06706     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06707     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06708     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06709     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06710     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06711     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06712     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06713     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06714     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06715     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06716     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06717     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
06718 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06719     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06720     T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
06721     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06722   typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06723       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06724       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
06725 };
06726 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06727     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06728     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06729     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06730     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06731     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06732     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06733     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06734     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06735     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06736     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06737     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06738     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
06739 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06740     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06741     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
06742     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06743   typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06744       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06745       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
06746 };
06747 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06748     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06749     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06750     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06751     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06752     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06753     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06754     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06755     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06756     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06757     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06758     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06759     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06760     GTEST_TEMPLATE_ T40>
06761 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06762     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06763     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
06764     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06765   typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06766       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06767       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
06768 };
06769 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06770     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06771     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06772     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06773     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06774     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06775     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06776     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06777     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06778     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06779     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06780     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06781     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06782     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
06783 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06784     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06785     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
06786     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06787   typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06788       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06789       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
06790       T41> type;
06791 };
06792 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06793     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06794     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06795     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06796     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06797     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06798     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06799     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06800     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06801     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06802     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06803     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06804     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06805     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
06806 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06807     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06808     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
06809     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06810   typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06811       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06812       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06813       T42> type;
06814 };
06815 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06816     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06817     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06818     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06819     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06820     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06821     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06822     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06823     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06824     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06825     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06826     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06827     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06828     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06829     GTEST_TEMPLATE_ T43>
06830 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06831     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06832     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
06833     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06834   typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06835       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06836       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06837       T42, T43> type;
06838 };
06839 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06840     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06841     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06842     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06843     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06844     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06845     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06846     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06847     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06848     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06849     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06850     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06851     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06852     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06853     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
06854 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06855     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06856     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06857     NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
06858   typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06859       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06860       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06861       T42, T43, T44> type;
06862 };
06863 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06864     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06865     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06866     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06867     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06868     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06869     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06870     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06871     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06872     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06873     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06874     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06875     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06876     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06877     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
06878 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06879     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06880     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06881     T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
06882   typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06883       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06884       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06885       T42, T43, T44, T45> type;
06886 };
06887 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06888     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06889     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06890     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06891     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06892     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06893     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06894     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06895     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06896     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06897     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06898     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06899     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06900     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06901     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06902     GTEST_TEMPLATE_ T46>
06903 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06904     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06905     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06906     T45, T46, NoneT, NoneT, NoneT, NoneT> {
06907   typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06908       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06909       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06910       T42, T43, T44, T45, T46> type;
06911 };
06912 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06913     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06914     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06915     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06916     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06917     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06918     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06919     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06920     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06921     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06922     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06923     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06924     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06925     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06926     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06927     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
06928 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06929     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06930     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06931     T45, T46, T47, NoneT, NoneT, NoneT> {
06932   typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06933       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06934       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06935       T42, T43, T44, T45, T46, T47> type;
06936 };
06937 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06938     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06939     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06940     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06941     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06942     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06943     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06944     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06945     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06946     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06947     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06948     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06949     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06950     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06951     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06952     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
06953 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06954     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06955     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06956     T45, T46, T47, T48, NoneT, NoneT> {
06957   typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06958       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06959       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06960       T42, T43, T44, T45, T46, T47, T48> type;
06961 };
06962 template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
06963     GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
06964     GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
06965     GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
06966     GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
06967     GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
06968     GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
06969     GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
06970     GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
06971     GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
06972     GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
06973     GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
06974     GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
06975     GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
06976     GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
06977     GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
06978     GTEST_TEMPLATE_ T49>
06979 struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
06980     T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
06981     T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
06982     T45, T46, T47, T48, T49, NoneT> {
06983   typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
06984       T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
06985       T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
06986       T42, T43, T44, T45, T46, T47, T48, T49> type;
06987 };
06988 
06989 // The TypeList template makes it possible to use either a single type
06990 // or a Types<...> list in TYPED_TEST_CASE() and
06991 // INSTANTIATE_TYPED_TEST_CASE_P().
06992 
06993 template <typename T>
06994 struct TypeList {
06995   typedef Types1<T> type;
06996 };
06997 
06998 template <typename T1, typename T2, typename T3, typename T4, typename T5,
06999     typename T6, typename T7, typename T8, typename T9, typename T10,
07000     typename T11, typename T12, typename T13, typename T14, typename T15,
07001     typename T16, typename T17, typename T18, typename T19, typename T20,
07002     typename T21, typename T22, typename T23, typename T24, typename T25,
07003     typename T26, typename T27, typename T28, typename T29, typename T30,
07004     typename T31, typename T32, typename T33, typename T34, typename T35,
07005     typename T36, typename T37, typename T38, typename T39, typename T40,
07006     typename T41, typename T42, typename T43, typename T44, typename T45,
07007     typename T46, typename T47, typename T48, typename T49, typename T50>
07008 struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
07009     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
07010     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
07011     T44, T45, T46, T47, T48, T49, T50> > {
07012   typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
07013       T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
07014       T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
07015       T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
07016 };
07017 
07018 #endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
07019 
07020 }  // namespace internal
07021 }  // namespace testing
07022 
07023 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
07024 
07025 // Due to C++ preprocessor weirdness, we need double indirection to
07026 // concatenate two tokens when one of them is __LINE__.  Writing
07027 //
07028 //   foo ## __LINE__
07029 //
07030 // will result in the token foo__LINE__, instead of foo followed by
07031 // the current line number.  For more details, see
07032 // http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
07033 #define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
07034 #define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
07035 
07036 class ProtocolMessage;
07037 namespace proto2 { class Message; }
07038 
07039 namespace testing {
07040 
07041 // Forward declarations.
07042 
07043 class AssertionResult;                 // Result of an assertion.
07044 class Message;                         // Represents a failure message.
07045 class Test;                            // Represents a test.
07046 class TestInfo;                        // Information about a test.
07047 class TestPartResult;                  // Result of a test part.
07048 class UnitTest;                        // A collection of test cases.
07049 
07050 template <typename T>
07051 ::std::string PrintToString(const T& value);
07052 
07053 namespace internal {
07054 
07055 struct TraceInfo;                      // Information about a trace point.
07056 class ScopedTrace;                     // Implements scoped trace.
07057 class TestInfoImpl;                    // Opaque implementation of TestInfo
07058 class UnitTestImpl;                    // Opaque implementation of UnitTest
07059 
07060 // How many times InitGoogleTest() has been called.
07061 GTEST_API_ extern int g_init_gtest_count;
07062 
07063 // The text used in failure messages to indicate the start of the
07064 // stack trace.
07065 GTEST_API_ extern const char kStackTraceMarker[];
07066 
07067 // Two overloaded helpers for checking at compile time whether an
07068 // expression is a null pointer literal (i.e. NULL or any 0-valued
07069 // compile-time integral constant).  Their return values have
07070 // different sizes, so we can use sizeof() to test which version is
07071 // picked by the compiler.  These helpers have no implementations, as
07072 // we only need their signatures.
07073 //
07074 // Given IsNullLiteralHelper(x), the compiler will pick the first
07075 // version if x can be implicitly converted to Secret*, and pick the
07076 // second version otherwise.  Since Secret is a secret and incomplete
07077 // type, the only expression a user can write that has type Secret* is
07078 // a null pointer literal.  Therefore, we know that x is a null
07079 // pointer literal if and only if the first version is picked by the
07080 // compiler.
07081 char IsNullLiteralHelper(Secret* p);
07082 char (&IsNullLiteralHelper(...))[2];  // NOLINT
07083 
07084 // A compile-time bool constant that is true if and only if x is a
07085 // null pointer literal (i.e. NULL or any 0-valued compile-time
07086 // integral constant).
07087 #ifdef GTEST_ELLIPSIS_NEEDS_POD_
07088 // We lose support for NULL detection where the compiler doesn't like
07089 // passing non-POD classes through ellipsis (...).
07090 # define GTEST_IS_NULL_LITERAL_(x) false
07091 #else
07092 # define GTEST_IS_NULL_LITERAL_(x) \
07093     (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
07094 #endif  // GTEST_ELLIPSIS_NEEDS_POD_
07095 
07096 // Appends the user-supplied message to the Google-Test-generated message.
07097 GTEST_API_ std::string AppendUserMessage(
07098     const std::string& gtest_msg, const Message& user_msg);
07099 
07100 #if GTEST_HAS_EXCEPTIONS
07101 
07102 // This exception is thrown by (and only by) a failed Google Test
07103 // assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
07104 // are enabled).  We derive it from std::runtime_error, which is for
07105 // errors presumably detectable only at run time.  Since
07106 // std::runtime_error inherits from std::exception, many testing
07107 // frameworks know how to extract and print the message inside it.
07108 class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
07109  public:
07110   explicit GoogleTestFailureException(const TestPartResult& failure);
07111 };
07112 
07113 #endif  // GTEST_HAS_EXCEPTIONS
07114 
07115 // A helper class for creating scoped traces in user programs.
07116 class GTEST_API_ ScopedTrace {
07117  public:
07118   // The c'tor pushes the given source file location and message onto
07119   // a trace stack maintained by Google Test.
07120   ScopedTrace(const char* file, int line, const Message& message);
07121 
07122   // The d'tor pops the info pushed by the c'tor.
07123   //
07124   // Note that the d'tor is not virtual in order to be efficient.
07125   // Don't inherit from ScopedTrace!
07126   ~ScopedTrace();
07127 
07128  private:
07129   GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
07130 } GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its
07131                             // c'tor and d'tor.  Therefore it doesn't
07132                             // need to be used otherwise.
07133 
07134 // Constructs and returns the message for an equality assertion
07135 // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
07136 //
07137 // The first four parameters are the expressions used in the assertion
07138 // and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
07139 // where foo is 5 and bar is 6, we have:
07140 //
07141 //   expected_expression: "foo"
07142 //   actual_expression:   "bar"
07143 //   expected_value:      "5"
07144 //   actual_value:        "6"
07145 //
07146 // The ignoring_case parameter is true iff the assertion is a
07147 // *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will
07148 // be inserted into the message.
07149 GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
07150                                      const char* actual_expression,
07151                                      const std::string& expected_value,
07152                                      const std::string& actual_value,
07153                                      bool ignoring_case);
07154 
07155 // Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
07156 GTEST_API_ std::string GetBoolAssertionFailureMessage(
07157     const AssertionResult& assertion_result,
07158     const char* expression_text,
07159     const char* actual_predicate_value,
07160     const char* expected_predicate_value);
07161 
07162 // This template class represents an IEEE floating-point number
07163 // (either single-precision or double-precision, depending on the
07164 // template parameters).
07165 //
07166 // The purpose of this class is to do more sophisticated number
07167 // comparison.  (Due to round-off error, etc, it's very unlikely that
07168 // two floating-points will be equal exactly.  Hence a naive
07169 // comparison by the == operation often doesn't work.)
07170 //
07171 // Format of IEEE floating-point:
07172 //
07173 //   The most-significant bit being the leftmost, an IEEE
07174 //   floating-point looks like
07175 //
07176 //     sign_bit exponent_bits fraction_bits
07177 //
07178 //   Here, sign_bit is a single bit that designates the sign of the
07179 //   number.
07180 //
07181 //   For float, there are 8 exponent bits and 23 fraction bits.
07182 //
07183 //   For double, there are 11 exponent bits and 52 fraction bits.
07184 //
07185 //   More details can be found at
07186 //   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
07187 //
07188 // Template parameter:
07189 //
07190 //   RawType: the raw floating-point type (either float or double)
07191 template <typename RawType>
07192 class FloatingPoint {
07193  public:
07194   // Defines the unsigned integer type that has the same size as the
07195   // floating point number.
07196   typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
07197 
07198   // Constants.
07199 
07200   // # of bits in a number.
07201   static const size_t kBitCount = 8*sizeof(RawType);
07202 
07203   // # of fraction bits in a number.
07204   static const size_t kFractionBitCount =
07205     std::numeric_limits<RawType>::digits - 1;
07206 
07207   // # of exponent bits in a number.
07208   static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
07209 
07210   // The mask for the sign bit.
07211   static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
07212 
07213   // The mask for the fraction bits.
07214   static const Bits kFractionBitMask =
07215     ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
07216 
07217   // The mask for the exponent bits.
07218   static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
07219 
07220   // How many ULP's (Units in the Last Place) we want to tolerate when
07221   // comparing two numbers.  The larger the value, the more error we
07222   // allow.  A 0 value means that two numbers must be exactly the same
07223   // to be considered equal.
07224   //
07225   // The maximum error of a single floating-point operation is 0.5
07226   // units in the last place.  On Intel CPU's, all floating-point
07227   // calculations are done with 80-bit precision, while double has 64
07228   // bits.  Therefore, 4 should be enough for ordinary use.
07229   //
07230   // See the following article for more details on ULP:
07231   // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
07232   static const size_t kMaxUlps = 4;
07233 
07234   // Constructs a FloatingPoint from a raw floating-point number.
07235   //
07236   // On an Intel CPU, passing a non-normalized NAN (Not a Number)
07237   // around may change its bits, although the new value is guaranteed
07238   // to be also a NAN.  Therefore, don't expect this constructor to
07239   // preserve the bits in x when x is a NAN.
07240   explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
07241 
07242   // Static methods
07243 
07244   // Reinterprets a bit pattern as a floating-point number.
07245   //
07246   // This function is needed to test the AlmostEquals() method.
07247   static RawType ReinterpretBits(const Bits bits) {
07248     FloatingPoint fp(0);
07249     fp.u_.bits_ = bits;
07250     return fp.u_.value_;
07251   }
07252 
07253   // Returns the floating-point number that represent positive infinity.
07254   static RawType Infinity() {
07255     return ReinterpretBits(kExponentBitMask);
07256   }
07257 
07258   // Returns the maximum representable finite floating-point number.
07259   static RawType Max();
07260 
07261   // Non-static methods
07262 
07263   // Returns the bits that represents this number.
07264   const Bits &bits() const { return u_.bits_; }
07265 
07266   // Returns the exponent bits of this number.
07267   Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
07268 
07269   // Returns the fraction bits of this number.
07270   Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
07271 
07272   // Returns the sign bit of this number.
07273   Bits sign_bit() const { return kSignBitMask & u_.bits_; }
07274 
07275   // Returns true iff this is NAN (not a number).
07276   bool is_nan() const {
07277     // It's a NAN if the exponent bits are all ones and the fraction
07278     // bits are not entirely zeros.
07279     return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
07280   }
07281 
07282   // Returns true iff this number is at most kMaxUlps ULP's away from
07283   // rhs.  In particular, this function:
07284   //
07285   //   - returns false if either number is (or both are) NAN.
07286   //   - treats really large numbers as almost equal to infinity.
07287   //   - thinks +0.0 and -0.0 are 0 DLP's apart.
07288   bool AlmostEquals(const FloatingPoint& rhs) const {
07289     // The IEEE standard says that any comparison operation involving
07290     // a NAN must return false.
07291     if (is_nan() || rhs.is_nan()) return false;
07292 
07293     return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
07294         <= kMaxUlps;
07295   }
07296 
07297  private:
07298   // The data type used to store the actual floating-point number.
07299   union FloatingPointUnion {
07300     RawType value_;  // The raw floating-point number.
07301     Bits bits_;      // The bits that represent the number.
07302   };
07303 
07304   // Converts an integer from the sign-and-magnitude representation to
07305   // the biased representation.  More precisely, let N be 2 to the
07306   // power of (kBitCount - 1), an integer x is represented by the
07307   // unsigned number x + N.
07308   //
07309   // For instance,
07310   //
07311   //   -N + 1 (the most negative number representable using
07312   //          sign-and-magnitude) is represented by 1;
07313   //   0      is represented by N; and
07314   //   N - 1  (the biggest number representable using
07315   //          sign-and-magnitude) is represented by 2N - 1.
07316   //
07317   // Read http://en.wikipedia.org/wiki/Signed_number_representations
07318   // for more details on signed number representations.
07319   static Bits SignAndMagnitudeToBiased(const Bits &sam) {
07320     if (kSignBitMask & sam) {
07321       // sam represents a negative number.
07322       return ~sam + 1;
07323     } else {
07324       // sam represents a positive number.
07325       return kSignBitMask | sam;
07326     }
07327   }
07328 
07329   // Given two numbers in the sign-and-magnitude representation,
07330   // returns the distance between them as an unsigned number.
07331   static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
07332                                                      const Bits &sam2) {
07333     const Bits biased1 = SignAndMagnitudeToBiased(sam1);
07334     const Bits biased2 = SignAndMagnitudeToBiased(sam2);
07335     return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
07336   }
07337 
07338   FloatingPointUnion u_;
07339 };
07340 
07341 // We cannot use std::numeric_limits<T>::max() as it clashes with the max()
07342 // macro defined by <windows.h>.
07343 template <>
07344 inline float FloatingPoint<float>::Max() { return FLT_MAX; }
07345 template <>
07346 inline double FloatingPoint<double>::Max() { return DBL_MAX; }
07347 
07348 // Typedefs the instances of the FloatingPoint template class that we
07349 // care to use.
07350 typedef FloatingPoint<float> Float;
07351 typedef FloatingPoint<double> Double;
07352 
07353 // In order to catch the mistake of putting tests that use different
07354 // test fixture classes in the same test case, we need to assign
07355 // unique IDs to fixture classes and compare them.  The TypeId type is
07356 // used to hold such IDs.  The user should treat TypeId as an opaque
07357 // type: the only operation allowed on TypeId values is to compare
07358 // them for equality using the == operator.
07359 typedef const void* TypeId;
07360 
07361 template <typename T>
07362 class TypeIdHelper {
07363  public:
07364   // dummy_ must not have a const type.  Otherwise an overly eager
07365   // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
07366   // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
07367   static bool dummy_;
07368 };
07369 
07370 template <typename T>
07371 bool TypeIdHelper<T>::dummy_ = false;
07372 
07373 // GetTypeId<T>() returns the ID of type T.  Different values will be
07374 // returned for different types.  Calling the function twice with the
07375 // same type argument is guaranteed to return the same ID.
07376 template <typename T>
07377 TypeId GetTypeId() {
07378   // The compiler is required to allocate a different
07379   // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
07380   // the template.  Therefore, the address of dummy_ is guaranteed to
07381   // be unique.
07382   return &(TypeIdHelper<T>::dummy_);
07383 }
07384 
07385 // Returns the type ID of ::testing::Test.  Always call this instead
07386 // of GetTypeId< ::testing::Test>() to get the type ID of
07387 // ::testing::Test, as the latter may give the wrong result due to a
07388 // suspected linker bug when compiling Google Test as a Mac OS X
07389 // framework.
07390 GTEST_API_ TypeId GetTestTypeId();
07391 
07392 // Defines the abstract factory interface that creates instances
07393 // of a Test object.
07394 class TestFactoryBase {
07395  public:
07396   virtual ~TestFactoryBase() {}
07397 
07398   // Creates a test instance to run. The instance is both created and destroyed
07399   // within TestInfoImpl::Run()
07400   virtual Test* CreateTest() = 0;
07401 
07402  protected:
07403   TestFactoryBase() {}
07404 
07405  private:
07406   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
07407 };
07408 
07409 // This class provides implementation of TeastFactoryBase interface.
07410 // It is used in TEST and TEST_F macros.
07411 template <class TestClass>
07412 class TestFactoryImpl : public TestFactoryBase {
07413  public:
07414   virtual Test* CreateTest() { return new TestClass; }
07415 };
07416 
07417 #if GTEST_OS_WINDOWS
07418 
07419 // Predicate-formatters for implementing the HRESULT checking macros
07420 // {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
07421 // We pass a long instead of HRESULT to avoid causing an
07422 // include dependency for the HRESULT type.
07423 GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
07424                                             long hr);  // NOLINT
07425 GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
07426                                             long hr);  // NOLINT
07427 
07428 #endif  // GTEST_OS_WINDOWS
07429 
07430 // Types of SetUpTestCase() and TearDownTestCase() functions.
07431 typedef void (*SetUpTestCaseFunc)();
07432 typedef void (*TearDownTestCaseFunc)();
07433 
07434 // Creates a new TestInfo object and registers it with Google Test;
07435 // returns the created object.
07436 //
07437 // Arguments:
07438 //
07439 //   test_case_name:   name of the test case
07440 //   name:             name of the test
07441 //   type_param        the name of the test's type parameter, or NULL if
07442 //                     this is not a typed or a type-parameterized test.
07443 //   value_param       text representation of the test's value parameter,
07444 //                     or NULL if this is not a type-parameterized test.
07445 //   fixture_class_id: ID of the test fixture class
07446 //   set_up_tc:        pointer to the function that sets up the test case
07447 //   tear_down_tc:     pointer to the function that tears down the test case
07448 //   factory:          pointer to the factory that creates a test object.
07449 //                     The newly created TestInfo instance will assume
07450 //                     ownership of the factory object.
07451 GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
07452     const char* test_case_name,
07453     const char* name,
07454     const char* type_param,
07455     const char* value_param,
07456     TypeId fixture_class_id,
07457     SetUpTestCaseFunc set_up_tc,
07458     TearDownTestCaseFunc tear_down_tc,
07459     TestFactoryBase* factory);
07460 
07461 // If *pstr starts with the given prefix, modifies *pstr to be right
07462 // past the prefix and returns true; otherwise leaves *pstr unchanged
07463 // and returns false.  None of pstr, *pstr, and prefix can be NULL.
07464 GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
07465 
07466 #if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
07467 
07468 // State of the definition of a type-parameterized test case.
07469 class GTEST_API_ TypedTestCasePState {
07470  public:
07471   TypedTestCasePState() : registered_(false) {}
07472 
07473   // Adds the given test name to defined_test_names_ and return true
07474   // if the test case hasn't been registered; otherwise aborts the
07475   // program.
07476   bool AddTestName(const char* file, int line, const char* case_name,
07477                    const char* test_name) {
07478     if (registered_) {
07479       fprintf(stderr, "%s Test %s must be defined before "
07480               "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
07481               FormatFileLocation(file, line).c_str(), test_name, case_name);
07482       fflush(stderr);
07483       posix::Abort();
07484     }
07485     defined_test_names_.insert(test_name);
07486     return true;
07487   }
07488 
07489   // Verifies that registered_tests match the test names in
07490   // defined_test_names_; returns registered_tests if successful, or
07491   // aborts the program otherwise.
07492   const char* VerifyRegisteredTestNames(
07493       const char* file, int line, const char* registered_tests);
07494 
07495  private:
07496   bool registered_;
07497   ::std::set<const char*> defined_test_names_;
07498 };
07499 
07500 // Skips to the first non-space char after the first comma in 'str';
07501 // returns NULL if no comma is found in 'str'.
07502 inline const char* SkipComma(const char* str) {
07503   const char* comma = strchr(str, ',');
07504   if (comma == NULL) {
07505     return NULL;
07506   }
07507   while (IsSpace(*(++comma))) {}
07508   return comma;
07509 }
07510 
07511 // Returns the prefix of 'str' before the first comma in it; returns
07512 // the entire string if it contains no comma.
07513 inline std::string GetPrefixUntilComma(const char* str) {
07514   const char* comma = strchr(str, ',');
07515   return comma == NULL ? str : std::string(str, comma);
07516 }
07517 
07518 // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
07519 // registers a list of type-parameterized tests with Google Test.  The
07520 // return value is insignificant - we just need to return something
07521 // such that we can call this function in a namespace scope.
07522 //
07523 // Implementation note: The GTEST_TEMPLATE_ macro declares a template
07524 // template parameter.  It's defined in gtest-type-util.h.
07525 template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
07526 class TypeParameterizedTest {
07527  public:
07528   // 'index' is the index of the test in the type list 'Types'
07529   // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
07530   // Types).  Valid values for 'index' are [0, N - 1] where N is the
07531   // length of Types.
07532   static bool Register(const char* prefix, const char* case_name,
07533                        const char* test_names, int index) {
07534     typedef typename Types::Head Type;
07535     typedef Fixture<Type> FixtureClass;
07536     typedef typename GTEST_BIND_(TestSel, Type) TestClass;
07537 
07538     // First, registers the first type-parameterized test in the type
07539     // list.
07540     MakeAndRegisterTestInfo(
07541         (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
07542          + StreamableToString(index)).c_str(),
07543         GetPrefixUntilComma(test_names).c_str(),
07544         GetTypeName<Type>().c_str(),
07545         NULL,  // No value parameter.
07546         GetTypeId<FixtureClass>(),
07547         TestClass::SetUpTestCase,
07548         TestClass::TearDownTestCase,
07549         new TestFactoryImpl<TestClass>);
07550 
07551     // Next, recurses (at compile time) with the tail of the type list.
07552     return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
07553         ::Register(prefix, case_name, test_names, index + 1);
07554   }
07555 };
07556 
07557 // The base case for the compile time recursion.
07558 template <GTEST_TEMPLATE_ Fixture, class TestSel>
07559 class TypeParameterizedTest<Fixture, TestSel, Types0> {
07560  public:
07561   static bool Register(const char* /*prefix*/, const char* /*case_name*/,
07562                        const char* /*test_names*/, int /*index*/) {
07563     return true;
07564   }
07565 };
07566 
07567 // TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
07568 // registers *all combinations* of 'Tests' and 'Types' with Google
07569 // Test.  The return value is insignificant - we just need to return
07570 // something such that we can call this function in a namespace scope.
07571 template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
07572 class TypeParameterizedTestCase {
07573  public:
07574   static bool Register(const char* prefix, const char* case_name,
07575                        const char* test_names) {
07576     typedef typename Tests::Head Head;
07577 
07578     // First, register the first test in 'Test' for each type in 'Types'.
07579     TypeParameterizedTest<Fixture, Head, Types>::Register(
07580         prefix, case_name, test_names, 0);
07581 
07582     // Next, recurses (at compile time) with the tail of the test list.
07583     return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
07584         ::Register(prefix, case_name, SkipComma(test_names));
07585   }
07586 };
07587 
07588 // The base case for the compile time recursion.
07589 template <GTEST_TEMPLATE_ Fixture, typename Types>
07590 class TypeParameterizedTestCase<Fixture, Templates0, Types> {
07591  public:
07592   static bool Register(const char* /*prefix*/, const char* /*case_name*/,
07593                        const char* /*test_names*/) {
07594     return true;
07595   }
07596 };
07597 
07598 #endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
07599 
07600 // Returns the current OS stack trace as an std::string.
07601 //
07602 // The maximum number of stack frames to be included is specified by
07603 // the gtest_stack_trace_depth flag.  The skip_count parameter
07604 // specifies the number of top frames to be skipped, which doesn't
07605 // count against the number of frames to be included.
07606 //
07607 // For example, if Foo() calls Bar(), which in turn calls
07608 // GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
07609 // the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
07610 GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
07611     UnitTest* unit_test, int skip_count);
07612 
07613 // Helpers for suppressing warnings on unreachable code or constant
07614 // condition.
07615 
07616 // Always returns true.
07617 GTEST_API_ bool AlwaysTrue();
07618 
07619 // Always returns false.
07620 inline bool AlwaysFalse() { return !AlwaysTrue(); }
07621 
07622 // Helper for suppressing false warning from Clang on a const char*
07623 // variable declared in a conditional expression always being NULL in
07624 // the else branch.
07625 struct GTEST_API_ ConstCharPtr {
07626   ConstCharPtr(const char* str) : value(str) {}
07627   operator bool() const { return true; }
07628   const char* value;
07629 };
07630 
07631 // A simple Linear Congruential Generator for generating random
07632 // numbers with a uniform distribution.  Unlike rand() and srand(), it
07633 // doesn't use global state (and therefore can't interfere with user
07634 // code).  Unlike rand_r(), it's portable.  An LCG isn't very random,
07635 // but it's good enough for our purposes.
07636 class GTEST_API_ Random {
07637  public:
07638   static const UInt32 kMaxRange = 1u << 31;
07639 
07640   explicit Random(UInt32 seed) : state_(seed) {}
07641 
07642   void Reseed(UInt32 seed) { state_ = seed; }
07643 
07644   // Generates a random number from [0, range).  Crashes if 'range' is
07645   // 0 or greater than kMaxRange.
07646   UInt32 Generate(UInt32 range);
07647 
07648  private:
07649   UInt32 state_;
07650   GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
07651 };
07652 
07653 // Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
07654 // compiler error iff T1 and T2 are different types.
07655 template <typename T1, typename T2>
07656 struct CompileAssertTypesEqual;
07657 
07658 template <typename T>
07659 struct CompileAssertTypesEqual<T, T> {
07660 };
07661 
07662 // Removes the reference from a type if it is a reference type,
07663 // otherwise leaves it unchanged.  This is the same as
07664 // tr1::remove_reference, which is not widely available yet.
07665 template <typename T>
07666 struct RemoveReference { typedef T type; };  // NOLINT
07667 template <typename T>
07668 struct RemoveReference<T&> { typedef T type; };  // NOLINT
07669 
07670 // A handy wrapper around RemoveReference that works when the argument
07671 // T depends on template parameters.
07672 #define GTEST_REMOVE_REFERENCE_(T) \
07673     typename ::testing::internal::RemoveReference<T>::type
07674 
07675 // Removes const from a type if it is a const type, otherwise leaves
07676 // it unchanged.  This is the same as tr1::remove_const, which is not
07677 // widely available yet.
07678 template <typename T>
07679 struct RemoveConst { typedef T type; };  // NOLINT
07680 template <typename T>
07681 struct RemoveConst<const T> { typedef T type; };  // NOLINT
07682 
07683 // MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
07684 // definition to fail to remove the const in 'const int[3]' and 'const
07685 // char[3][4]'.  The following specialization works around the bug.
07686 template <typename T, size_t N>
07687 struct RemoveConst<const T[N]> {
07688   typedef typename RemoveConst<T>::type type[N];
07689 };
07690 
07691 #if defined(_MSC_VER) && _MSC_VER < 1400
07692 // This is the only specialization that allows VC++ 7.1 to remove const in
07693 // 'const int[3] and 'const int[3][4]'.  However, it causes trouble with GCC
07694 // and thus needs to be conditionally compiled.
07695 template <typename T, size_t N>
07696 struct RemoveConst<T[N]> {
07697   typedef typename RemoveConst<T>::type type[N];
07698 };
07699 #endif
07700 
07701 // A handy wrapper around RemoveConst that works when the argument
07702 // T depends on template parameters.
07703 #define GTEST_REMOVE_CONST_(T) \
07704     typename ::testing::internal::RemoveConst<T>::type
07705 
07706 // Turns const U&, U&, const U, and U all into U.
07707 #define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
07708     GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
07709 
07710 // Adds reference to a type if it is not a reference type,
07711 // otherwise leaves it unchanged.  This is the same as
07712 // tr1::add_reference, which is not widely available yet.
07713 template <typename T>
07714 struct AddReference { typedef T& type; };  // NOLINT
07715 template <typename T>
07716 struct AddReference<T&> { typedef T& type; };  // NOLINT
07717 
07718 // A handy wrapper around AddReference that works when the argument T
07719 // depends on template parameters.
07720 #define GTEST_ADD_REFERENCE_(T) \
07721     typename ::testing::internal::AddReference<T>::type
07722 
07723 // Adds a reference to const on top of T as necessary.  For example,
07724 // it transforms
07725 //
07726 //   char         ==> const char&
07727 //   const char   ==> const char&
07728 //   char&        ==> const char&
07729 //   const char&  ==> const char&
07730 //
07731 // The argument T must depend on some template parameters.
07732 #define GTEST_REFERENCE_TO_CONST_(T) \
07733     GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
07734 
07735 // ImplicitlyConvertible<From, To>::value is a compile-time bool
07736 // constant that's true iff type From can be implicitly converted to
07737 // type To.
07738 template <typename From, typename To>
07739 class ImplicitlyConvertible {
07740  private:
07741   // We need the following helper functions only for their types.
07742   // They have no implementations.
07743 
07744   // MakeFrom() is an expression whose type is From.  We cannot simply
07745   // use From(), as the type From may not have a public default
07746   // constructor.
07747   static From MakeFrom();
07748 
07749   // These two functions are overloaded.  Given an expression
07750   // Helper(x), the compiler will pick the first version if x can be
07751   // implicitly converted to type To; otherwise it will pick the
07752   // second version.
07753   //
07754   // The first version returns a value of size 1, and the second
07755   // version returns a value of size 2.  Therefore, by checking the
07756   // size of Helper(x), which can be done at compile time, we can tell
07757   // which version of Helper() is used, and hence whether x can be
07758   // implicitly converted to type To.
07759   static char Helper(To);
07760   static char (&Helper(...))[2];  // NOLINT
07761 
07762   // We have to put the 'public' section after the 'private' section,
07763   // or MSVC refuses to compile the code.
07764  public:
07765   // MSVC warns about implicitly converting from double to int for
07766   // possible loss of data, so we need to temporarily disable the
07767   // warning.
07768 #ifdef _MSC_VER
07769 # pragma warning(push)          // Saves the current warning state.
07770 # pragma warning(disable:4244)  // Temporarily disables warning 4244.
07771 
07772   static const bool value =
07773       sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
07774 # pragma warning(pop)           // Restores the warning state.
07775 #elif defined(__BORLANDC__)
07776   // C++Builder cannot use member overload resolution during template
07777   // instantiation.  The simplest workaround is to use its C++0x type traits
07778   // functions (C++Builder 2009 and above only).
07779   static const bool value = __is_convertible(From, To);
07780 #else
07781   static const bool value =
07782       sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
07783 #endif  // _MSV_VER
07784 };
07785 template <typename From, typename To>
07786 const bool ImplicitlyConvertible<From, To>::value;
07787 
07788 // IsAProtocolMessage<T>::value is a compile-time bool constant that's
07789 // true iff T is type ProtocolMessage, proto2::Message, or a subclass
07790 // of those.
07791 template <typename T>
07792 struct IsAProtocolMessage
07793     : public bool_constant<
07794   ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
07795   ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
07796 };
07797 
07798 // When the compiler sees expression IsContainerTest<C>(0), if C is an
07799 // STL-style container class, the first overload of IsContainerTest
07800 // will be viable (since both C::iterator* and C::const_iterator* are
07801 // valid types and NULL can be implicitly converted to them).  It will
07802 // be picked over the second overload as 'int' is a perfect match for
07803 // the type of argument 0.  If C::iterator or C::const_iterator is not
07804 // a valid type, the first overload is not viable, and the second
07805 // overload will be picked.  Therefore, we can determine whether C is
07806 // a container class by checking the type of IsContainerTest<C>(0).
07807 // The value of the expression is insignificant.
07808 //
07809 // Note that we look for both C::iterator and C::const_iterator.  The
07810 // reason is that C++ injects the name of a class as a member of the
07811 // class itself (e.g. you can refer to class iterator as either
07812 // 'iterator' or 'iterator::iterator').  If we look for C::iterator
07813 // only, for example, we would mistakenly think that a class named
07814 // iterator is an STL container.
07815 //
07816 // Also note that the simpler approach of overloading
07817 // IsContainerTest(typename C::const_iterator*) and
07818 // IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
07819 typedef int IsContainer;
07820 template <class C>
07821 IsContainer IsContainerTest(int /* dummy */,
07822                             typename C::iterator* /* it */ = NULL,
07823                             typename C::const_iterator* /* const_it */ = NULL) {
07824   return 0;
07825 }
07826 
07827 typedef char IsNotContainer;
07828 template <class C>
07829 IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
07830 
07831 // EnableIf<condition>::type is void when 'Cond' is true, and
07832 // undefined when 'Cond' is false.  To use SFINAE to make a function
07833 // overload only apply when a particular expression is true, add
07834 // "typename EnableIf<expression>::type* = 0" as the last parameter.
07835 template<bool> struct EnableIf;
07836 template<> struct EnableIf<true> { typedef void type; };  // NOLINT
07837 
07838 // Utilities for native arrays.
07839 
07840 // ArrayEq() compares two k-dimensional native arrays using the
07841 // elements' operator==, where k can be any integer >= 0.  When k is
07842 // 0, ArrayEq() degenerates into comparing a single pair of values.
07843 
07844 template <typename T, typename U>
07845 bool ArrayEq(const T* lhs, size_t size, const U* rhs);
07846 
07847 // This generic version is used when k is 0.
07848 template <typename T, typename U>
07849 inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
07850 
07851 // This overload is used when k >= 1.
07852 template <typename T, typename U, size_t N>
07853 inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
07854   return internal::ArrayEq(lhs, N, rhs);
07855 }
07856 
07857 // This helper reduces code bloat.  If we instead put its logic inside
07858 // the previous ArrayEq() function, arrays with different sizes would
07859 // lead to different copies of the template code.
07860 template <typename T, typename U>
07861 bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
07862   for (size_t i = 0; i != size; i++) {
07863     if (!internal::ArrayEq(lhs[i], rhs[i]))
07864       return false;
07865   }
07866   return true;
07867 }
07868 
07869 // Finds the first element in the iterator range [begin, end) that
07870 // equals elem.  Element may be a native array type itself.
07871 template <typename Iter, typename Element>
07872 Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
07873   for (Iter it = begin; it != end; ++it) {
07874     if (internal::ArrayEq(*it, elem))
07875       return it;
07876   }
07877   return end;
07878 }
07879 
07880 // CopyArray() copies a k-dimensional native array using the elements'
07881 // operator=, where k can be any integer >= 0.  When k is 0,
07882 // CopyArray() degenerates into copying a single value.
07883 
07884 template <typename T, typename U>
07885 void CopyArray(const T* from, size_t size, U* to);
07886 
07887 // This generic version is used when k is 0.
07888 template <typename T, typename U>
07889 inline void CopyArray(const T& from, U* to) { *to = from; }
07890 
07891 // This overload is used when k >= 1.
07892 template <typename T, typename U, size_t N>
07893 inline void CopyArray(const T(&from)[N], U(*to)[N]) {
07894   internal::CopyArray(from, N, *to);
07895 }
07896 
07897 // This helper reduces code bloat.  If we instead put its logic inside
07898 // the previous CopyArray() function, arrays with different sizes
07899 // would lead to different copies of the template code.
07900 template <typename T, typename U>
07901 void CopyArray(const T* from, size_t size, U* to) {
07902   for (size_t i = 0; i != size; i++) {
07903     internal::CopyArray(from[i], to + i);
07904   }
07905 }
07906 
07907 // The relation between an NativeArray object (see below) and the
07908 // native array it represents.
07909 enum RelationToSource {
07910   kReference,  // The NativeArray references the native array.
07911   kCopy        // The NativeArray makes a copy of the native array and
07912                // owns the copy.
07913 };
07914 
07915 // Adapts a native array to a read-only STL-style container.  Instead
07916 // of the complete STL container concept, this adaptor only implements
07917 // members useful for Google Mock's container matchers.  New members
07918 // should be added as needed.  To simplify the implementation, we only
07919 // support Element being a raw type (i.e. having no top-level const or
07920 // reference modifier).  It's the client's responsibility to satisfy
07921 // this requirement.  Element can be an array type itself (hence
07922 // multi-dimensional arrays are supported).
07923 template <typename Element>
07924 class NativeArray {
07925  public:
07926   // STL-style container typedefs.
07927   typedef Element value_type;
07928   typedef Element* iterator;
07929   typedef const Element* const_iterator;
07930 
07931   // Constructs from a native array.
07932   NativeArray(const Element* array, size_t count, RelationToSource relation) {
07933     Init(array, count, relation);
07934   }
07935 
07936   // Copy constructor.
07937   NativeArray(const NativeArray& rhs) {
07938     Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
07939   }
07940 
07941   ~NativeArray() {
07942     // Ensures that the user doesn't instantiate NativeArray with a
07943     // const or reference type.
07944     static_cast<void>(StaticAssertTypeEqHelper<Element,
07945         GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
07946     if (relation_to_source_ == kCopy)
07947       delete[] array_;
07948   }
07949 
07950   // STL-style container methods.
07951   size_t size() const { return size_; }
07952   const_iterator begin() const { return array_; }
07953   const_iterator end() const { return array_ + size_; }
07954   bool operator==(const NativeArray& rhs) const {
07955     return size() == rhs.size() &&
07956         ArrayEq(begin(), size(), rhs.begin());
07957   }
07958 
07959  private:
07960   // Initializes this object; makes a copy of the input array if
07961   // 'relation' is kCopy.
07962   void Init(const Element* array, size_t a_size, RelationToSource relation) {
07963     if (relation == kReference) {
07964       array_ = array;
07965     } else {
07966       Element* const copy = new Element[a_size];
07967       CopyArray(array, a_size, copy);
07968       array_ = copy;
07969     }
07970     size_ = a_size;
07971     relation_to_source_ = relation;
07972   }
07973 
07974   const Element* array_;
07975   size_t size_;
07976   RelationToSource relation_to_source_;
07977 
07978   GTEST_DISALLOW_ASSIGN_(NativeArray);
07979 };
07980 
07981 }  // namespace internal
07982 }  // namespace testing
07983 
07984 #define GTEST_MESSAGE_AT_(file, line, message, result_type) \
07985   ::testing::internal::AssertHelper(result_type, file, line, message) \
07986     = ::testing::Message()
07987 
07988 #define GTEST_MESSAGE_(message, result_type) \
07989   GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
07990 
07991 #define GTEST_FATAL_FAILURE_(message) \
07992   return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
07993 
07994 #define GTEST_NONFATAL_FAILURE_(message) \
07995   GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
07996 
07997 #define GTEST_SUCCESS_(message) \
07998   GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
07999 
08000 // Suppresses MSVC warnings 4072 (unreachable code) for the code following
08001 // statement if it returns or throws (or doesn't return or throw in some
08002 // situations).
08003 #define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
08004   if (::testing::internal::AlwaysTrue()) { statement; }
08005 
08006 #define GTEST_TEST_THROW_(statement, expected_exception, fail) \
08007   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08008   if (::testing::internal::ConstCharPtr gtest_msg = "") { \
08009     bool gtest_caught_expected = false; \
08010     try { \
08011       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08012     } \
08013     catch (expected_exception const&) { \
08014       gtest_caught_expected = true; \
08015     } \
08016     catch (...) { \
08017       gtest_msg.value = \
08018           "Expected: " #statement " throws an exception of type " \
08019           #expected_exception ".\n  Actual: it throws a different type."; \
08020       goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
08021     } \
08022     if (!gtest_caught_expected) { \
08023       gtest_msg.value = \
08024           "Expected: " #statement " throws an exception of type " \
08025           #expected_exception ".\n  Actual: it throws nothing."; \
08026       goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
08027     } \
08028   } else \
08029     GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
08030       fail(gtest_msg.value)
08031 
08032 #define GTEST_TEST_NO_THROW_(statement, fail) \
08033   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08034   if (::testing::internal::AlwaysTrue()) { \
08035     try { \
08036       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08037     } \
08038     catch (...) { \
08039       goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
08040     } \
08041   } else \
08042     GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
08043       fail("Expected: " #statement " doesn't throw an exception.\n" \
08044            "  Actual: it throws.")
08045 
08046 #define GTEST_TEST_ANY_THROW_(statement, fail) \
08047   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08048   if (::testing::internal::AlwaysTrue()) { \
08049     bool gtest_caught_any = false; \
08050     try { \
08051       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08052     } \
08053     catch (...) { \
08054       gtest_caught_any = true; \
08055     } \
08056     if (!gtest_caught_any) { \
08057       goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
08058     } \
08059   } else \
08060     GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
08061       fail("Expected: " #statement " throws an exception.\n" \
08062            "  Actual: it doesn't.")
08063 
08064 
08065 // Implements Boolean test assertions such as EXPECT_TRUE. expression can be
08066 // either a boolean expression or an AssertionResult. text is a textual
08067 // represenation of expression as it was passed into the EXPECT_TRUE.
08068 #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
08069   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08070   if (const ::testing::AssertionResult gtest_ar_ = \
08071       ::testing::AssertionResult(expression)) \
08072     ; \
08073   else \
08074     fail(::testing::internal::GetBoolAssertionFailureMessage(\
08075         gtest_ar_, text, #actual, #expected).c_str())
08076 
08077 #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
08078   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08079   if (::testing::internal::AlwaysTrue()) { \
08080     ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
08081     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08082     if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
08083       goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
08084     } \
08085   } else \
08086     GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
08087       fail("Expected: " #statement " doesn't generate new fatal " \
08088            "failures in the current thread.\n" \
08089            "  Actual: it does.")
08090 
08091 // Expands to the name of the class that implements the given test.
08092 #define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
08093   test_case_name##_##test_name##_Test
08094 
08095 // Helper macro for defining tests.
08096 #define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
08097 class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
08098  public:\
08099   GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
08100  private:\
08101   virtual void TestBody();\
08102   static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
08103   GTEST_DISALLOW_COPY_AND_ASSIGN_(\
08104       GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
08105 };\
08106 \
08107 ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
08108   ::test_info_ =\
08109     ::testing::internal::MakeAndRegisterTestInfo(\
08110         #test_case_name, #test_name, NULL, NULL, \
08111         (parent_id), \
08112         parent_class::SetUpTestCase, \
08113         parent_class::TearDownTestCase, \
08114         new ::testing::internal::TestFactoryImpl<\
08115             GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
08116 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
08117 
08118 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
08119 // Copyright 2005, Google Inc.
08120 // All rights reserved.
08121 //
08122 // Redistribution and use in source and binary forms, with or without
08123 // modification, are permitted provided that the following conditions are
08124 // met:
08125 //
08126 //     * Redistributions of source code must retain the above copyright
08127 // notice, this list of conditions and the following disclaimer.
08128 //     * Redistributions in binary form must reproduce the above
08129 // copyright notice, this list of conditions and the following disclaimer
08130 // in the documentation and/or other materials provided with the
08131 // distribution.
08132 //     * Neither the name of Google Inc. nor the names of its
08133 // contributors may be used to endorse or promote products derived from
08134 // this software without specific prior written permission.
08135 //
08136 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
08137 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
08138 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
08139 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
08140 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
08141 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
08142 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
08143 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
08144 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
08145 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
08146 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
08147 //
08148 // Author: wan@google.com (Zhanyong Wan)
08149 //
08150 // The Google C++ Testing Framework (Google Test)
08151 //
08152 // This header file defines the public API for death tests.  It is
08153 // #included by gtest.h so a user doesn't need to include this
08154 // directly.
08155 
08156 #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
08157 #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
08158 
08159 // Copyright 2005, Google Inc.
08160 // All rights reserved.
08161 //
08162 // Redistribution and use in source and binary forms, with or without
08163 // modification, are permitted provided that the following conditions are
08164 // met:
08165 //
08166 //     * Redistributions of source code must retain the above copyright
08167 // notice, this list of conditions and the following disclaimer.
08168 //     * Redistributions in binary form must reproduce the above
08169 // copyright notice, this list of conditions and the following disclaimer
08170 // in the documentation and/or other materials provided with the
08171 // distribution.
08172 //     * Neither the name of Google Inc. nor the names of its
08173 // contributors may be used to endorse or promote products derived from
08174 // this software without specific prior written permission.
08175 //
08176 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
08177 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
08178 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
08179 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
08180 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
08181 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
08182 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
08183 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
08184 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
08185 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
08186 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
08187 //
08188 // Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
08189 //
08190 // The Google C++ Testing Framework (Google Test)
08191 //
08192 // This header file defines internal utilities needed for implementing
08193 // death tests.  They are subject to change without notice.
08194 
08195 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
08196 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
08197 
08198 
08199 #include <stdio.h>
08200 
08201 namespace testing {
08202 namespace internal {
08203 
08204 GTEST_DECLARE_string_(internal_run_death_test);
08205 
08206 // Names of the flags (needed for parsing Google Test flags).
08207 const char kDeathTestStyleFlag[] = "death_test_style";
08208 const char kDeathTestUseFork[] = "death_test_use_fork";
08209 const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
08210 
08211 #if GTEST_HAS_DEATH_TEST
08212 
08213 // DeathTest is a class that hides much of the complexity of the
08214 // GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method
08215 // returns a concrete class that depends on the prevailing death test
08216 // style, as defined by the --gtest_death_test_style and/or
08217 // --gtest_internal_run_death_test flags.
08218 
08219 // In describing the results of death tests, these terms are used with
08220 // the corresponding definitions:
08221 //
08222 // exit status:  The integer exit information in the format specified
08223 //               by wait(2)
08224 // exit code:    The integer code passed to exit(3), _exit(2), or
08225 //               returned from main()
08226 class GTEST_API_ DeathTest {
08227  public:
08228   // Create returns false if there was an error determining the
08229   // appropriate action to take for the current death test; for example,
08230   // if the gtest_death_test_style flag is set to an invalid value.
08231   // The LastMessage method will return a more detailed message in that
08232   // case.  Otherwise, the DeathTest pointer pointed to by the "test"
08233   // argument is set.  If the death test should be skipped, the pointer
08234   // is set to NULL; otherwise, it is set to the address of a new concrete
08235   // DeathTest object that controls the execution of the current test.
08236   static bool Create(const char* statement, const RE* regex,
08237                      const char* file, int line, DeathTest** test);
08238   DeathTest();
08239   virtual ~DeathTest() { }
08240 
08241   // A helper class that aborts a death test when it's deleted.
08242   class ReturnSentinel {
08243    public:
08244     explicit ReturnSentinel(DeathTest* test) : test_(test) { }
08245     ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
08246    private:
08247     DeathTest* const test_;
08248     GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
08249   } GTEST_ATTRIBUTE_UNUSED_;
08250 
08251   // An enumeration of possible roles that may be taken when a death
08252   // test is encountered.  EXECUTE means that the death test logic should
08253   // be executed immediately.  OVERSEE means that the program should prepare
08254   // the appropriate environment for a child process to execute the death
08255   // test, then wait for it to complete.
08256   enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
08257 
08258   // An enumeration of the three reasons that a test might be aborted.
08259   enum AbortReason {
08260     TEST_ENCOUNTERED_RETURN_STATEMENT,
08261     TEST_THREW_EXCEPTION,
08262     TEST_DID_NOT_DIE
08263   };
08264 
08265   // Assumes one of the above roles.
08266   virtual TestRole AssumeRole() = 0;
08267 
08268   // Waits for the death test to finish and returns its status.
08269   virtual int Wait() = 0;
08270 
08271   // Returns true if the death test passed; that is, the test process
08272   // exited during the test, its exit status matches a user-supplied
08273   // predicate, and its stderr output matches a user-supplied regular
08274   // expression.
08275   // The user-supplied predicate may be a macro expression rather
08276   // than a function pointer or functor, or else Wait and Passed could
08277   // be combined.
08278   virtual bool Passed(bool exit_status_ok) = 0;
08279 
08280   // Signals that the death test did not die as expected.
08281   virtual void Abort(AbortReason reason) = 0;
08282 
08283   // Returns a human-readable outcome message regarding the outcome of
08284   // the last death test.
08285   static const char* LastMessage();
08286 
08287   static void set_last_death_test_message(const std::string& message);
08288 
08289  private:
08290   // A string containing a description of the outcome of the last death test.
08291   static std::string last_death_test_message_;
08292 
08293   GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
08294 };
08295 
08296 // Factory interface for death tests.  May be mocked out for testing.
08297 class DeathTestFactory {
08298  public:
08299   virtual ~DeathTestFactory() { }
08300   virtual bool Create(const char* statement, const RE* regex,
08301                       const char* file, int line, DeathTest** test) = 0;
08302 };
08303 
08304 // A concrete DeathTestFactory implementation for normal use.
08305 class DefaultDeathTestFactory : public DeathTestFactory {
08306  public:
08307   virtual bool Create(const char* statement, const RE* regex,
08308                       const char* file, int line, DeathTest** test);
08309 };
08310 
08311 // Returns true if exit_status describes a process that was terminated
08312 // by a signal, or exited normally with a nonzero exit code.
08313 GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
08314 
08315 // Traps C++ exceptions escaping statement and reports them as test
08316 // failures. Note that trapping SEH exceptions is not implemented here.
08317 # if GTEST_HAS_EXCEPTIONS
08318 #  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
08319   try { \
08320     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08321   } catch (const ::std::exception& gtest_exception) { \
08322     fprintf(\
08323         stderr, \
08324         "\n%s: Caught std::exception-derived exception escaping the " \
08325         "death test statement. Exception message: %s\n", \
08326         ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
08327         gtest_exception.what()); \
08328     fflush(stderr); \
08329     death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
08330   } catch (...) { \
08331     death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
08332   }
08333 
08334 # else
08335 #  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
08336   GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
08337 
08338 # endif
08339 
08340 // This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
08341 // ASSERT_EXIT*, and EXPECT_EXIT*.
08342 # define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
08343   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08344   if (::testing::internal::AlwaysTrue()) { \
08345     const ::testing::internal::RE& gtest_regex = (regex); \
08346     ::testing::internal::DeathTest* gtest_dt; \
08347     if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
08348         __FILE__, __LINE__, &gtest_dt)) { \
08349       goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
08350     } \
08351     if (gtest_dt != NULL) { \
08352       ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
08353           gtest_dt_ptr(gtest_dt); \
08354       switch (gtest_dt->AssumeRole()) { \
08355         case ::testing::internal::DeathTest::OVERSEE_TEST: \
08356           if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
08357             goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
08358           } \
08359           break; \
08360         case ::testing::internal::DeathTest::EXECUTE_TEST: { \
08361           ::testing::internal::DeathTest::ReturnSentinel \
08362               gtest_sentinel(gtest_dt); \
08363           GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
08364           gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
08365           break; \
08366         } \
08367         default: \
08368           break; \
08369       } \
08370     } \
08371   } else \
08372     GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
08373       fail(::testing::internal::DeathTest::LastMessage())
08374 // The symbol "fail" here expands to something into which a message
08375 // can be streamed.
08376 
08377 // This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
08378 // NDEBUG mode. In this case we need the statements to be executed, the regex is
08379 // ignored, and the macro must accept a streamed message even though the message
08380 // is never printed.
08381 # define GTEST_EXECUTE_STATEMENT_(statement, regex) \
08382   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08383   if (::testing::internal::AlwaysTrue()) { \
08384      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08385   } else \
08386     ::testing::Message()
08387 
08388 // A class representing the parsed contents of the
08389 // --gtest_internal_run_death_test flag, as it existed when
08390 // RUN_ALL_TESTS was called.
08391 class InternalRunDeathTestFlag {
08392  public:
08393   InternalRunDeathTestFlag(const std::string& a_file,
08394                            int a_line,
08395                            int an_index,
08396                            int a_write_fd)
08397       : file_(a_file), line_(a_line), index_(an_index),
08398         write_fd_(a_write_fd) {}
08399 
08400   ~InternalRunDeathTestFlag() {
08401     if (write_fd_ >= 0)
08402       posix::Close(write_fd_);
08403   }
08404 
08405   const std::string& file() const { return file_; }
08406   int line() const { return line_; }
08407   int index() const { return index_; }
08408   int write_fd() const { return write_fd_; }
08409 
08410  private:
08411   std::string file_;
08412   int line_;
08413   int index_;
08414   int write_fd_;
08415 
08416   GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
08417 };
08418 
08419 // Returns a newly created InternalRunDeathTestFlag object with fields
08420 // initialized from the GTEST_FLAG(internal_run_death_test) flag if
08421 // the flag is specified; otherwise returns NULL.
08422 InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
08423 
08424 #else  // GTEST_HAS_DEATH_TEST
08425 
08426 // This macro is used for implementing macros such as
08427 // EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
08428 // death tests are not supported. Those macros must compile on such systems
08429 // iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
08430 // systems that support death tests. This allows one to write such a macro
08431 // on a system that does not support death tests and be sure that it will
08432 // compile on a death-test supporting system.
08433 //
08434 // Parameters:
08435 //   statement -  A statement that a macro such as EXPECT_DEATH would test
08436 //                for program termination. This macro has to make sure this
08437 //                statement is compiled but not executed, to ensure that
08438 //                EXPECT_DEATH_IF_SUPPORTED compiles with a certain
08439 //                parameter iff EXPECT_DEATH compiles with it.
08440 //   regex     -  A regex that a macro such as EXPECT_DEATH would use to test
08441 //                the output of statement.  This parameter has to be
08442 //                compiled but not evaluated by this macro, to ensure that
08443 //                this macro only accepts expressions that a macro such as
08444 //                EXPECT_DEATH would accept.
08445 //   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
08446 //                and a return statement for ASSERT_DEATH_IF_SUPPORTED.
08447 //                This ensures that ASSERT_DEATH_IF_SUPPORTED will not
08448 //                compile inside functions where ASSERT_DEATH doesn't
08449 //                compile.
08450 //
08451 //  The branch that has an always false condition is used to ensure that
08452 //  statement and regex are compiled (and thus syntactically correct) but
08453 //  never executed. The unreachable code macro protects the terminator
08454 //  statement from generating an 'unreachable code' warning in case
08455 //  statement unconditionally returns or throws. The Message constructor at
08456 //  the end allows the syntax of streaming additional messages into the
08457 //  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
08458 # define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
08459     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
08460     if (::testing::internal::AlwaysTrue()) { \
08461       GTEST_LOG_(WARNING) \
08462           << "Death tests are not supported on this platform.\n" \
08463           << "Statement '" #statement "' cannot be verified."; \
08464     } else if (::testing::internal::AlwaysFalse()) { \
08465       ::testing::internal::RE::PartialMatch(".*", (regex)); \
08466       GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
08467       terminator; \
08468     } else \
08469       ::testing::Message()
08470 
08471 #endif  // GTEST_HAS_DEATH_TEST
08472 
08473 }  // namespace internal
08474 }  // namespace testing
08475 
08476 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
08477 
08478 namespace testing {
08479 
08480 // This flag controls the style of death tests.  Valid values are "threadsafe",
08481 // meaning that the death test child process will re-execute the test binary
08482 // from the start, running only a single death test, or "fast",
08483 // meaning that the child process will execute the test logic immediately
08484 // after forking.
08485 GTEST_DECLARE_string_(death_test_style);
08486 
08487 #if GTEST_HAS_DEATH_TEST
08488 
08489 namespace internal {
08490 
08491 // Returns a Boolean value indicating whether the caller is currently
08492 // executing in the context of the death test child process.  Tools such as
08493 // Valgrind heap checkers may need this to modify their behavior in death
08494 // tests.  IMPORTANT: This is an internal utility.  Using it may break the
08495 // implementation of death tests.  User code MUST NOT use it.
08496 GTEST_API_ bool InDeathTestChild();
08497 
08498 }  // namespace internal
08499 
08500 // The following macros are useful for writing death tests.
08501 
08502 // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
08503 // executed:
08504 //
08505 //   1. It generates a warning if there is more than one active
08506 //   thread.  This is because it's safe to fork() or clone() only
08507 //   when there is a single thread.
08508 //
08509 //   2. The parent process clone()s a sub-process and runs the death
08510 //   test in it; the sub-process exits with code 0 at the end of the
08511 //   death test, if it hasn't exited already.
08512 //
08513 //   3. The parent process waits for the sub-process to terminate.
08514 //
08515 //   4. The parent process checks the exit code and error message of
08516 //   the sub-process.
08517 //
08518 // Examples:
08519 //
08520 //   ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
08521 //   for (int i = 0; i < 5; i++) {
08522 //     EXPECT_DEATH(server.ProcessRequest(i),
08523 //                  "Invalid request .* in ProcessRequest()")
08524 //                  << "Failed to die on request " << i;
08525 //   }
08526 //
08527 //   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
08528 //
08529 //   bool KilledBySIGHUP(int exit_code) {
08530 //     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
08531 //   }
08532 //
08533 //   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
08534 //
08535 // On the regular expressions used in death tests:
08536 //
08537 //   On POSIX-compliant systems (*nix), we use the <regex.h> library,
08538 //   which uses the POSIX extended regex syntax.
08539 //
08540 //   On other platforms (e.g. Windows), we only support a simple regex
08541 //   syntax implemented as part of Google Test.  This limited
08542 //   implementation should be enough most of the time when writing
08543 //   death tests; though it lacks many features you can find in PCRE
08544 //   or POSIX extended regex syntax.  For example, we don't support
08545 //   union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
08546 //   repetition count ("x{5,7}"), among others.
08547 //
08548 //   Below is the syntax that we do support.  We chose it to be a
08549 //   subset of both PCRE and POSIX extended regex, so it's easy to
08550 //   learn wherever you come from.  In the following: 'A' denotes a
08551 //   literal character, period (.), or a single \\ escape sequence;
08552 //   'x' and 'y' denote regular expressions; 'm' and 'n' are for
08553 //   natural numbers.
08554 //
08555 //     c     matches any literal character c
08556 //     \\d   matches any decimal digit
08557 //     \\D   matches any character that's not a decimal digit
08558 //     \\f   matches \f
08559 //     \\n   matches \n
08560 //     \\r   matches \r
08561 //     \\s   matches any ASCII whitespace, including \n
08562 //     \\S   matches any character that's not a whitespace
08563 //     \\t   matches \t
08564 //     \\v   matches \v
08565 //     \\w   matches any letter, _, or decimal digit
08566 //     \\W   matches any character that \\w doesn't match
08567 //     \\c   matches any literal character c, which must be a punctuation
08568 //     .     matches any single character except \n
08569 //     A?    matches 0 or 1 occurrences of A
08570 //     A*    matches 0 or many occurrences of A
08571 //     A+    matches 1 or many occurrences of A
08572 //     ^     matches the beginning of a string (not that of each line)
08573 //     $     matches the end of a string (not that of each line)
08574 //     xy    matches x followed by y
08575 //
08576 //   If you accidentally use PCRE or POSIX extended regex features
08577 //   not implemented by us, you will get a run-time failure.  In that
08578 //   case, please try to rewrite your regular expression within the
08579 //   above syntax.
08580 //
08581 //   This implementation is *not* meant to be as highly tuned or robust
08582 //   as a compiled regex library, but should perform well enough for a
08583 //   death test, which already incurs significant overhead by launching
08584 //   a child process.
08585 //
08586 // Known caveats:
08587 //
08588 //   A "threadsafe" style death test obtains the path to the test
08589 //   program from argv[0] and re-executes it in the sub-process.  For
08590 //   simplicity, the current implementation doesn't search the PATH
08591 //   when launching the sub-process.  This means that the user must
08592 //   invoke the test program via a path that contains at least one
08593 //   path separator (e.g. path/to/foo_test and
08594 //   /absolute/path/to/bar_test are fine, but foo_test is not).  This
08595 //   is rarely a problem as people usually don't put the test binary
08596 //   directory in PATH.
08597 //
08598 // TODO(wan@google.com): make thread-safe death tests search the PATH.
08599 
08600 // Asserts that a given statement causes the program to exit, with an
08601 // integer exit status that satisfies predicate, and emitting error output
08602 // that matches regex.
08603 # define ASSERT_EXIT(statement, predicate, regex) \
08604     GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
08605 
08606 // Like ASSERT_EXIT, but continues on to successive tests in the
08607 // test case, if any:
08608 # define EXPECT_EXIT(statement, predicate, regex) \
08609     GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
08610 
08611 // Asserts that a given statement causes the program to exit, either by
08612 // explicitly exiting with a nonzero exit code or being killed by a
08613 // signal, and emitting error output that matches regex.
08614 # define ASSERT_DEATH(statement, regex) \
08615     ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
08616 
08617 // Like ASSERT_DEATH, but continues on to successive tests in the
08618 // test case, if any:
08619 # define EXPECT_DEATH(statement, regex) \
08620     EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
08621 
08622 // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
08623 
08624 // Tests that an exit code describes a normal exit with a given exit code.
08625 class GTEST_API_ ExitedWithCode {
08626  public:
08627   explicit ExitedWithCode(int exit_code);
08628   bool operator()(int exit_status) const;
08629  private:
08630   // No implementation - assignment is unsupported.
08631   void operator=(const ExitedWithCode& other);
08632 
08633   const int exit_code_;
08634 };
08635 
08636 # if !GTEST_OS_WINDOWS
08637 // Tests that an exit code describes an exit due to termination by a
08638 // given signal.
08639 class GTEST_API_ KilledBySignal {
08640  public:
08641   explicit KilledBySignal(int signum);
08642   bool operator()(int exit_status) const;
08643  private:
08644   const int signum_;
08645 };
08646 # endif  // !GTEST_OS_WINDOWS
08647 
08648 // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
08649 // The death testing framework causes this to have interesting semantics,
08650 // since the sideeffects of the call are only visible in opt mode, and not
08651 // in debug mode.
08652 //
08653 // In practice, this can be used to test functions that utilize the
08654 // LOG(DFATAL) macro using the following style:
08655 //
08656 // int DieInDebugOr12(int* sideeffect) {
08657 //   if (sideeffect) {
08658 //     *sideeffect = 12;
08659 //   }
08660 //   LOG(DFATAL) << "death";
08661 //   return 12;
08662 // }
08663 //
08664 // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
08665 //   int sideeffect = 0;
08666 //   // Only asserts in dbg.
08667 //   EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
08668 //
08669 // #ifdef NDEBUG
08670 //   // opt-mode has sideeffect visible.
08671 //   EXPECT_EQ(12, sideeffect);
08672 // #else
08673 //   // dbg-mode no visible sideeffect.
08674 //   EXPECT_EQ(0, sideeffect);
08675 // #endif
08676 // }
08677 //
08678 // This will assert that DieInDebugReturn12InOpt() crashes in debug
08679 // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
08680 // appropriate fallback value (12 in this case) in opt mode. If you
08681 // need to test that a function has appropriate side-effects in opt
08682 // mode, include assertions against the side-effects.  A general
08683 // pattern for this is:
08684 //
08685 // EXPECT_DEBUG_DEATH({
08686 //   // Side-effects here will have an effect after this statement in
08687 //   // opt mode, but none in debug mode.
08688 //   EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
08689 // }, "death");
08690 //
08691 # ifdef NDEBUG
08692 
08693 #  define EXPECT_DEBUG_DEATH(statement, regex) \
08694   GTEST_EXECUTE_STATEMENT_(statement, regex)
08695 
08696 #  define ASSERT_DEBUG_DEATH(statement, regex) \
08697   GTEST_EXECUTE_STATEMENT_(statement, regex)
08698 
08699 # else
08700 
08701 #  define EXPECT_DEBUG_DEATH(statement, regex) \
08702   EXPECT_DEATH(statement, regex)
08703 
08704 #  define ASSERT_DEBUG_DEATH(statement, regex) \
08705   ASSERT_DEATH(statement, regex)
08706 
08707 # endif  // NDEBUG for EXPECT_DEBUG_DEATH
08708 #endif  // GTEST_HAS_DEATH_TEST
08709 
08710 // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
08711 // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
08712 // death tests are supported; otherwise they just issue a warning.  This is
08713 // useful when you are combining death test assertions with normal test
08714 // assertions in one test.
08715 #if GTEST_HAS_DEATH_TEST
08716 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
08717     EXPECT_DEATH(statement, regex)
08718 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
08719     ASSERT_DEATH(statement, regex)
08720 #else
08721 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
08722     GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
08723 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
08724     GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
08725 #endif
08726 
08727 }  // namespace testing
08728 
08729 #endif  // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
08730 // This file was GENERATED by command:
08731 //     pump.py gtest-param-test.h.pump
08732 // DO NOT EDIT BY HAND!!!
08733 
08734 // Copyright 2008, Google Inc.
08735 // All rights reserved.
08736 //
08737 // Redistribution and use in source and binary forms, with or without
08738 // modification, are permitted provided that the following conditions are
08739 // met:
08740 //
08741 //     * Redistributions of source code must retain the above copyright
08742 // notice, this list of conditions and the following disclaimer.
08743 //     * Redistributions in binary form must reproduce the above
08744 // copyright notice, this list of conditions and the following disclaimer
08745 // in the documentation and/or other materials provided with the
08746 // distribution.
08747 //     * Neither the name of Google Inc. nor the names of its
08748 // contributors may be used to endorse or promote products derived from
08749 // this software without specific prior written permission.
08750 //
08751 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
08752 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
08753 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
08754 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
08755 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
08756 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
08757 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
08758 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
08759 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
08760 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
08761 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
08762 //
08763 // Authors: vladl@google.com (Vlad Losev)
08764 //
08765 // Macros and functions for implementing parameterized tests
08766 // in Google C++ Testing Framework (Google Test)
08767 //
08768 // This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
08769 //
08770 #ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
08771 #define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
08772 
08773 
08774 // Value-parameterized tests allow you to test your code with different
08775 // parameters without writing multiple copies of the same test.
08776 //
08777 // Here is how you use value-parameterized tests:
08778 
08779 #if 0
08780 
08781 // To write value-parameterized tests, first you should define a fixture
08782 // class. It is usually derived from testing::TestWithParam<T> (see below for
08783 // another inheritance scheme that's sometimes useful in more complicated
08784 // class hierarchies), where the type of your parameter values.
08785 // TestWithParam<T> is itself derived from testing::Test. T can be any
08786 // copyable type. If it's a raw pointer, you are responsible for managing the
08787 // lifespan of the pointed values.
08788 
08789 class FooTest : public ::testing::TestWithParam<const char*> {
08790   // You can implement all the usual class fixture members here.
08791 };
08792 
08793 // Then, use the TEST_P macro to define as many parameterized tests
08794 // for this fixture as you want. The _P suffix is for "parameterized"
08795 // or "pattern", whichever you prefer to think.
08796 
08797 TEST_P(FooTest, DoesBlah) {
08798   // Inside a test, access the test parameter with the GetParam() method
08799   // of the TestWithParam<T> class:
08800   EXPECT_TRUE(foo.Blah(GetParam()));
08801   ...
08802 }
08803 
08804 TEST_P(FooTest, HasBlahBlah) {
08805   ...
08806 }
08807 
08808 // Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
08809 // case with any set of parameters you want. Google Test defines a number
08810 // of functions for generating test parameters. They return what we call
08811 // (surprise!) parameter generators. Here is a  summary of them, which
08812 // are all in the testing namespace:
08813 //
08814 //
08815 //  Range(begin, end [, step]) - Yields values {begin, begin+step,
08816 //                               begin+step+step, ...}. The values do not
08817 //                               include end. step defaults to 1.
08818 //  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.
08819 //  ValuesIn(container)        - Yields values from a C-style array, an STL
08820 //  ValuesIn(begin,end)          container, or an iterator range [begin, end).
08821 //  Bool()                     - Yields sequence {false, true}.
08822 //  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product
08823 //                               for the math savvy) of the values generated
08824 //                               by the N generators.
08825 //
08826 // For more details, see comments at the definitions of these functions below
08827 // in this file.
08828 //
08829 // The following statement will instantiate tests from the FooTest test case
08830 // each with parameter values "meeny", "miny", and "moe".
08831 
08832 INSTANTIATE_TEST_CASE_P(InstantiationName,
08833                         FooTest,
08834                         Values("meeny", "miny", "moe"));
08835 
08836 // To distinguish different instances of the pattern, (yes, you
08837 // can instantiate it more then once) the first argument to the
08838 // INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
08839 // actual test case name. Remember to pick unique prefixes for different
08840 // instantiations. The tests from the instantiation above will have
08841 // these names:
08842 //
08843 //    * InstantiationName/FooTest.DoesBlah/0 for "meeny"
08844 //    * InstantiationName/FooTest.DoesBlah/1 for "miny"
08845 //    * InstantiationName/FooTest.DoesBlah/2 for "moe"
08846 //    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
08847 //    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
08848 //    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
08849 //
08850 // You can use these names in --gtest_filter.
08851 //
08852 // This statement will instantiate all tests from FooTest again, each
08853 // with parameter values "cat" and "dog":
08854 
08855 const char* pets[] = {"cat", "dog"};
08856 INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
08857 
08858 // The tests from the instantiation above will have these names:
08859 //
08860 //    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
08861 //    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
08862 //    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
08863 //    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
08864 //
08865 // Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
08866 // in the given test case, whether their definitions come before or
08867 // AFTER the INSTANTIATE_TEST_CASE_P statement.
08868 //
08869 // Please also note that generator expressions (including parameters to the
08870 // generators) are evaluated in InitGoogleTest(), after main() has started.
08871 // This allows the user on one hand, to adjust generator parameters in order
08872 // to dynamically determine a set of tests to run and on the other hand,
08873 // give the user a chance to inspect the generated tests with Google Test
08874 // reflection API before RUN_ALL_TESTS() is executed.
08875 //
08876 // You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
08877 // for more examples.
08878 //
08879 // In the future, we plan to publish the API for defining new parameter
08880 // generators. But for now this interface remains part of the internal
08881 // implementation and is subject to change.
08882 //
08883 //
08884 // A parameterized test fixture must be derived from testing::Test and from
08885 // testing::WithParamInterface<T>, where T is the type of the parameter
08886 // values. Inheriting from TestWithParam<T> satisfies that requirement because
08887 // TestWithParam<T> inherits from both Test and WithParamInterface. In more
08888 // complicated hierarchies, however, it is occasionally useful to inherit
08889 // separately from Test and WithParamInterface. For example:
08890 
08891 class BaseTest : public ::testing::Test {
08892   // You can inherit all the usual members for a non-parameterized test
08893   // fixture here.
08894 };
08895 
08896 class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
08897   // The usual test fixture members go here too.
08898 };
08899 
08900 TEST_F(BaseTest, HasFoo) {
08901   // This is an ordinary non-parameterized test.
08902 }
08903 
08904 TEST_P(DerivedTest, DoesBlah) {
08905   // GetParam works just the same here as if you inherit from TestWithParam.
08906   EXPECT_TRUE(foo.Blah(GetParam()));
08907 }
08908 
08909 #endif  // 0
08910 
08911 
08912 #if !GTEST_OS_SYMBIAN
08913 # include <utility>
08914 #endif
08915 
08916 // scripts/fuse_gtest.py depends on gtest's own header being #included
08917 // *unconditionally*.  Therefore these #includes cannot be moved
08918 // inside #if GTEST_HAS_PARAM_TEST.
08919 // Copyright 2008 Google Inc.
08920 // All Rights Reserved.
08921 //
08922 // Redistribution and use in source and binary forms, with or without
08923 // modification, are permitted provided that the following conditions are
08924 // met:
08925 //
08926 //     * Redistributions of source code must retain the above copyright
08927 // notice, this list of conditions and the following disclaimer.
08928 //     * Redistributions in binary form must reproduce the above
08929 // copyright notice, this list of conditions and the following disclaimer
08930 // in the documentation and/or other materials provided with the
08931 // distribution.
08932 //     * Neither the name of Google Inc. nor the names of its
08933 // contributors may be used to endorse or promote products derived from
08934 // this software without specific prior written permission.
08935 //
08936 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
08937 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
08938 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
08939 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
08940 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
08941 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
08942 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
08943 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
08944 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
08945 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
08946 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
08947 //
08948 // Author: vladl@google.com (Vlad Losev)
08949 
08950 // Type and function utilities for implementing parameterized tests.
08951 
08952 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
08953 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
08954 
08955 #include <iterator>
08956 #include <utility>
08957 #include <vector>
08958 
08959 // scripts/fuse_gtest.py depends on gtest's own header being #included
08960 // *unconditionally*.  Therefore these #includes cannot be moved
08961 // inside #if GTEST_HAS_PARAM_TEST.
08962 // Copyright 2003 Google Inc.
08963 // All rights reserved.
08964 //
08965 // Redistribution and use in source and binary forms, with or without
08966 // modification, are permitted provided that the following conditions are
08967 // met:
08968 //
08969 //     * Redistributions of source code must retain the above copyright
08970 // notice, this list of conditions and the following disclaimer.
08971 //     * Redistributions in binary form must reproduce the above
08972 // copyright notice, this list of conditions and the following disclaimer
08973 // in the documentation and/or other materials provided with the
08974 // distribution.
08975 //     * Neither the name of Google Inc. nor the names of its
08976 // contributors may be used to endorse or promote products derived from
08977 // this software without specific prior written permission.
08978 //
08979 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
08980 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
08981 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
08982 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
08983 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
08984 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
08985 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
08986 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
08987 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
08988 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
08989 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
08990 //
08991 // Authors: Dan Egnor (egnor@google.com)
08992 //
08993 // A "smart" pointer type with reference tracking.  Every pointer to a
08994 // particular object is kept on a circular linked list.  When the last pointer
08995 // to an object is destroyed or reassigned, the object is deleted.
08996 //
08997 // Used properly, this deletes the object when the last reference goes away.
08998 // There are several caveats:
08999 // - Like all reference counting schemes, cycles lead to leaks.
09000 // - Each smart pointer is actually two pointers (8 bytes instead of 4).
09001 // - Every time a pointer is assigned, the entire list of pointers to that
09002 //   object is traversed.  This class is therefore NOT SUITABLE when there
09003 //   will often be more than two or three pointers to a particular object.
09004 // - References are only tracked as long as linked_ptr<> objects are copied.
09005 //   If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
09006 //   will happen (double deletion).
09007 //
09008 // A good use of this class is storing object references in STL containers.
09009 // You can safely put linked_ptr<> in a vector<>.
09010 // Other uses may not be as good.
09011 //
09012 // Note: If you use an incomplete type with linked_ptr<>, the class
09013 // *containing* linked_ptr<> must have a constructor and destructor (even
09014 // if they do nothing!).
09015 //
09016 // Bill Gibbons suggested we use something like this.
09017 //
09018 // Thread Safety:
09019 //   Unlike other linked_ptr implementations, in this implementation
09020 //   a linked_ptr object is thread-safe in the sense that:
09021 //     - it's safe to copy linked_ptr objects concurrently,
09022 //     - it's safe to copy *from* a linked_ptr and read its underlying
09023 //       raw pointer (e.g. via get()) concurrently, and
09024 //     - it's safe to write to two linked_ptrs that point to the same
09025 //       shared object concurrently.
09026 // TODO(wan@google.com): rename this to safe_linked_ptr to avoid
09027 // confusion with normal linked_ptr.
09028 
09029 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
09030 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
09031 
09032 #include <stdlib.h>
09033 #include <assert.h>
09034 
09035 
09036 namespace testing {
09037 namespace internal {
09038 
09039 // Protects copying of all linked_ptr objects.
09040 GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
09041 
09042 // This is used internally by all instances of linked_ptr<>.  It needs to be
09043 // a non-template class because different types of linked_ptr<> can refer to
09044 // the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
09045 // So, it needs to be possible for different types of linked_ptr to participate
09046 // in the same circular linked list, so we need a single class type here.
09047 //
09048 // DO NOT USE THIS CLASS DIRECTLY YOURSELF.  Use linked_ptr<T>.
09049 class linked_ptr_internal {
09050  public:
09051   // Create a new circle that includes only this instance.
09052   void join_new() {
09053     next_ = this;
09054   }
09055 
09056   // Many linked_ptr operations may change p.link_ for some linked_ptr
09057   // variable p in the same circle as this object.  Therefore we need
09058   // to prevent two such operations from occurring concurrently.
09059   //
09060   // Note that different types of linked_ptr objects can coexist in a
09061   // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
09062   // linked_ptr<Derived2>).  Therefore we must use a single mutex to
09063   // protect all linked_ptr objects.  This can create serious
09064   // contention in production code, but is acceptable in a testing
09065   // framework.
09066 
09067   // Join an existing circle.
09068   void join(linked_ptr_internal const* ptr)
09069       GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
09070     MutexLock lock(&g_linked_ptr_mutex);
09071 
09072     linked_ptr_internal const* p = ptr;
09073     while (p->next_ != ptr) p = p->next_;
09074     p->next_ = this;
09075     next_ = ptr;
09076   }
09077 
09078   // Leave whatever circle we're part of.  Returns true if we were the
09079   // last member of the circle.  Once this is done, you can join() another.
09080   bool depart()
09081       GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
09082     MutexLock lock(&g_linked_ptr_mutex);
09083 
09084     if (next_ == this) return true;
09085     linked_ptr_internal const* p = next_;
09086     while (p->next_ != this) p = p->next_;
09087     p->next_ = next_;
09088     return false;
09089   }
09090 
09091  private:
09092   mutable linked_ptr_internal const* next_;
09093 };
09094 
09095 template <typename T>
09096 class linked_ptr {
09097  public:
09098   typedef T element_type;
09099 
09100   // Take over ownership of a raw pointer.  This should happen as soon as
09101   // possible after the object is created.
09102   explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
09103   ~linked_ptr() { depart(); }
09104 
09105   // Copy an existing linked_ptr<>, adding ourselves to the list of references.
09106   template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
09107   linked_ptr(linked_ptr const& ptr) {  // NOLINT
09108     assert(&ptr != this);
09109     copy(&ptr);
09110   }
09111 
09112   // Assignment releases the old value and acquires the new.
09113   template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
09114     depart();
09115     copy(&ptr);
09116     return *this;
09117   }
09118 
09119   linked_ptr& operator=(linked_ptr const& ptr) {
09120     if (&ptr != this) {
09121       depart();
09122       copy(&ptr);
09123     }
09124     return *this;
09125   }
09126 
09127   // Smart pointer members.
09128   void reset(T* ptr = NULL) {
09129     depart();
09130     capture(ptr);
09131   }
09132   T* get() const { return value_; }
09133   T* operator->() const { return value_; }
09134   T& operator*() const { return *value_; }
09135 
09136   bool operator==(T* p) const { return value_ == p; }
09137   bool operator!=(T* p) const { return value_ != p; }
09138   template <typename U>
09139   bool operator==(linked_ptr<U> const& ptr) const {
09140     return value_ == ptr.get();
09141   }
09142   template <typename U>
09143   bool operator!=(linked_ptr<U> const& ptr) const {
09144     return value_ != ptr.get();
09145   }
09146 
09147  private:
09148   template <typename U>
09149   friend class linked_ptr;
09150 
09151   T* value_;
09152   linked_ptr_internal link_;
09153 
09154   void depart() {
09155     if (link_.depart()) delete value_;
09156   }
09157 
09158   void capture(T* ptr) {
09159     value_ = ptr;
09160     link_.join_new();
09161   }
09162 
09163   template <typename U> void copy(linked_ptr<U> const* ptr) {
09164     value_ = ptr->get();
09165     if (value_)
09166       link_.join(&ptr->link_);
09167     else
09168       link_.join_new();
09169   }
09170 };
09171 
09172 template<typename T> inline
09173 bool operator==(T* ptr, const linked_ptr<T>& x) {
09174   return ptr == x.get();
09175 }
09176 
09177 template<typename T> inline
09178 bool operator!=(T* ptr, const linked_ptr<T>& x) {
09179   return ptr != x.get();
09180 }
09181 
09182 // A function to convert T* into linked_ptr<T>
09183 // Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
09184 // for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
09185 template <typename T>
09186 linked_ptr<T> make_linked_ptr(T* ptr) {
09187   return linked_ptr<T>(ptr);
09188 }
09189 
09190 }  // namespace internal
09191 }  // namespace testing
09192 
09193 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
09194 // Copyright 2007, Google Inc.
09195 // All rights reserved.
09196 //
09197 // Redistribution and use in source and binary forms, with or without
09198 // modification, are permitted provided that the following conditions are
09199 // met:
09200 //
09201 //     * Redistributions of source code must retain the above copyright
09202 // notice, this list of conditions and the following disclaimer.
09203 //     * Redistributions in binary form must reproduce the above
09204 // copyright notice, this list of conditions and the following disclaimer
09205 // in the documentation and/or other materials provided with the
09206 // distribution.
09207 //     * Neither the name of Google Inc. nor the names of its
09208 // contributors may be used to endorse or promote products derived from
09209 // this software without specific prior written permission.
09210 //
09211 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
09212 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
09213 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
09214 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
09215 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
09216 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
09217 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
09218 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
09219 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
09220 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
09221 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
09222 //
09223 // Author: wan@google.com (Zhanyong Wan)
09224 
09225 // Google Test - The Google C++ Testing Framework
09226 //
09227 // This file implements a universal value printer that can print a
09228 // value of any type T:
09229 //
09230 //   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
09231 //
09232 // A user can teach this function how to print a class type T by
09233 // defining either operator<<() or PrintTo() in the namespace that
09234 // defines T.  More specifically, the FIRST defined function in the
09235 // following list will be used (assuming T is defined in namespace
09236 // foo):
09237 //
09238 //   1. foo::PrintTo(const T&, ostream*)
09239 //   2. operator<<(ostream&, const T&) defined in either foo or the
09240 //      global namespace.
09241 //
09242 // If none of the above is defined, it will print the debug string of
09243 // the value if it is a protocol buffer, or print the raw bytes in the
09244 // value otherwise.
09245 //
09246 // To aid debugging: when T is a reference type, the address of the
09247 // value is also printed; when T is a (const) char pointer, both the
09248 // pointer value and the NUL-terminated string it points to are
09249 // printed.
09250 //
09251 // We also provide some convenient wrappers:
09252 //
09253 //   // Prints a value to a string.  For a (const or not) char
09254 //   // pointer, the NUL-terminated string (but not the pointer) is
09255 //   // printed.
09256 //   std::string ::testing::PrintToString(const T& value);
09257 //
09258 //   // Prints a value tersely: for a reference type, the referenced
09259 //   // value (but not the address) is printed; for a (const or not) char
09260 //   // pointer, the NUL-terminated string (but not the pointer) is
09261 //   // printed.
09262 //   void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
09263 //
09264 //   // Prints value using the type inferred by the compiler.  The difference
09265 //   // from UniversalTersePrint() is that this function prints both the
09266 //   // pointer and the NUL-terminated string for a (const or not) char pointer.
09267 //   void ::testing::internal::UniversalPrint(const T& value, ostream*);
09268 //
09269 //   // Prints the fields of a tuple tersely to a string vector, one
09270 //   // element for each field. Tuple support must be enabled in
09271 //   // gtest-port.h.
09272 //   std::vector<string> UniversalTersePrintTupleFieldsToStrings(
09273 //       const Tuple& value);
09274 //
09275 // Known limitation:
09276 //
09277 // The print primitives print the elements of an STL-style container
09278 // using the compiler-inferred type of *iter where iter is a
09279 // const_iterator of the container.  When const_iterator is an input
09280 // iterator but not a forward iterator, this inferred type may not
09281 // match value_type, and the print output may be incorrect.  In
09282 // practice, this is rarely a problem as for most containers
09283 // const_iterator is a forward iterator.  We'll fix this if there's an
09284 // actual need for it.  Note that this fix cannot rely on value_type
09285 // being defined as many user-defined container types don't have
09286 // value_type.
09287 
09288 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
09289 #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
09290 
09291 #include <ostream>  // NOLINT
09292 #include <sstream>
09293 #include <string>
09294 #include <utility>
09295 #include <vector>
09296 
09297 namespace testing {
09298 
09299 // Definitions in the 'internal' and 'internal2' name spaces are
09300 // subject to change without notice.  DO NOT USE THEM IN USER CODE!
09301 namespace internal2 {
09302 
09303 // Prints the given number of bytes in the given object to the given
09304 // ostream.
09305 GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
09306                                      size_t count,
09307                                      ::std::ostream* os);
09308 
09309 // For selecting which printer to use when a given type has neither <<
09310 // nor PrintTo().
09311 enum TypeKind {
09312   kProtobuf,              // a protobuf type
09313   kConvertibleToInteger,  // a type implicitly convertible to BiggestInt
09314                           // (e.g. a named or unnamed enum type)
09315   kOtherType              // anything else
09316 };
09317 
09318 // TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
09319 // by the universal printer to print a value of type T when neither
09320 // operator<< nor PrintTo() is defined for T, where kTypeKind is the
09321 // "kind" of T as defined by enum TypeKind.
09322 template <typename T, TypeKind kTypeKind>
09323 class TypeWithoutFormatter {
09324  public:
09325   // This default version is called when kTypeKind is kOtherType.
09326   static void PrintValue(const T& value, ::std::ostream* os) {
09327     PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
09328                          sizeof(value), os);
09329   }
09330 };
09331 
09332 // We print a protobuf using its ShortDebugString() when the string
09333 // doesn't exceed this many characters; otherwise we print it using
09334 // DebugString() for better readability.
09335 const size_t kProtobufOneLinerMaxLength = 50;
09336 
09337 template <typename T>
09338 class TypeWithoutFormatter<T, kProtobuf> {
09339  public:
09340   static void PrintValue(const T& value, ::std::ostream* os) {
09341     const ::testing::internal::string short_str = value.ShortDebugString();
09342     const ::testing::internal::string pretty_str =
09343         short_str.length() <= kProtobufOneLinerMaxLength ?
09344         short_str : ("\n" + value.DebugString());
09345     *os << ("<" + pretty_str + ">");
09346   }
09347 };
09348 
09349 template <typename T>
09350 class TypeWithoutFormatter<T, kConvertibleToInteger> {
09351  public:
09352   // Since T has no << operator or PrintTo() but can be implicitly
09353   // converted to BiggestInt, we print it as a BiggestInt.
09354   //
09355   // Most likely T is an enum type (either named or unnamed), in which
09356   // case printing it as an integer is the desired behavior.  In case
09357   // T is not an enum, printing it as an integer is the best we can do
09358   // given that it has no user-defined printer.
09359   static void PrintValue(const T& value, ::std::ostream* os) {
09360     const internal::BiggestInt kBigInt = value;
09361     *os << kBigInt;
09362   }
09363 };
09364 
09365 // Prints the given value to the given ostream.  If the value is a
09366 // protocol message, its debug string is printed; if it's an enum or
09367 // of a type implicitly convertible to BiggestInt, it's printed as an
09368 // integer; otherwise the bytes in the value are printed.  This is
09369 // what UniversalPrinter<T>::Print() does when it knows nothing about
09370 // type T and T has neither << operator nor PrintTo().
09371 //
09372 // A user can override this behavior for a class type Foo by defining
09373 // a << operator in the namespace where Foo is defined.
09374 //
09375 // We put this operator in namespace 'internal2' instead of 'internal'
09376 // to simplify the implementation, as much code in 'internal' needs to
09377 // use << in STL, which would conflict with our own << were it defined
09378 // in 'internal'.
09379 //
09380 // Note that this operator<< takes a generic std::basic_ostream<Char,
09381 // CharTraits> type instead of the more restricted std::ostream.  If
09382 // we define it to take an std::ostream instead, we'll get an
09383 // "ambiguous overloads" compiler error when trying to print a type
09384 // Foo that supports streaming to std::basic_ostream<Char,
09385 // CharTraits>, as the compiler cannot tell whether
09386 // operator<<(std::ostream&, const T&) or
09387 // operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
09388 // specific.
09389 template <typename Char, typename CharTraits, typename T>
09390 ::std::basic_ostream<Char, CharTraits>& operator<<(
09391     ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
09392   TypeWithoutFormatter<T,
09393       (internal::IsAProtocolMessage<T>::value ? kProtobuf :
09394        internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
09395        kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
09396   return os;
09397 }
09398 
09399 }  // namespace internal2
09400 }  // namespace testing
09401 
09402 // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
09403 // magic needed for implementing UniversalPrinter won't work.
09404 namespace testing_internal {
09405 
09406 // Used to print a value that is not an STL-style container when the
09407 // user doesn't define PrintTo() for it.
09408 template <typename T>
09409 void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
09410   // With the following statement, during unqualified name lookup,
09411   // testing::internal2::operator<< appears as if it was declared in
09412   // the nearest enclosing namespace that contains both
09413   // ::testing_internal and ::testing::internal2, i.e. the global
09414   // namespace.  For more details, refer to the C++ Standard section
09415   // 7.3.4-1 [namespace.udir].  This allows us to fall back onto
09416   // testing::internal2::operator<< in case T doesn't come with a <<
09417   // operator.
09418   //
09419   // We cannot write 'using ::testing::internal2::operator<<;', which
09420   // gcc 3.3 fails to compile due to a compiler bug.
09421   using namespace ::testing::internal2;  // NOLINT
09422 
09423   // Assuming T is defined in namespace foo, in the next statement,
09424   // the compiler will consider all of:
09425   //
09426   //   1. foo::operator<< (thanks to Koenig look-up),
09427   //   2. ::operator<< (as the current namespace is enclosed in ::),
09428   //   3. testing::internal2::operator<< (thanks to the using statement above).
09429   //
09430   // The operator<< whose type matches T best will be picked.
09431   //
09432   // We deliberately allow #2 to be a candidate, as sometimes it's
09433   // impossible to define #1 (e.g. when foo is ::std, defining
09434   // anything in it is undefined behavior unless you are a compiler
09435   // vendor.).
09436   *os << value;
09437 }
09438 
09439 }  // namespace testing_internal
09440 
09441 namespace testing {
09442 namespace internal {
09443 
09444 // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
09445 // value to the given ostream.  The caller must ensure that
09446 // 'ostream_ptr' is not NULL, or the behavior is undefined.
09447 //
09448 // We define UniversalPrinter as a class template (as opposed to a
09449 // function template), as we need to partially specialize it for
09450 // reference types, which cannot be done with function templates.
09451 template <typename T>
09452 class UniversalPrinter;
09453 
09454 template <typename T>
09455 void UniversalPrint(const T& value, ::std::ostream* os);
09456 
09457 // Used to print an STL-style container when the user doesn't define
09458 // a PrintTo() for it.
09459 template <typename C>
09460 void DefaultPrintTo(IsContainer /* dummy */,
09461                     false_type /* is not a pointer */,
09462                     const C& container, ::std::ostream* os) {
09463   const size_t kMaxCount = 32;  // The maximum number of elements to print.
09464   *os << '{';
09465   size_t count = 0;
09466   for (typename C::const_iterator it = container.begin();
09467        it != container.end(); ++it, ++count) {
09468     if (count > 0) {
09469       *os << ',';
09470       if (count == kMaxCount) {  // Enough has been printed.
09471         *os << " ...";
09472         break;
09473       }
09474     }
09475     *os << ' ';
09476     // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
09477     // handle *it being a native array.
09478     internal::UniversalPrint(*it, os);
09479   }
09480 
09481   if (count > 0) {
09482     *os << ' ';
09483   }
09484   *os << '}';
09485 }
09486 
09487 // Used to print a pointer that is neither a char pointer nor a member
09488 // pointer, when the user doesn't define PrintTo() for it.  (A member
09489 // variable pointer or member function pointer doesn't really point to
09490 // a location in the address space.  Their representation is
09491 // implementation-defined.  Therefore they will be printed as raw
09492 // bytes.)
09493 template <typename T>
09494 void DefaultPrintTo(IsNotContainer /* dummy */,
09495                     true_type /* is a pointer */,
09496                     T* p, ::std::ostream* os) {
09497   if (p == NULL) {
09498     *os << "NULL";
09499   } else {
09500     // C++ doesn't allow casting from a function pointer to any object
09501     // pointer.
09502     //
09503     // IsTrue() silences warnings: "Condition is always true",
09504     // "unreachable code".
09505     if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
09506       // T is not a function type.  We just call << to print p,
09507       // relying on ADL to pick up user-defined << for their pointer
09508       // types, if any.
09509       *os << p;
09510     } else {
09511       // T is a function type, so '*os << p' doesn't do what we want
09512       // (it just prints p as bool).  We want to print p as a const
09513       // void*.  However, we cannot cast it to const void* directly,
09514       // even using reinterpret_cast, as earlier versions of gcc
09515       // (e.g. 3.4.5) cannot compile the cast when p is a function
09516       // pointer.  Casting to UInt64 first solves the problem.
09517       *os << reinterpret_cast<const void*>(
09518           reinterpret_cast<internal::UInt64>(p));
09519     }
09520   }
09521 }
09522 
09523 // Used to print a non-container, non-pointer value when the user
09524 // doesn't define PrintTo() for it.
09525 template <typename T>
09526 void DefaultPrintTo(IsNotContainer /* dummy */,
09527                     false_type /* is not a pointer */,
09528                     const T& value, ::std::ostream* os) {
09529   ::testing_internal::DefaultPrintNonContainerTo(value, os);
09530 }
09531 
09532 // Prints the given value using the << operator if it has one;
09533 // otherwise prints the bytes in it.  This is what
09534 // UniversalPrinter<T>::Print() does when PrintTo() is not specialized
09535 // or overloaded for type T.
09536 //
09537 // A user can override this behavior for a class type Foo by defining
09538 // an overload of PrintTo() in the namespace where Foo is defined.  We
09539 // give the user this option as sometimes defining a << operator for
09540 // Foo is not desirable (e.g. the coding style may prevent doing it,
09541 // or there is already a << operator but it doesn't do what the user
09542 // wants).
09543 template <typename T>
09544 void PrintTo(const T& value, ::std::ostream* os) {
09545   // DefaultPrintTo() is overloaded.  The type of its first two
09546   // arguments determine which version will be picked.  If T is an
09547   // STL-style container, the version for container will be called; if
09548   // T is a pointer, the pointer version will be called; otherwise the
09549   // generic version will be called.
09550   //
09551   // Note that we check for container types here, prior to we check
09552   // for protocol message types in our operator<<.  The rationale is:
09553   //
09554   // For protocol messages, we want to give people a chance to
09555   // override Google Mock's format by defining a PrintTo() or
09556   // operator<<.  For STL containers, other formats can be
09557   // incompatible with Google Mock's format for the container
09558   // elements; therefore we check for container types here to ensure
09559   // that our format is used.
09560   //
09561   // The second argument of DefaultPrintTo() is needed to bypass a bug
09562   // in Symbian's C++ compiler that prevents it from picking the right
09563   // overload between:
09564   //
09565   //   PrintTo(const T& x, ...);
09566   //   PrintTo(T* x, ...);
09567   DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
09568 }
09569 
09570 // The following list of PrintTo() overloads tells
09571 // UniversalPrinter<T>::Print() how to print standard types (built-in
09572 // types, strings, plain arrays, and pointers).
09573 
09574 // Overloads for various char types.
09575 GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
09576 GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
09577 inline void PrintTo(char c, ::std::ostream* os) {
09578   // When printing a plain char, we always treat it as unsigned.  This
09579   // way, the output won't be affected by whether the compiler thinks
09580   // char is signed or not.
09581   PrintTo(static_cast<unsigned char>(c), os);
09582 }
09583 
09584 // Overloads for other simple built-in types.
09585 inline void PrintTo(bool x, ::std::ostream* os) {
09586   *os << (x ? "true" : "false");
09587 }
09588 
09589 // Overload for wchar_t type.
09590 // Prints a wchar_t as a symbol if it is printable or as its internal
09591 // code otherwise and also as its decimal code (except for L'\0').
09592 // The L'\0' char is printed as "L'\\0'". The decimal code is printed
09593 // as signed integer when wchar_t is implemented by the compiler
09594 // as a signed type and is printed as an unsigned integer when wchar_t
09595 // is implemented as an unsigned type.
09596 GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
09597 
09598 // Overloads for C strings.
09599 GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
09600 inline void PrintTo(char* s, ::std::ostream* os) {
09601   PrintTo(ImplicitCast_<const char*>(s), os);
09602 }
09603 
09604 // signed/unsigned char is often used for representing binary data, so
09605 // we print pointers to it as void* to be safe.
09606 inline void PrintTo(const signed char* s, ::std::ostream* os) {
09607   PrintTo(ImplicitCast_<const void*>(s), os);
09608 }
09609 inline void PrintTo(signed char* s, ::std::ostream* os) {
09610   PrintTo(ImplicitCast_<const void*>(s), os);
09611 }
09612 inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
09613   PrintTo(ImplicitCast_<const void*>(s), os);
09614 }
09615 inline void PrintTo(unsigned char* s, ::std::ostream* os) {
09616   PrintTo(ImplicitCast_<const void*>(s), os);
09617 }
09618 
09619 // MSVC can be configured to define wchar_t as a typedef of unsigned
09620 // short.  It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
09621 // type.  When wchar_t is a typedef, defining an overload for const
09622 // wchar_t* would cause unsigned short* be printed as a wide string,
09623 // possibly causing invalid memory accesses.
09624 #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
09625 // Overloads for wide C strings
09626 GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
09627 inline void PrintTo(wchar_t* s, ::std::ostream* os) {
09628   PrintTo(ImplicitCast_<const wchar_t*>(s), os);
09629 }
09630 #endif
09631 
09632 // Overload for C arrays.  Multi-dimensional arrays are printed
09633 // properly.
09634 
09635 // Prints the given number of elements in an array, without printing
09636 // the curly braces.
09637 template <typename T>
09638 void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
09639   UniversalPrint(a[0], os);
09640   for (size_t i = 1; i != count; i++) {
09641     *os << ", ";
09642     UniversalPrint(a[i], os);
09643   }
09644 }
09645 
09646 // Overloads for ::string and ::std::string.
09647 #if GTEST_HAS_GLOBAL_STRING
09648 GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
09649 inline void PrintTo(const ::string& s, ::std::ostream* os) {
09650   PrintStringTo(s, os);
09651 }
09652 #endif  // GTEST_HAS_GLOBAL_STRING
09653 
09654 GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
09655 inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
09656   PrintStringTo(s, os);
09657 }
09658 
09659 // Overloads for ::wstring and ::std::wstring.
09660 #if GTEST_HAS_GLOBAL_WSTRING
09661 GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
09662 inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
09663   PrintWideStringTo(s, os);
09664 }
09665 #endif  // GTEST_HAS_GLOBAL_WSTRING
09666 
09667 #if GTEST_HAS_STD_WSTRING
09668 GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
09669 inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
09670   PrintWideStringTo(s, os);
09671 }
09672 #endif  // GTEST_HAS_STD_WSTRING
09673 
09674 #if GTEST_HAS_TR1_TUPLE
09675 // Overload for ::std::tr1::tuple.  Needed for printing function arguments,
09676 // which are packed as tuples.
09677 
09678 // Helper function for printing a tuple.  T must be instantiated with
09679 // a tuple type.
09680 template <typename T>
09681 void PrintTupleTo(const T& t, ::std::ostream* os);
09682 
09683 // Overloaded PrintTo() for tuples of various arities.  We support
09684 // tuples of up-to 10 fields.  The following implementation works
09685 // regardless of whether tr1::tuple is implemented using the
09686 // non-standard variadic template feature or not.
09687 
09688 inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
09689   PrintTupleTo(t, os);
09690 }
09691 
09692 template <typename T1>
09693 void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
09694   PrintTupleTo(t, os);
09695 }
09696 
09697 template <typename T1, typename T2>
09698 void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
09699   PrintTupleTo(t, os);
09700 }
09701 
09702 template <typename T1, typename T2, typename T3>
09703 void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
09704   PrintTupleTo(t, os);
09705 }
09706 
09707 template <typename T1, typename T2, typename T3, typename T4>
09708 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
09709   PrintTupleTo(t, os);
09710 }
09711 
09712 template <typename T1, typename T2, typename T3, typename T4, typename T5>
09713 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
09714              ::std::ostream* os) {
09715   PrintTupleTo(t, os);
09716 }
09717 
09718 template <typename T1, typename T2, typename T3, typename T4, typename T5,
09719           typename T6>
09720 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
09721              ::std::ostream* os) {
09722   PrintTupleTo(t, os);
09723 }
09724 
09725 template <typename T1, typename T2, typename T3, typename T4, typename T5,
09726           typename T6, typename T7>
09727 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
09728              ::std::ostream* os) {
09729   PrintTupleTo(t, os);
09730 }
09731 
09732 template <typename T1, typename T2, typename T3, typename T4, typename T5,
09733           typename T6, typename T7, typename T8>
09734 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
09735              ::std::ostream* os) {
09736   PrintTupleTo(t, os);
09737 }
09738 
09739 template <typename T1, typename T2, typename T3, typename T4, typename T5,
09740           typename T6, typename T7, typename T8, typename T9>
09741 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
09742              ::std::ostream* os) {
09743   PrintTupleTo(t, os);
09744 }
09745 
09746 template <typename T1, typename T2, typename T3, typename T4, typename T5,
09747           typename T6, typename T7, typename T8, typename T9, typename T10>
09748 void PrintTo(
09749     const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
09750     ::std::ostream* os) {
09751   PrintTupleTo(t, os);
09752 }
09753 #endif  // GTEST_HAS_TR1_TUPLE
09754 
09755 // Overload for std::pair.
09756 template <typename T1, typename T2>
09757 void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
09758   *os << '(';
09759   // We cannot use UniversalPrint(value.first, os) here, as T1 may be
09760   // a reference type.  The same for printing value.second.
09761   UniversalPrinter<T1>::Print(value.first, os);
09762   *os << ", ";
09763   UniversalPrinter<T2>::Print(value.second, os);
09764   *os << ')';
09765 }
09766 
09767 // Implements printing a non-reference type T by letting the compiler
09768 // pick the right overload of PrintTo() for T.
09769 template <typename T>
09770 class UniversalPrinter {
09771  public:
09772   // MSVC warns about adding const to a function type, so we want to
09773   // disable the warning.
09774 #ifdef _MSC_VER
09775 # pragma warning(push)          // Saves the current warning state.
09776 # pragma warning(disable:4180)  // Temporarily disables warning 4180.
09777 #endif  // _MSC_VER
09778 
09779   // Note: we deliberately don't call this PrintTo(), as that name
09780   // conflicts with ::testing::internal::PrintTo in the body of the
09781   // function.
09782   static void Print(const T& value, ::std::ostream* os) {
09783     // By default, ::testing::internal::PrintTo() is used for printing
09784     // the value.
09785     //
09786     // Thanks to Koenig look-up, if T is a class and has its own
09787     // PrintTo() function defined in its namespace, that function will
09788     // be visible here.  Since it is more specific than the generic ones
09789     // in ::testing::internal, it will be picked by the compiler in the
09790     // following statement - exactly what we want.
09791     PrintTo(value, os);
09792   }
09793 
09794 #ifdef _MSC_VER
09795 # pragma warning(pop)           // Restores the warning state.
09796 #endif  // _MSC_VER
09797 };
09798 
09799 // UniversalPrintArray(begin, len, os) prints an array of 'len'
09800 // elements, starting at address 'begin'.
09801 template <typename T>
09802 void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
09803   if (len == 0) {
09804     *os << "{}";
09805   } else {
09806     *os << "{ ";
09807     const size_t kThreshold = 18;
09808     const size_t kChunkSize = 8;
09809     // If the array has more than kThreshold elements, we'll have to
09810     // omit some details by printing only the first and the last
09811     // kChunkSize elements.
09812     // TODO(wan@google.com): let the user control the threshold using a flag.
09813     if (len <= kThreshold) {
09814       PrintRawArrayTo(begin, len, os);
09815     } else {
09816       PrintRawArrayTo(begin, kChunkSize, os);
09817       *os << ", ..., ";
09818       PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
09819     }
09820     *os << " }";
09821   }
09822 }
09823 // This overload prints a (const) char array compactly.
09824 GTEST_API_ void UniversalPrintArray(
09825     const char* begin, size_t len, ::std::ostream* os);
09826 
09827 // This overload prints a (const) wchar_t array compactly.
09828 GTEST_API_ void UniversalPrintArray(
09829     const wchar_t* begin, size_t len, ::std::ostream* os);
09830 
09831 // Implements printing an array type T[N].
09832 template <typename T, size_t N>
09833 class UniversalPrinter<T[N]> {
09834  public:
09835   // Prints the given array, omitting some elements when there are too
09836   // many.
09837   static void Print(const T (&a)[N], ::std::ostream* os) {
09838     UniversalPrintArray(a, N, os);
09839   }
09840 };
09841 
09842 // Implements printing a reference type T&.
09843 template <typename T>
09844 class UniversalPrinter<T&> {
09845  public:
09846   // MSVC warns about adding const to a function type, so we want to
09847   // disable the warning.
09848 #ifdef _MSC_VER
09849 # pragma warning(push)          // Saves the current warning state.
09850 # pragma warning(disable:4180)  // Temporarily disables warning 4180.
09851 #endif  // _MSC_VER
09852 
09853   static void Print(const T& value, ::std::ostream* os) {
09854     // Prints the address of the value.  We use reinterpret_cast here
09855     // as static_cast doesn't compile when T is a function type.
09856     *os << "@" << reinterpret_cast<const void*>(&value) << " ";
09857 
09858     // Then prints the value itself.
09859     UniversalPrint(value, os);
09860   }
09861 
09862 #ifdef _MSC_VER
09863 # pragma warning(pop)           // Restores the warning state.
09864 #endif  // _MSC_VER
09865 };
09866 
09867 // Prints a value tersely: for a reference type, the referenced value
09868 // (but not the address) is printed; for a (const) char pointer, the
09869 // NUL-terminated string (but not the pointer) is printed.
09870 
09871 template <typename T>
09872 class UniversalTersePrinter {
09873  public:
09874   static void Print(const T& value, ::std::ostream* os) {
09875     UniversalPrint(value, os);
09876   }
09877 };
09878 template <typename T>
09879 class UniversalTersePrinter<T&> {
09880  public:
09881   static void Print(const T& value, ::std::ostream* os) {
09882     UniversalPrint(value, os);
09883   }
09884 };
09885 template <typename T, size_t N>
09886 class UniversalTersePrinter<T[N]> {
09887  public:
09888   static void Print(const T (&value)[N], ::std::ostream* os) {
09889     UniversalPrinter<T[N]>::Print(value, os);
09890   }
09891 };
09892 template <>
09893 class UniversalTersePrinter<const char*> {
09894  public:
09895   static void Print(const char* str, ::std::ostream* os) {
09896     if (str == NULL) {
09897       *os << "NULL";
09898     } else {
09899       UniversalPrint(string(str), os);
09900     }
09901   }
09902 };
09903 template <>
09904 class UniversalTersePrinter<char*> {
09905  public:
09906   static void Print(char* str, ::std::ostream* os) {
09907     UniversalTersePrinter<const char*>::Print(str, os);
09908   }
09909 };
09910 
09911 #if GTEST_HAS_STD_WSTRING
09912 template <>
09913 class UniversalTersePrinter<const wchar_t*> {
09914  public:
09915   static void Print(const wchar_t* str, ::std::ostream* os) {
09916     if (str == NULL) {
09917       *os << "NULL";
09918     } else {
09919       UniversalPrint(::std::wstring(str), os);
09920     }
09921   }
09922 };
09923 #endif
09924 
09925 template <>
09926 class UniversalTersePrinter<wchar_t*> {
09927  public:
09928   static void Print(wchar_t* str, ::std::ostream* os) {
09929     UniversalTersePrinter<const wchar_t*>::Print(str, os);
09930   }
09931 };
09932 
09933 template <typename T>
09934 void UniversalTersePrint(const T& value, ::std::ostream* os) {
09935   UniversalTersePrinter<T>::Print(value, os);
09936 }
09937 
09938 // Prints a value using the type inferred by the compiler.  The
09939 // difference between this and UniversalTersePrint() is that for a
09940 // (const) char pointer, this prints both the pointer and the
09941 // NUL-terminated string.
09942 template <typename T>
09943 void UniversalPrint(const T& value, ::std::ostream* os) {
09944   // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
09945   // UniversalPrinter with T directly.
09946   typedef T T1;
09947   UniversalPrinter<T1>::Print(value, os);
09948 }
09949 
09950 #if GTEST_HAS_TR1_TUPLE
09951 typedef ::std::vector<string> Strings;
09952 
09953 // This helper template allows PrintTo() for tuples and
09954 // UniversalTersePrintTupleFieldsToStrings() to be defined by
09955 // induction on the number of tuple fields.  The idea is that
09956 // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
09957 // fields in tuple t, and can be defined in terms of
09958 // TuplePrefixPrinter<N - 1>.
09959 
09960 // The inductive case.
09961 template <size_t N>
09962 struct TuplePrefixPrinter {
09963   // Prints the first N fields of a tuple.
09964   template <typename Tuple>
09965   static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
09966     TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
09967     *os << ", ";
09968     UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
09969         ::Print(::std::tr1::get<N - 1>(t), os);
09970   }
09971 
09972   // Tersely prints the first N fields of a tuple to a string vector,
09973   // one element for each field.
09974   template <typename Tuple>
09975   static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
09976     TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
09977     ::std::stringstream ss;
09978     UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
09979     strings->push_back(ss.str());
09980   }
09981 };
09982 
09983 // Base cases.
09984 template <>
09985 struct TuplePrefixPrinter<0> {
09986   template <typename Tuple>
09987   static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
09988 
09989   template <typename Tuple>
09990   static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
09991 };
09992 // We have to specialize the entire TuplePrefixPrinter<> class
09993 // template here, even though the definition of
09994 // TersePrintPrefixToStrings() is the same as the generic version, as
09995 // Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
09996 // support specializing a method template of a class template.
09997 template <>
09998 struct TuplePrefixPrinter<1> {
09999   template <typename Tuple>
10000   static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
10001     UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
10002         Print(::std::tr1::get<0>(t), os);
10003   }
10004 
10005   template <typename Tuple>
10006   static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
10007     ::std::stringstream ss;
10008     UniversalTersePrint(::std::tr1::get<0>(t), &ss);
10009     strings->push_back(ss.str());
10010   }
10011 };
10012 
10013 // Helper function for printing a tuple.  T must be instantiated with
10014 // a tuple type.
10015 template <typename T>
10016 void PrintTupleTo(const T& t, ::std::ostream* os) {
10017   *os << "(";
10018   TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
10019       PrintPrefixTo(t, os);
10020   *os << ")";
10021 }
10022 
10023 // Prints the fields of a tuple tersely to a string vector, one
10024 // element for each field.  See the comment before
10025 // UniversalTersePrint() for how we define "tersely".
10026 template <typename Tuple>
10027 Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
10028   Strings result;
10029   TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
10030       TersePrintPrefixToStrings(value, &result);
10031   return result;
10032 }
10033 #endif  // GTEST_HAS_TR1_TUPLE
10034 
10035 }  // namespace internal
10036 
10037 template <typename T>
10038 ::std::string PrintToString(const T& value) {
10039   ::std::stringstream ss;
10040   internal::UniversalTersePrinter<T>::Print(value, &ss);
10041   return ss.str();
10042 }
10043 
10044 }  // namespace testing
10045 
10046 #endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
10047 
10048 #if GTEST_HAS_PARAM_TEST
10049 
10050 namespace testing {
10051 namespace internal {
10052 
10053 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10054 //
10055 // Outputs a message explaining invalid registration of different
10056 // fixture class for the same test case. This may happen when
10057 // TEST_P macro is used to define two tests with the same name
10058 // but in different namespaces.
10059 GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
10060                                           const char* file, int line);
10061 
10062 template <typename> class ParamGeneratorInterface;
10063 template <typename> class ParamGenerator;
10064 
10065 // Interface for iterating over elements provided by an implementation
10066 // of ParamGeneratorInterface<T>.
10067 template <typename T>
10068 class ParamIteratorInterface {
10069  public:
10070   virtual ~ParamIteratorInterface() {}
10071   // A pointer to the base generator instance.
10072   // Used only for the purposes of iterator comparison
10073   // to make sure that two iterators belong to the same generator.
10074   virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
10075   // Advances iterator to point to the next element
10076   // provided by the generator. The caller is responsible
10077   // for not calling Advance() on an iterator equal to
10078   // BaseGenerator()->End().
10079   virtual void Advance() = 0;
10080   // Clones the iterator object. Used for implementing copy semantics
10081   // of ParamIterator<T>.
10082   virtual ParamIteratorInterface* Clone() const = 0;
10083   // Dereferences the current iterator and provides (read-only) access
10084   // to the pointed value. It is the caller's responsibility not to call
10085   // Current() on an iterator equal to BaseGenerator()->End().
10086   // Used for implementing ParamGenerator<T>::operator*().
10087   virtual const T* Current() const = 0;
10088   // Determines whether the given iterator and other point to the same
10089   // element in the sequence generated by the generator.
10090   // Used for implementing ParamGenerator<T>::operator==().
10091   virtual bool Equals(const ParamIteratorInterface& other) const = 0;
10092 };
10093 
10094 // Class iterating over elements provided by an implementation of
10095 // ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
10096 // and implements the const forward iterator concept.
10097 template <typename T>
10098 class ParamIterator {
10099  public:
10100   typedef T value_type;
10101   typedef const T& reference;
10102   typedef ptrdiff_t difference_type;
10103 
10104   // ParamIterator assumes ownership of the impl_ pointer.
10105   ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
10106   ParamIterator& operator=(const ParamIterator& other) {
10107     if (this != &other)
10108       impl_.reset(other.impl_->Clone());
10109     return *this;
10110   }
10111 
10112   const T& operator*() const { return *impl_->Current(); }
10113   const T* operator->() const { return impl_->Current(); }
10114   // Prefix version of operator++.
10115   ParamIterator& operator++() {
10116     impl_->Advance();
10117     return *this;
10118   }
10119   // Postfix version of operator++.
10120   ParamIterator operator++(int /*unused*/) {
10121     ParamIteratorInterface<T>* clone = impl_->Clone();
10122     impl_->Advance();
10123     return ParamIterator(clone);
10124   }
10125   bool operator==(const ParamIterator& other) const {
10126     return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
10127   }
10128   bool operator!=(const ParamIterator& other) const {
10129     return !(*this == other);
10130   }
10131 
10132  private:
10133   friend class ParamGenerator<T>;
10134   explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
10135   scoped_ptr<ParamIteratorInterface<T> > impl_;
10136 };
10137 
10138 // ParamGeneratorInterface<T> is the binary interface to access generators
10139 // defined in other translation units.
10140 template <typename T>
10141 class ParamGeneratorInterface {
10142  public:
10143   typedef T ParamType;
10144 
10145   virtual ~ParamGeneratorInterface() {}
10146 
10147   // Generator interface definition
10148   virtual ParamIteratorInterface<T>* Begin() const = 0;
10149   virtual ParamIteratorInterface<T>* End() const = 0;
10150 };
10151 
10152 // Wraps ParamGeneratorInterface<T> and provides general generator syntax
10153 // compatible with the STL Container concept.
10154 // This class implements copy initialization semantics and the contained
10155 // ParamGeneratorInterface<T> instance is shared among all copies
10156 // of the original object. This is possible because that instance is immutable.
10157 template<typename T>
10158 class ParamGenerator {
10159  public:
10160   typedef ParamIterator<T> iterator;
10161 
10162   explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
10163   ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
10164 
10165   ParamGenerator& operator=(const ParamGenerator& other) {
10166     impl_ = other.impl_;
10167     return *this;
10168   }
10169 
10170   iterator begin() const { return iterator(impl_->Begin()); }
10171   iterator end() const { return iterator(impl_->End()); }
10172 
10173  private:
10174   linked_ptr<const ParamGeneratorInterface<T> > impl_;
10175 };
10176 
10177 // Generates values from a range of two comparable values. Can be used to
10178 // generate sequences of user-defined types that implement operator+() and
10179 // operator<().
10180 // This class is used in the Range() function.
10181 template <typename T, typename IncrementT>
10182 class RangeGenerator : public ParamGeneratorInterface<T> {
10183  public:
10184   RangeGenerator(T begin, T end, IncrementT step)
10185       : begin_(begin), end_(end),
10186         step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
10187   virtual ~RangeGenerator() {}
10188 
10189   virtual ParamIteratorInterface<T>* Begin() const {
10190     return new Iterator(this, begin_, 0, step_);
10191   }
10192   virtual ParamIteratorInterface<T>* End() const {
10193     return new Iterator(this, end_, end_index_, step_);
10194   }
10195 
10196  private:
10197   class Iterator : public ParamIteratorInterface<T> {
10198    public:
10199     Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
10200              IncrementT step)
10201         : base_(base), value_(value), index_(index), step_(step) {}
10202     virtual ~Iterator() {}
10203 
10204     virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10205       return base_;
10206     }
10207     virtual void Advance() {
10208       value_ = value_ + step_;
10209       index_++;
10210     }
10211     virtual ParamIteratorInterface<T>* Clone() const {
10212       return new Iterator(*this);
10213     }
10214     virtual const T* Current() const { return &value_; }
10215     virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10216       // Having the same base generator guarantees that the other
10217       // iterator is of the same type and we can downcast.
10218       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10219           << "The program attempted to compare iterators "
10220           << "from different generators." << std::endl;
10221       const int other_index =
10222           CheckedDowncastToActualType<const Iterator>(&other)->index_;
10223       return index_ == other_index;
10224     }
10225 
10226    private:
10227     Iterator(const Iterator& other)
10228         : ParamIteratorInterface<T>(),
10229           base_(other.base_), value_(other.value_), index_(other.index_),
10230           step_(other.step_) {}
10231 
10232     // No implementation - assignment is unsupported.
10233     void operator=(const Iterator& other);
10234 
10235     const ParamGeneratorInterface<T>* const base_;
10236     T value_;
10237     int index_;
10238     const IncrementT step_;
10239   };  // class RangeGenerator::Iterator
10240 
10241   static int CalculateEndIndex(const T& begin,
10242                                const T& end,
10243                                const IncrementT& step) {
10244     int end_index = 0;
10245     for (T i = begin; i < end; i = i + step)
10246       end_index++;
10247     return end_index;
10248   }
10249 
10250   // No implementation - assignment is unsupported.
10251   void operator=(const RangeGenerator& other);
10252 
10253   const T begin_;
10254   const T end_;
10255   const IncrementT step_;
10256   // The index for the end() iterator. All the elements in the generated
10257   // sequence are indexed (0-based) to aid iterator comparison.
10258   const int end_index_;
10259 };  // class RangeGenerator
10260 
10261 
10262 // Generates values from a pair of STL-style iterators. Used in the
10263 // ValuesIn() function. The elements are copied from the source range
10264 // since the source can be located on the stack, and the generator
10265 // is likely to persist beyond that stack frame.
10266 template <typename T>
10267 class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
10268  public:
10269   template <typename ForwardIterator>
10270   ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
10271       : container_(begin, end) {}
10272   virtual ~ValuesInIteratorRangeGenerator() {}
10273 
10274   virtual ParamIteratorInterface<T>* Begin() const {
10275     return new Iterator(this, container_.begin());
10276   }
10277   virtual ParamIteratorInterface<T>* End() const {
10278     return new Iterator(this, container_.end());
10279   }
10280 
10281  private:
10282   typedef typename ::std::vector<T> ContainerType;
10283 
10284   class Iterator : public ParamIteratorInterface<T> {
10285    public:
10286     Iterator(const ParamGeneratorInterface<T>* base,
10287              typename ContainerType::const_iterator iterator)
10288         : base_(base), iterator_(iterator) {}
10289     virtual ~Iterator() {}
10290 
10291     virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
10292       return base_;
10293     }
10294     virtual void Advance() {
10295       ++iterator_;
10296       value_.reset();
10297     }
10298     virtual ParamIteratorInterface<T>* Clone() const {
10299       return new Iterator(*this);
10300     }
10301     // We need to use cached value referenced by iterator_ because *iterator_
10302     // can return a temporary object (and of type other then T), so just
10303     // having "return &*iterator_;" doesn't work.
10304     // value_ is updated here and not in Advance() because Advance()
10305     // can advance iterator_ beyond the end of the range, and we cannot
10306     // detect that fact. The client code, on the other hand, is
10307     // responsible for not calling Current() on an out-of-range iterator.
10308     virtual const T* Current() const {
10309       if (value_.get() == NULL)
10310         value_.reset(new T(*iterator_));
10311       return value_.get();
10312     }
10313     virtual bool Equals(const ParamIteratorInterface<T>& other) const {
10314       // Having the same base generator guarantees that the other
10315       // iterator is of the same type and we can downcast.
10316       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
10317           << "The program attempted to compare iterators "
10318           << "from different generators." << std::endl;
10319       return iterator_ ==
10320           CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
10321     }
10322 
10323    private:
10324     Iterator(const Iterator& other)
10325           // The explicit constructor call suppresses a false warning
10326           // emitted by gcc when supplied with the -Wextra option.
10327         : ParamIteratorInterface<T>(),
10328           base_(other.base_),
10329           iterator_(other.iterator_) {}
10330 
10331     const ParamGeneratorInterface<T>* const base_;
10332     typename ContainerType::const_iterator iterator_;
10333     // A cached value of *iterator_. We keep it here to allow access by
10334     // pointer in the wrapping iterator's operator->().
10335     // value_ needs to be mutable to be accessed in Current().
10336     // Use of scoped_ptr helps manage cached value's lifetime,
10337     // which is bound by the lifespan of the iterator itself.
10338     mutable scoped_ptr<const T> value_;
10339   };  // class ValuesInIteratorRangeGenerator::Iterator
10340 
10341   // No implementation - assignment is unsupported.
10342   void operator=(const ValuesInIteratorRangeGenerator& other);
10343 
10344   const ContainerType container_;
10345 };  // class ValuesInIteratorRangeGenerator
10346 
10347 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10348 //
10349 // Stores a parameter value and later creates tests parameterized with that
10350 // value.
10351 template <class TestClass>
10352 class ParameterizedTestFactory : public TestFactoryBase {
10353  public:
10354   typedef typename TestClass::ParamType ParamType;
10355   explicit ParameterizedTestFactory(ParamType parameter) :
10356       parameter_(parameter) {}
10357   virtual Test* CreateTest() {
10358     TestClass::SetParam(&parameter_);
10359     return new TestClass();
10360   }
10361 
10362  private:
10363   const ParamType parameter_;
10364 
10365   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
10366 };
10367 
10368 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10369 //
10370 // TestMetaFactoryBase is a base class for meta-factories that create
10371 // test factories for passing into MakeAndRegisterTestInfo function.
10372 template <class ParamType>
10373 class TestMetaFactoryBase {
10374  public:
10375   virtual ~TestMetaFactoryBase() {}
10376 
10377   virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
10378 };
10379 
10380 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10381 //
10382 // TestMetaFactory creates test factories for passing into
10383 // MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
10384 // ownership of test factory pointer, same factory object cannot be passed
10385 // into that method twice. But ParameterizedTestCaseInfo is going to call
10386 // it for each Test/Parameter value combination. Thus it needs meta factory
10387 // creator class.
10388 template <class TestCase>
10389 class TestMetaFactory
10390     : public TestMetaFactoryBase<typename TestCase::ParamType> {
10391  public:
10392   typedef typename TestCase::ParamType ParamType;
10393 
10394   TestMetaFactory() {}
10395 
10396   virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
10397     return new ParameterizedTestFactory<TestCase>(parameter);
10398   }
10399 
10400  private:
10401   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
10402 };
10403 
10404 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10405 //
10406 // ParameterizedTestCaseInfoBase is a generic interface
10407 // to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
10408 // accumulates test information provided by TEST_P macro invocations
10409 // and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
10410 // and uses that information to register all resulting test instances
10411 // in RegisterTests method. The ParameterizeTestCaseRegistry class holds
10412 // a collection of pointers to the ParameterizedTestCaseInfo objects
10413 // and calls RegisterTests() on each of them when asked.
10414 class ParameterizedTestCaseInfoBase {
10415  public:
10416   virtual ~ParameterizedTestCaseInfoBase() {}
10417 
10418   // Base part of test case name for display purposes.
10419   virtual const string& GetTestCaseName() const = 0;
10420   // Test case id to verify identity.
10421   virtual TypeId GetTestCaseTypeId() const = 0;
10422   // UnitTest class invokes this method to register tests in this
10423   // test case right before running them in RUN_ALL_TESTS macro.
10424   // This method should not be called more then once on any single
10425   // instance of a ParameterizedTestCaseInfoBase derived class.
10426   virtual void RegisterTests() = 0;
10427 
10428  protected:
10429   ParameterizedTestCaseInfoBase() {}
10430 
10431  private:
10432   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
10433 };
10434 
10435 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10436 //
10437 // ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
10438 // macro invocations for a particular test case and generators
10439 // obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
10440 // test case. It registers tests with all values generated by all
10441 // generators when asked.
10442 template <class TestCase>
10443 class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
10444  public:
10445   // ParamType and GeneratorCreationFunc are private types but are required
10446   // for declarations of public methods AddTestPattern() and
10447   // AddTestCaseInstantiation().
10448   typedef typename TestCase::ParamType ParamType;
10449   // A function that returns an instance of appropriate generator type.
10450   typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
10451 
10452   explicit ParameterizedTestCaseInfo(const char* name)
10453       : test_case_name_(name) {}
10454 
10455   // Test case base name for display purposes.
10456   virtual const string& GetTestCaseName() const { return test_case_name_; }
10457   // Test case id to verify identity.
10458   virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
10459   // TEST_P macro uses AddTestPattern() to record information
10460   // about a single test in a LocalTestInfo structure.
10461   // test_case_name is the base name of the test case (without invocation
10462   // prefix). test_base_name is the name of an individual test without
10463   // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
10464   // test case base name and DoBar is test base name.
10465   void AddTestPattern(const char* test_case_name,
10466                       const char* test_base_name,
10467                       TestMetaFactoryBase<ParamType>* meta_factory) {
10468     tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
10469                                                        test_base_name,
10470                                                        meta_factory)));
10471   }
10472   // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
10473   // about a generator.
10474   int AddTestCaseInstantiation(const string& instantiation_name,
10475                                GeneratorCreationFunc* func,
10476                                const char* /* file */,
10477                                int /* line */) {
10478     instantiations_.push_back(::std::make_pair(instantiation_name, func));
10479     return 0;  // Return value used only to run this method in namespace scope.
10480   }
10481   // UnitTest class invokes this method to register tests in this test case
10482   // test cases right before running tests in RUN_ALL_TESTS macro.
10483   // This method should not be called more then once on any single
10484   // instance of a ParameterizedTestCaseInfoBase derived class.
10485   // UnitTest has a guard to prevent from calling this method more then once.
10486   virtual void RegisterTests() {
10487     for (typename TestInfoContainer::iterator test_it = tests_.begin();
10488          test_it != tests_.end(); ++test_it) {
10489       linked_ptr<TestInfo> test_info = *test_it;
10490       for (typename InstantiationContainer::iterator gen_it =
10491                instantiations_.begin(); gen_it != instantiations_.end();
10492                ++gen_it) {
10493         const string& instantiation_name = gen_it->first;
10494         ParamGenerator<ParamType> generator((*gen_it->second)());
10495 
10496         string test_case_name;
10497         if ( !instantiation_name.empty() )
10498           test_case_name = instantiation_name + "/";
10499         test_case_name += test_info->test_case_base_name;
10500 
10501         int i = 0;
10502         for (typename ParamGenerator<ParamType>::iterator param_it =
10503                  generator.begin();
10504              param_it != generator.end(); ++param_it, ++i) {
10505           Message test_name_stream;
10506           test_name_stream << test_info->test_base_name << "/" << i;
10507           MakeAndRegisterTestInfo(
10508               test_case_name.c_str(),
10509               test_name_stream.GetString().c_str(),
10510               NULL,  // No type parameter.
10511               PrintToString(*param_it).c_str(),
10512               GetTestCaseTypeId(),
10513               TestCase::SetUpTestCase,
10514               TestCase::TearDownTestCase,
10515               test_info->test_meta_factory->CreateTestFactory(*param_it));
10516         }  // for param_it
10517       }  // for gen_it
10518     }  // for test_it
10519   }  // RegisterTests
10520 
10521  private:
10522   // LocalTestInfo structure keeps information about a single test registered
10523   // with TEST_P macro.
10524   struct TestInfo {
10525     TestInfo(const char* a_test_case_base_name,
10526              const char* a_test_base_name,
10527              TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
10528         test_case_base_name(a_test_case_base_name),
10529         test_base_name(a_test_base_name),
10530         test_meta_factory(a_test_meta_factory) {}
10531 
10532     const string test_case_base_name;
10533     const string test_base_name;
10534     const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
10535   };
10536   typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
10537   // Keeps pairs of <Instantiation name, Sequence generator creation function>
10538   // received from INSTANTIATE_TEST_CASE_P macros.
10539   typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
10540       InstantiationContainer;
10541 
10542   const string test_case_name_;
10543   TestInfoContainer tests_;
10544   InstantiationContainer instantiations_;
10545 
10546   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
10547 };  // class ParameterizedTestCaseInfo
10548 
10549 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
10550 //
10551 // ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
10552 // classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
10553 // macros use it to locate their corresponding ParameterizedTestCaseInfo
10554 // descriptors.
10555 class ParameterizedTestCaseRegistry {
10556  public:
10557   ParameterizedTestCaseRegistry() {}
10558   ~ParameterizedTestCaseRegistry() {
10559     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10560          it != test_case_infos_.end(); ++it) {
10561       delete *it;
10562     }
10563   }
10564 
10565   // Looks up or creates and returns a structure containing information about
10566   // tests and instantiations of a particular test case.
10567   template <class TestCase>
10568   ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
10569       const char* test_case_name,
10570       const char* file,
10571       int line) {
10572     ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
10573     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10574          it != test_case_infos_.end(); ++it) {
10575       if ((*it)->GetTestCaseName() == test_case_name) {
10576         if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
10577           // Complain about incorrect usage of Google Test facilities
10578           // and terminate the program since we cannot guaranty correct
10579           // test case setup and tear-down in this case.
10580           ReportInvalidTestCaseType(test_case_name,  file, line);
10581           posix::Abort();
10582         } else {
10583           // At this point we are sure that the object we found is of the same
10584           // type we are looking for, so we downcast it to that type
10585           // without further checks.
10586           typed_test_info = CheckedDowncastToActualType<
10587               ParameterizedTestCaseInfo<TestCase> >(*it);
10588         }
10589         break;
10590       }
10591     }
10592     if (typed_test_info == NULL) {
10593       typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
10594       test_case_infos_.push_back(typed_test_info);
10595     }
10596     return typed_test_info;
10597   }
10598   void RegisterTests() {
10599     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
10600          it != test_case_infos_.end(); ++it) {
10601       (*it)->RegisterTests();
10602     }
10603   }
10604 
10605  private:
10606   typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
10607 
10608   TestCaseInfoContainer test_case_infos_;
10609 
10610   GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
10611 };
10612 
10613 }  // namespace internal
10614 }  // namespace testing
10615 
10616 #endif  //  GTEST_HAS_PARAM_TEST
10617 
10618 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
10619 // This file was GENERATED by command:
10620 //     pump.py gtest-param-util-generated.h.pump
10621 // DO NOT EDIT BY HAND!!!
10622 
10623 // Copyright 2008 Google Inc.
10624 // All Rights Reserved.
10625 //
10626 // Redistribution and use in source and binary forms, with or without
10627 // modification, are permitted provided that the following conditions are
10628 // met:
10629 //
10630 //     * Redistributions of source code must retain the above copyright
10631 // notice, this list of conditions and the following disclaimer.
10632 //     * Redistributions in binary form must reproduce the above
10633 // copyright notice, this list of conditions and the following disclaimer
10634 // in the documentation and/or other materials provided with the
10635 // distribution.
10636 //     * Neither the name of Google Inc. nor the names of its
10637 // contributors may be used to endorse or promote products derived from
10638 // this software without specific prior written permission.
10639 //
10640 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10641 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
10642 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
10643 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
10644 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10645 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10646 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10647 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
10648 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
10649 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
10650 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10651 //
10652 // Author: vladl@google.com (Vlad Losev)
10653 
10654 // Type and function utilities for implementing parameterized tests.
10655 // This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
10656 //
10657 // Currently Google Test supports at most 50 arguments in Values,
10658 // and at most 10 arguments in Combine. Please contact
10659 // googletestframework@googlegroups.com if you need more.
10660 // Please note that the number of arguments to Combine is limited
10661 // by the maximum arity of the implementation of tr1::tuple which is
10662 // currently set at 10.
10663 
10664 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10665 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
10666 
10667 // scripts/fuse_gtest.py depends on gtest's own header being #included
10668 // *unconditionally*.  Therefore these #includes cannot be moved
10669 // inside #if GTEST_HAS_PARAM_TEST.
10670 
10671 #if GTEST_HAS_PARAM_TEST
10672 
10673 namespace testing {
10674 
10675 // Forward declarations of ValuesIn(), which is implemented in
10676 // include/gtest/gtest-param-test.h.
10677 template <typename ForwardIterator>
10678 internal::ParamGenerator<
10679   typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
10680 ValuesIn(ForwardIterator begin, ForwardIterator end);
10681 
10682 template <typename T, size_t N>
10683 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
10684 
10685 template <class Container>
10686 internal::ParamGenerator<typename Container::value_type> ValuesIn(
10687     const Container& container);
10688 
10689 namespace internal {
10690 
10691 // Used in the Values() function to provide polymorphic capabilities.
10692 template <typename T1>
10693 class ValueArray1 {
10694  public:
10695   explicit ValueArray1(T1 v1) : v1_(v1) {}
10696 
10697   template <typename T>
10698   operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
10699 
10700  private:
10701   // No implementation - assignment is unsupported.
10702   void operator=(const ValueArray1& other);
10703 
10704   const T1 v1_;
10705 };
10706 
10707 template <typename T1, typename T2>
10708 class ValueArray2 {
10709  public:
10710   ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
10711 
10712   template <typename T>
10713   operator ParamGenerator<T>() const {
10714     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
10715     return ValuesIn(array);
10716   }
10717 
10718  private:
10719   // No implementation - assignment is unsupported.
10720   void operator=(const ValueArray2& other);
10721 
10722   const T1 v1_;
10723   const T2 v2_;
10724 };
10725 
10726 template <typename T1, typename T2, typename T3>
10727 class ValueArray3 {
10728  public:
10729   ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
10730 
10731   template <typename T>
10732   operator ParamGenerator<T>() const {
10733     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10734         static_cast<T>(v3_)};
10735     return ValuesIn(array);
10736   }
10737 
10738  private:
10739   // No implementation - assignment is unsupported.
10740   void operator=(const ValueArray3& other);
10741 
10742   const T1 v1_;
10743   const T2 v2_;
10744   const T3 v3_;
10745 };
10746 
10747 template <typename T1, typename T2, typename T3, typename T4>
10748 class ValueArray4 {
10749  public:
10750   ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
10751       v4_(v4) {}
10752 
10753   template <typename T>
10754   operator ParamGenerator<T>() const {
10755     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10756         static_cast<T>(v3_), static_cast<T>(v4_)};
10757     return ValuesIn(array);
10758   }
10759 
10760  private:
10761   // No implementation - assignment is unsupported.
10762   void operator=(const ValueArray4& other);
10763 
10764   const T1 v1_;
10765   const T2 v2_;
10766   const T3 v3_;
10767   const T4 v4_;
10768 };
10769 
10770 template <typename T1, typename T2, typename T3, typename T4, typename T5>
10771 class ValueArray5 {
10772  public:
10773   ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
10774       v4_(v4), v5_(v5) {}
10775 
10776   template <typename T>
10777   operator ParamGenerator<T>() const {
10778     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10779         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
10780     return ValuesIn(array);
10781   }
10782 
10783  private:
10784   // No implementation - assignment is unsupported.
10785   void operator=(const ValueArray5& other);
10786 
10787   const T1 v1_;
10788   const T2 v2_;
10789   const T3 v3_;
10790   const T4 v4_;
10791   const T5 v5_;
10792 };
10793 
10794 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10795     typename T6>
10796 class ValueArray6 {
10797  public:
10798   ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
10799       v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
10800 
10801   template <typename T>
10802   operator ParamGenerator<T>() const {
10803     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10804         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10805         static_cast<T>(v6_)};
10806     return ValuesIn(array);
10807   }
10808 
10809  private:
10810   // No implementation - assignment is unsupported.
10811   void operator=(const ValueArray6& other);
10812 
10813   const T1 v1_;
10814   const T2 v2_;
10815   const T3 v3_;
10816   const T4 v4_;
10817   const T5 v5_;
10818   const T6 v6_;
10819 };
10820 
10821 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10822     typename T6, typename T7>
10823 class ValueArray7 {
10824  public:
10825   ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
10826       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
10827 
10828   template <typename T>
10829   operator ParamGenerator<T>() const {
10830     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10831         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10832         static_cast<T>(v6_), static_cast<T>(v7_)};
10833     return ValuesIn(array);
10834   }
10835 
10836  private:
10837   // No implementation - assignment is unsupported.
10838   void operator=(const ValueArray7& other);
10839 
10840   const T1 v1_;
10841   const T2 v2_;
10842   const T3 v3_;
10843   const T4 v4_;
10844   const T5 v5_;
10845   const T6 v6_;
10846   const T7 v7_;
10847 };
10848 
10849 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10850     typename T6, typename T7, typename T8>
10851 class ValueArray8 {
10852  public:
10853   ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
10854       T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10855       v8_(v8) {}
10856 
10857   template <typename T>
10858   operator ParamGenerator<T>() const {
10859     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10860         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10861         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
10862     return ValuesIn(array);
10863   }
10864 
10865  private:
10866   // No implementation - assignment is unsupported.
10867   void operator=(const ValueArray8& other);
10868 
10869   const T1 v1_;
10870   const T2 v2_;
10871   const T3 v3_;
10872   const T4 v4_;
10873   const T5 v5_;
10874   const T6 v6_;
10875   const T7 v7_;
10876   const T8 v8_;
10877 };
10878 
10879 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10880     typename T6, typename T7, typename T8, typename T9>
10881 class ValueArray9 {
10882  public:
10883   ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
10884       T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10885       v8_(v8), v9_(v9) {}
10886 
10887   template <typename T>
10888   operator ParamGenerator<T>() const {
10889     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10890         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10891         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10892         static_cast<T>(v9_)};
10893     return ValuesIn(array);
10894   }
10895 
10896  private:
10897   // No implementation - assignment is unsupported.
10898   void operator=(const ValueArray9& other);
10899 
10900   const T1 v1_;
10901   const T2 v2_;
10902   const T3 v3_;
10903   const T4 v4_;
10904   const T5 v5_;
10905   const T6 v6_;
10906   const T7 v7_;
10907   const T8 v8_;
10908   const T9 v9_;
10909 };
10910 
10911 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10912     typename T6, typename T7, typename T8, typename T9, typename T10>
10913 class ValueArray10 {
10914  public:
10915   ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10916       T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
10917       v8_(v8), v9_(v9), v10_(v10) {}
10918 
10919   template <typename T>
10920   operator ParamGenerator<T>() const {
10921     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10922         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10923         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10924         static_cast<T>(v9_), static_cast<T>(v10_)};
10925     return ValuesIn(array);
10926   }
10927 
10928  private:
10929   // No implementation - assignment is unsupported.
10930   void operator=(const ValueArray10& other);
10931 
10932   const T1 v1_;
10933   const T2 v2_;
10934   const T3 v3_;
10935   const T4 v4_;
10936   const T5 v5_;
10937   const T6 v6_;
10938   const T7 v7_;
10939   const T8 v8_;
10940   const T9 v9_;
10941   const T10 v10_;
10942 };
10943 
10944 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10945     typename T6, typename T7, typename T8, typename T9, typename T10,
10946     typename T11>
10947 class ValueArray11 {
10948  public:
10949   ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10950       T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
10951       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
10952 
10953   template <typename T>
10954   operator ParamGenerator<T>() const {
10955     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10956         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10957         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10958         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
10959     return ValuesIn(array);
10960   }
10961 
10962  private:
10963   // No implementation - assignment is unsupported.
10964   void operator=(const ValueArray11& other);
10965 
10966   const T1 v1_;
10967   const T2 v2_;
10968   const T3 v3_;
10969   const T4 v4_;
10970   const T5 v5_;
10971   const T6 v6_;
10972   const T7 v7_;
10973   const T8 v8_;
10974   const T9 v9_;
10975   const T10 v10_;
10976   const T11 v11_;
10977 };
10978 
10979 template <typename T1, typename T2, typename T3, typename T4, typename T5,
10980     typename T6, typename T7, typename T8, typename T9, typename T10,
10981     typename T11, typename T12>
10982 class ValueArray12 {
10983  public:
10984   ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
10985       T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
10986       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
10987 
10988   template <typename T>
10989   operator ParamGenerator<T>() const {
10990     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
10991         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
10992         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
10993         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
10994         static_cast<T>(v12_)};
10995     return ValuesIn(array);
10996   }
10997 
10998  private:
10999   // No implementation - assignment is unsupported.
11000   void operator=(const ValueArray12& other);
11001 
11002   const T1 v1_;
11003   const T2 v2_;
11004   const T3 v3_;
11005   const T4 v4_;
11006   const T5 v5_;
11007   const T6 v6_;
11008   const T7 v7_;
11009   const T8 v8_;
11010   const T9 v9_;
11011   const T10 v10_;
11012   const T11 v11_;
11013   const T12 v12_;
11014 };
11015 
11016 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11017     typename T6, typename T7, typename T8, typename T9, typename T10,
11018     typename T11, typename T12, typename T13>
11019 class ValueArray13 {
11020  public:
11021   ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11022       T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11023       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11024       v12_(v12), v13_(v13) {}
11025 
11026   template <typename T>
11027   operator ParamGenerator<T>() const {
11028     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11029         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11030         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11031         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11032         static_cast<T>(v12_), static_cast<T>(v13_)};
11033     return ValuesIn(array);
11034   }
11035 
11036  private:
11037   // No implementation - assignment is unsupported.
11038   void operator=(const ValueArray13& other);
11039 
11040   const T1 v1_;
11041   const T2 v2_;
11042   const T3 v3_;
11043   const T4 v4_;
11044   const T5 v5_;
11045   const T6 v6_;
11046   const T7 v7_;
11047   const T8 v8_;
11048   const T9 v9_;
11049   const T10 v10_;
11050   const T11 v11_;
11051   const T12 v12_;
11052   const T13 v13_;
11053 };
11054 
11055 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11056     typename T6, typename T7, typename T8, typename T9, typename T10,
11057     typename T11, typename T12, typename T13, typename T14>
11058 class ValueArray14 {
11059  public:
11060   ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11061       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
11062       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11063       v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
11064 
11065   template <typename T>
11066   operator ParamGenerator<T>() const {
11067     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11068         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11069         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11070         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11071         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
11072     return ValuesIn(array);
11073   }
11074 
11075  private:
11076   // No implementation - assignment is unsupported.
11077   void operator=(const ValueArray14& other);
11078 
11079   const T1 v1_;
11080   const T2 v2_;
11081   const T3 v3_;
11082   const T4 v4_;
11083   const T5 v5_;
11084   const T6 v6_;
11085   const T7 v7_;
11086   const T8 v8_;
11087   const T9 v9_;
11088   const T10 v10_;
11089   const T11 v11_;
11090   const T12 v12_;
11091   const T13 v13_;
11092   const T14 v14_;
11093 };
11094 
11095 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11096     typename T6, typename T7, typename T8, typename T9, typename T10,
11097     typename T11, typename T12, typename T13, typename T14, typename T15>
11098 class ValueArray15 {
11099  public:
11100   ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11101       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
11102       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11103       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
11104 
11105   template <typename T>
11106   operator ParamGenerator<T>() const {
11107     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11108         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11109         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11110         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11111         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11112         static_cast<T>(v15_)};
11113     return ValuesIn(array);
11114   }
11115 
11116  private:
11117   // No implementation - assignment is unsupported.
11118   void operator=(const ValueArray15& other);
11119 
11120   const T1 v1_;
11121   const T2 v2_;
11122   const T3 v3_;
11123   const T4 v4_;
11124   const T5 v5_;
11125   const T6 v6_;
11126   const T7 v7_;
11127   const T8 v8_;
11128   const T9 v9_;
11129   const T10 v10_;
11130   const T11 v11_;
11131   const T12 v12_;
11132   const T13 v13_;
11133   const T14 v14_;
11134   const T15 v15_;
11135 };
11136 
11137 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11138     typename T6, typename T7, typename T8, typename T9, typename T10,
11139     typename T11, typename T12, typename T13, typename T14, typename T15,
11140     typename T16>
11141 class ValueArray16 {
11142  public:
11143   ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11144       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
11145       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11146       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11147       v16_(v16) {}
11148 
11149   template <typename T>
11150   operator ParamGenerator<T>() const {
11151     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11152         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11153         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11154         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11155         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11156         static_cast<T>(v15_), static_cast<T>(v16_)};
11157     return ValuesIn(array);
11158   }
11159 
11160  private:
11161   // No implementation - assignment is unsupported.
11162   void operator=(const ValueArray16& other);
11163 
11164   const T1 v1_;
11165   const T2 v2_;
11166   const T3 v3_;
11167   const T4 v4_;
11168   const T5 v5_;
11169   const T6 v6_;
11170   const T7 v7_;
11171   const T8 v8_;
11172   const T9 v9_;
11173   const T10 v10_;
11174   const T11 v11_;
11175   const T12 v12_;
11176   const T13 v13_;
11177   const T14 v14_;
11178   const T15 v15_;
11179   const T16 v16_;
11180 };
11181 
11182 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11183     typename T6, typename T7, typename T8, typename T9, typename T10,
11184     typename T11, typename T12, typename T13, typename T14, typename T15,
11185     typename T16, typename T17>
11186 class ValueArray17 {
11187  public:
11188   ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11189       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
11190       T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11191       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11192       v15_(v15), v16_(v16), v17_(v17) {}
11193 
11194   template <typename T>
11195   operator ParamGenerator<T>() const {
11196     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11197         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11198         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11199         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11200         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11201         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
11202     return ValuesIn(array);
11203   }
11204 
11205  private:
11206   // No implementation - assignment is unsupported.
11207   void operator=(const ValueArray17& other);
11208 
11209   const T1 v1_;
11210   const T2 v2_;
11211   const T3 v3_;
11212   const T4 v4_;
11213   const T5 v5_;
11214   const T6 v6_;
11215   const T7 v7_;
11216   const T8 v8_;
11217   const T9 v9_;
11218   const T10 v10_;
11219   const T11 v11_;
11220   const T12 v12_;
11221   const T13 v13_;
11222   const T14 v14_;
11223   const T15 v15_;
11224   const T16 v16_;
11225   const T17 v17_;
11226 };
11227 
11228 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11229     typename T6, typename T7, typename T8, typename T9, typename T10,
11230     typename T11, typename T12, typename T13, typename T14, typename T15,
11231     typename T16, typename T17, typename T18>
11232 class ValueArray18 {
11233  public:
11234   ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11235       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11236       T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11237       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11238       v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
11239 
11240   template <typename T>
11241   operator ParamGenerator<T>() const {
11242     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11243         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11244         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11245         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11246         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11247         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11248         static_cast<T>(v18_)};
11249     return ValuesIn(array);
11250   }
11251 
11252  private:
11253   // No implementation - assignment is unsupported.
11254   void operator=(const ValueArray18& other);
11255 
11256   const T1 v1_;
11257   const T2 v2_;
11258   const T3 v3_;
11259   const T4 v4_;
11260   const T5 v5_;
11261   const T6 v6_;
11262   const T7 v7_;
11263   const T8 v8_;
11264   const T9 v9_;
11265   const T10 v10_;
11266   const T11 v11_;
11267   const T12 v12_;
11268   const T13 v13_;
11269   const T14 v14_;
11270   const T15 v15_;
11271   const T16 v16_;
11272   const T17 v17_;
11273   const T18 v18_;
11274 };
11275 
11276 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11277     typename T6, typename T7, typename T8, typename T9, typename T10,
11278     typename T11, typename T12, typename T13, typename T14, typename T15,
11279     typename T16, typename T17, typename T18, typename T19>
11280 class ValueArray19 {
11281  public:
11282   ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11283       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11284       T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11285       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11286       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
11287 
11288   template <typename T>
11289   operator ParamGenerator<T>() const {
11290     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11291         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11292         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11293         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11294         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11295         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11296         static_cast<T>(v18_), static_cast<T>(v19_)};
11297     return ValuesIn(array);
11298   }
11299 
11300  private:
11301   // No implementation - assignment is unsupported.
11302   void operator=(const ValueArray19& other);
11303 
11304   const T1 v1_;
11305   const T2 v2_;
11306   const T3 v3_;
11307   const T4 v4_;
11308   const T5 v5_;
11309   const T6 v6_;
11310   const T7 v7_;
11311   const T8 v8_;
11312   const T9 v9_;
11313   const T10 v10_;
11314   const T11 v11_;
11315   const T12 v12_;
11316   const T13 v13_;
11317   const T14 v14_;
11318   const T15 v15_;
11319   const T16 v16_;
11320   const T17 v17_;
11321   const T18 v18_;
11322   const T19 v19_;
11323 };
11324 
11325 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11326     typename T6, typename T7, typename T8, typename T9, typename T10,
11327     typename T11, typename T12, typename T13, typename T14, typename T15,
11328     typename T16, typename T17, typename T18, typename T19, typename T20>
11329 class ValueArray20 {
11330  public:
11331   ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11332       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11333       T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11334       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11335       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11336       v19_(v19), v20_(v20) {}
11337 
11338   template <typename T>
11339   operator ParamGenerator<T>() const {
11340     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11341         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11342         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11343         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11344         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11345         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11346         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
11347     return ValuesIn(array);
11348   }
11349 
11350  private:
11351   // No implementation - assignment is unsupported.
11352   void operator=(const ValueArray20& other);
11353 
11354   const T1 v1_;
11355   const T2 v2_;
11356   const T3 v3_;
11357   const T4 v4_;
11358   const T5 v5_;
11359   const T6 v6_;
11360   const T7 v7_;
11361   const T8 v8_;
11362   const T9 v9_;
11363   const T10 v10_;
11364   const T11 v11_;
11365   const T12 v12_;
11366   const T13 v13_;
11367   const T14 v14_;
11368   const T15 v15_;
11369   const T16 v16_;
11370   const T17 v17_;
11371   const T18 v18_;
11372   const T19 v19_;
11373   const T20 v20_;
11374 };
11375 
11376 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11377     typename T6, typename T7, typename T8, typename T9, typename T10,
11378     typename T11, typename T12, typename T13, typename T14, typename T15,
11379     typename T16, typename T17, typename T18, typename T19, typename T20,
11380     typename T21>
11381 class ValueArray21 {
11382  public:
11383   ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11384       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11385       T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11386       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11387       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11388       v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
11389 
11390   template <typename T>
11391   operator ParamGenerator<T>() const {
11392     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11393         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11394         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11395         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11396         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11397         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11398         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11399         static_cast<T>(v21_)};
11400     return ValuesIn(array);
11401   }
11402 
11403  private:
11404   // No implementation - assignment is unsupported.
11405   void operator=(const ValueArray21& other);
11406 
11407   const T1 v1_;
11408   const T2 v2_;
11409   const T3 v3_;
11410   const T4 v4_;
11411   const T5 v5_;
11412   const T6 v6_;
11413   const T7 v7_;
11414   const T8 v8_;
11415   const T9 v9_;
11416   const T10 v10_;
11417   const T11 v11_;
11418   const T12 v12_;
11419   const T13 v13_;
11420   const T14 v14_;
11421   const T15 v15_;
11422   const T16 v16_;
11423   const T17 v17_;
11424   const T18 v18_;
11425   const T19 v19_;
11426   const T20 v20_;
11427   const T21 v21_;
11428 };
11429 
11430 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11431     typename T6, typename T7, typename T8, typename T9, typename T10,
11432     typename T11, typename T12, typename T13, typename T14, typename T15,
11433     typename T16, typename T17, typename T18, typename T19, typename T20,
11434     typename T21, typename T22>
11435 class ValueArray22 {
11436  public:
11437   ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11438       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11439       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
11440       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11441       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11442       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
11443 
11444   template <typename T>
11445   operator ParamGenerator<T>() const {
11446     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11447         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11448         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11449         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11450         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11451         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11452         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11453         static_cast<T>(v21_), static_cast<T>(v22_)};
11454     return ValuesIn(array);
11455   }
11456 
11457  private:
11458   // No implementation - assignment is unsupported.
11459   void operator=(const ValueArray22& other);
11460 
11461   const T1 v1_;
11462   const T2 v2_;
11463   const T3 v3_;
11464   const T4 v4_;
11465   const T5 v5_;
11466   const T6 v6_;
11467   const T7 v7_;
11468   const T8 v8_;
11469   const T9 v9_;
11470   const T10 v10_;
11471   const T11 v11_;
11472   const T12 v12_;
11473   const T13 v13_;
11474   const T14 v14_;
11475   const T15 v15_;
11476   const T16 v16_;
11477   const T17 v17_;
11478   const T18 v18_;
11479   const T19 v19_;
11480   const T20 v20_;
11481   const T21 v21_;
11482   const T22 v22_;
11483 };
11484 
11485 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11486     typename T6, typename T7, typename T8, typename T9, typename T10,
11487     typename T11, typename T12, typename T13, typename T14, typename T15,
11488     typename T16, typename T17, typename T18, typename T19, typename T20,
11489     typename T21, typename T22, typename T23>
11490 class ValueArray23 {
11491  public:
11492   ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11493       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11494       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
11495       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11496       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11497       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11498       v23_(v23) {}
11499 
11500   template <typename T>
11501   operator ParamGenerator<T>() const {
11502     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11503         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11504         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11505         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11506         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11507         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11508         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11509         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
11510     return ValuesIn(array);
11511   }
11512 
11513  private:
11514   // No implementation - assignment is unsupported.
11515   void operator=(const ValueArray23& other);
11516 
11517   const T1 v1_;
11518   const T2 v2_;
11519   const T3 v3_;
11520   const T4 v4_;
11521   const T5 v5_;
11522   const T6 v6_;
11523   const T7 v7_;
11524   const T8 v8_;
11525   const T9 v9_;
11526   const T10 v10_;
11527   const T11 v11_;
11528   const T12 v12_;
11529   const T13 v13_;
11530   const T14 v14_;
11531   const T15 v15_;
11532   const T16 v16_;
11533   const T17 v17_;
11534   const T18 v18_;
11535   const T19 v19_;
11536   const T20 v20_;
11537   const T21 v21_;
11538   const T22 v22_;
11539   const T23 v23_;
11540 };
11541 
11542 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11543     typename T6, typename T7, typename T8, typename T9, typename T10,
11544     typename T11, typename T12, typename T13, typename T14, typename T15,
11545     typename T16, typename T17, typename T18, typename T19, typename T20,
11546     typename T21, typename T22, typename T23, typename T24>
11547 class ValueArray24 {
11548  public:
11549   ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11550       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11551       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
11552       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
11553       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
11554       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
11555       v22_(v22), v23_(v23), v24_(v24) {}
11556 
11557   template <typename T>
11558   operator ParamGenerator<T>() const {
11559     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11560         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11561         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11562         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11563         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11564         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11565         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11566         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11567         static_cast<T>(v24_)};
11568     return ValuesIn(array);
11569   }
11570 
11571  private:
11572   // No implementation - assignment is unsupported.
11573   void operator=(const ValueArray24& other);
11574 
11575   const T1 v1_;
11576   const T2 v2_;
11577   const T3 v3_;
11578   const T4 v4_;
11579   const T5 v5_;
11580   const T6 v6_;
11581   const T7 v7_;
11582   const T8 v8_;
11583   const T9 v9_;
11584   const T10 v10_;
11585   const T11 v11_;
11586   const T12 v12_;
11587   const T13 v13_;
11588   const T14 v14_;
11589   const T15 v15_;
11590   const T16 v16_;
11591   const T17 v17_;
11592   const T18 v18_;
11593   const T19 v19_;
11594   const T20 v20_;
11595   const T21 v21_;
11596   const T22 v22_;
11597   const T23 v23_;
11598   const T24 v24_;
11599 };
11600 
11601 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11602     typename T6, typename T7, typename T8, typename T9, typename T10,
11603     typename T11, typename T12, typename T13, typename T14, typename T15,
11604     typename T16, typename T17, typename T18, typename T19, typename T20,
11605     typename T21, typename T22, typename T23, typename T24, typename T25>
11606 class ValueArray25 {
11607  public:
11608   ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11609       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11610       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
11611       T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11612       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11613       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11614       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
11615 
11616   template <typename T>
11617   operator ParamGenerator<T>() const {
11618     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11619         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11620         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11621         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11622         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11623         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11624         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11625         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11626         static_cast<T>(v24_), static_cast<T>(v25_)};
11627     return ValuesIn(array);
11628   }
11629 
11630  private:
11631   // No implementation - assignment is unsupported.
11632   void operator=(const ValueArray25& other);
11633 
11634   const T1 v1_;
11635   const T2 v2_;
11636   const T3 v3_;
11637   const T4 v4_;
11638   const T5 v5_;
11639   const T6 v6_;
11640   const T7 v7_;
11641   const T8 v8_;
11642   const T9 v9_;
11643   const T10 v10_;
11644   const T11 v11_;
11645   const T12 v12_;
11646   const T13 v13_;
11647   const T14 v14_;
11648   const T15 v15_;
11649   const T16 v16_;
11650   const T17 v17_;
11651   const T18 v18_;
11652   const T19 v19_;
11653   const T20 v20_;
11654   const T21 v21_;
11655   const T22 v22_;
11656   const T23 v23_;
11657   const T24 v24_;
11658   const T25 v25_;
11659 };
11660 
11661 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11662     typename T6, typename T7, typename T8, typename T9, typename T10,
11663     typename T11, typename T12, typename T13, typename T14, typename T15,
11664     typename T16, typename T17, typename T18, typename T19, typename T20,
11665     typename T21, typename T22, typename T23, typename T24, typename T25,
11666     typename T26>
11667 class ValueArray26 {
11668  public:
11669   ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11670       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11671       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11672       T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
11673       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
11674       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
11675       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
11676 
11677   template <typename T>
11678   operator ParamGenerator<T>() const {
11679     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11680         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11681         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11682         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11683         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11684         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11685         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11686         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11687         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
11688     return ValuesIn(array);
11689   }
11690 
11691  private:
11692   // No implementation - assignment is unsupported.
11693   void operator=(const ValueArray26& other);
11694 
11695   const T1 v1_;
11696   const T2 v2_;
11697   const T3 v3_;
11698   const T4 v4_;
11699   const T5 v5_;
11700   const T6 v6_;
11701   const T7 v7_;
11702   const T8 v8_;
11703   const T9 v9_;
11704   const T10 v10_;
11705   const T11 v11_;
11706   const T12 v12_;
11707   const T13 v13_;
11708   const T14 v14_;
11709   const T15 v15_;
11710   const T16 v16_;
11711   const T17 v17_;
11712   const T18 v18_;
11713   const T19 v19_;
11714   const T20 v20_;
11715   const T21 v21_;
11716   const T22 v22_;
11717   const T23 v23_;
11718   const T24 v24_;
11719   const T25 v25_;
11720   const T26 v26_;
11721 };
11722 
11723 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11724     typename T6, typename T7, typename T8, typename T9, typename T10,
11725     typename T11, typename T12, typename T13, typename T14, typename T15,
11726     typename T16, typename T17, typename T18, typename T19, typename T20,
11727     typename T21, typename T22, typename T23, typename T24, typename T25,
11728     typename T26, typename T27>
11729 class ValueArray27 {
11730  public:
11731   ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11732       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11733       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11734       T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
11735       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
11736       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
11737       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
11738       v26_(v26), v27_(v27) {}
11739 
11740   template <typename T>
11741   operator ParamGenerator<T>() const {
11742     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11743         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11744         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11745         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11746         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11747         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11748         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11749         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11750         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11751         static_cast<T>(v27_)};
11752     return ValuesIn(array);
11753   }
11754 
11755  private:
11756   // No implementation - assignment is unsupported.
11757   void operator=(const ValueArray27& other);
11758 
11759   const T1 v1_;
11760   const T2 v2_;
11761   const T3 v3_;
11762   const T4 v4_;
11763   const T5 v5_;
11764   const T6 v6_;
11765   const T7 v7_;
11766   const T8 v8_;
11767   const T9 v9_;
11768   const T10 v10_;
11769   const T11 v11_;
11770   const T12 v12_;
11771   const T13 v13_;
11772   const T14 v14_;
11773   const T15 v15_;
11774   const T16 v16_;
11775   const T17 v17_;
11776   const T18 v18_;
11777   const T19 v19_;
11778   const T20 v20_;
11779   const T21 v21_;
11780   const T22 v22_;
11781   const T23 v23_;
11782   const T24 v24_;
11783   const T25 v25_;
11784   const T26 v26_;
11785   const T27 v27_;
11786 };
11787 
11788 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11789     typename T6, typename T7, typename T8, typename T9, typename T10,
11790     typename T11, typename T12, typename T13, typename T14, typename T15,
11791     typename T16, typename T17, typename T18, typename T19, typename T20,
11792     typename T21, typename T22, typename T23, typename T24, typename T25,
11793     typename T26, typename T27, typename T28>
11794 class ValueArray28 {
11795  public:
11796   ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11797       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11798       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11799       T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
11800       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
11801       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
11802       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
11803       v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
11804 
11805   template <typename T>
11806   operator ParamGenerator<T>() const {
11807     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11808         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11809         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11810         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11811         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11812         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11813         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11814         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11815         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11816         static_cast<T>(v27_), static_cast<T>(v28_)};
11817     return ValuesIn(array);
11818   }
11819 
11820  private:
11821   // No implementation - assignment is unsupported.
11822   void operator=(const ValueArray28& other);
11823 
11824   const T1 v1_;
11825   const T2 v2_;
11826   const T3 v3_;
11827   const T4 v4_;
11828   const T5 v5_;
11829   const T6 v6_;
11830   const T7 v7_;
11831   const T8 v8_;
11832   const T9 v9_;
11833   const T10 v10_;
11834   const T11 v11_;
11835   const T12 v12_;
11836   const T13 v13_;
11837   const T14 v14_;
11838   const T15 v15_;
11839   const T16 v16_;
11840   const T17 v17_;
11841   const T18 v18_;
11842   const T19 v19_;
11843   const T20 v20_;
11844   const T21 v21_;
11845   const T22 v22_;
11846   const T23 v23_;
11847   const T24 v24_;
11848   const T25 v25_;
11849   const T26 v26_;
11850   const T27 v27_;
11851   const T28 v28_;
11852 };
11853 
11854 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11855     typename T6, typename T7, typename T8, typename T9, typename T10,
11856     typename T11, typename T12, typename T13, typename T14, typename T15,
11857     typename T16, typename T17, typename T18, typename T19, typename T20,
11858     typename T21, typename T22, typename T23, typename T24, typename T25,
11859     typename T26, typename T27, typename T28, typename T29>
11860 class ValueArray29 {
11861  public:
11862   ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11863       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11864       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11865       T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
11866       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
11867       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
11868       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
11869       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
11870 
11871   template <typename T>
11872   operator ParamGenerator<T>() const {
11873     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11874         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11875         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11876         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11877         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11878         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11879         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11880         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11881         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11882         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
11883     return ValuesIn(array);
11884   }
11885 
11886  private:
11887   // No implementation - assignment is unsupported.
11888   void operator=(const ValueArray29& other);
11889 
11890   const T1 v1_;
11891   const T2 v2_;
11892   const T3 v3_;
11893   const T4 v4_;
11894   const T5 v5_;
11895   const T6 v6_;
11896   const T7 v7_;
11897   const T8 v8_;
11898   const T9 v9_;
11899   const T10 v10_;
11900   const T11 v11_;
11901   const T12 v12_;
11902   const T13 v13_;
11903   const T14 v14_;
11904   const T15 v15_;
11905   const T16 v16_;
11906   const T17 v17_;
11907   const T18 v18_;
11908   const T19 v19_;
11909   const T20 v20_;
11910   const T21 v21_;
11911   const T22 v22_;
11912   const T23 v23_;
11913   const T24 v24_;
11914   const T25 v25_;
11915   const T26 v26_;
11916   const T27 v27_;
11917   const T28 v28_;
11918   const T29 v29_;
11919 };
11920 
11921 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11922     typename T6, typename T7, typename T8, typename T9, typename T10,
11923     typename T11, typename T12, typename T13, typename T14, typename T15,
11924     typename T16, typename T17, typename T18, typename T19, typename T20,
11925     typename T21, typename T22, typename T23, typename T24, typename T25,
11926     typename T26, typename T27, typename T28, typename T29, typename T30>
11927 class ValueArray30 {
11928  public:
11929   ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
11930       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
11931       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
11932       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
11933       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
11934       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
11935       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
11936       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
11937       v29_(v29), v30_(v30) {}
11938 
11939   template <typename T>
11940   operator ParamGenerator<T>() const {
11941     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
11942         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
11943         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
11944         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
11945         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
11946         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
11947         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
11948         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
11949         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
11950         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
11951         static_cast<T>(v30_)};
11952     return ValuesIn(array);
11953   }
11954 
11955  private:
11956   // No implementation - assignment is unsupported.
11957   void operator=(const ValueArray30& other);
11958 
11959   const T1 v1_;
11960   const T2 v2_;
11961   const T3 v3_;
11962   const T4 v4_;
11963   const T5 v5_;
11964   const T6 v6_;
11965   const T7 v7_;
11966   const T8 v8_;
11967   const T9 v9_;
11968   const T10 v10_;
11969   const T11 v11_;
11970   const T12 v12_;
11971   const T13 v13_;
11972   const T14 v14_;
11973   const T15 v15_;
11974   const T16 v16_;
11975   const T17 v17_;
11976   const T18 v18_;
11977   const T19 v19_;
11978   const T20 v20_;
11979   const T21 v21_;
11980   const T22 v22_;
11981   const T23 v23_;
11982   const T24 v24_;
11983   const T25 v25_;
11984   const T26 v26_;
11985   const T27 v27_;
11986   const T28 v28_;
11987   const T29 v29_;
11988   const T30 v30_;
11989 };
11990 
11991 template <typename T1, typename T2, typename T3, typename T4, typename T5,
11992     typename T6, typename T7, typename T8, typename T9, typename T10,
11993     typename T11, typename T12, typename T13, typename T14, typename T15,
11994     typename T16, typename T17, typename T18, typename T19, typename T20,
11995     typename T21, typename T22, typename T23, typename T24, typename T25,
11996     typename T26, typename T27, typename T28, typename T29, typename T30,
11997     typename T31>
11998 class ValueArray31 {
11999  public:
12000   ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12001       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12002       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12003       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
12004       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12005       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12006       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12007       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12008       v29_(v29), v30_(v30), v31_(v31) {}
12009 
12010   template <typename T>
12011   operator ParamGenerator<T>() const {
12012     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12013         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12014         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12015         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12016         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12017         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12018         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12019         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12020         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12021         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12022         static_cast<T>(v30_), static_cast<T>(v31_)};
12023     return ValuesIn(array);
12024   }
12025 
12026  private:
12027   // No implementation - assignment is unsupported.
12028   void operator=(const ValueArray31& other);
12029 
12030   const T1 v1_;
12031   const T2 v2_;
12032   const T3 v3_;
12033   const T4 v4_;
12034   const T5 v5_;
12035   const T6 v6_;
12036   const T7 v7_;
12037   const T8 v8_;
12038   const T9 v9_;
12039   const T10 v10_;
12040   const T11 v11_;
12041   const T12 v12_;
12042   const T13 v13_;
12043   const T14 v14_;
12044   const T15 v15_;
12045   const T16 v16_;
12046   const T17 v17_;
12047   const T18 v18_;
12048   const T19 v19_;
12049   const T20 v20_;
12050   const T21 v21_;
12051   const T22 v22_;
12052   const T23 v23_;
12053   const T24 v24_;
12054   const T25 v25_;
12055   const T26 v26_;
12056   const T27 v27_;
12057   const T28 v28_;
12058   const T29 v29_;
12059   const T30 v30_;
12060   const T31 v31_;
12061 };
12062 
12063 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12064     typename T6, typename T7, typename T8, typename T9, typename T10,
12065     typename T11, typename T12, typename T13, typename T14, typename T15,
12066     typename T16, typename T17, typename T18, typename T19, typename T20,
12067     typename T21, typename T22, typename T23, typename T24, typename T25,
12068     typename T26, typename T27, typename T28, typename T29, typename T30,
12069     typename T31, typename T32>
12070 class ValueArray32 {
12071  public:
12072   ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12073       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12074       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12075       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
12076       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12077       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12078       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12079       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12080       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
12081 
12082   template <typename T>
12083   operator ParamGenerator<T>() const {
12084     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12085         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12086         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12087         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12088         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12089         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12090         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12091         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12092         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12093         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12094         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
12095     return ValuesIn(array);
12096   }
12097 
12098  private:
12099   // No implementation - assignment is unsupported.
12100   void operator=(const ValueArray32& other);
12101 
12102   const T1 v1_;
12103   const T2 v2_;
12104   const T3 v3_;
12105   const T4 v4_;
12106   const T5 v5_;
12107   const T6 v6_;
12108   const T7 v7_;
12109   const T8 v8_;
12110   const T9 v9_;
12111   const T10 v10_;
12112   const T11 v11_;
12113   const T12 v12_;
12114   const T13 v13_;
12115   const T14 v14_;
12116   const T15 v15_;
12117   const T16 v16_;
12118   const T17 v17_;
12119   const T18 v18_;
12120   const T19 v19_;
12121   const T20 v20_;
12122   const T21 v21_;
12123   const T22 v22_;
12124   const T23 v23_;
12125   const T24 v24_;
12126   const T25 v25_;
12127   const T26 v26_;
12128   const T27 v27_;
12129   const T28 v28_;
12130   const T29 v29_;
12131   const T30 v30_;
12132   const T31 v31_;
12133   const T32 v32_;
12134 };
12135 
12136 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12137     typename T6, typename T7, typename T8, typename T9, typename T10,
12138     typename T11, typename T12, typename T13, typename T14, typename T15,
12139     typename T16, typename T17, typename T18, typename T19, typename T20,
12140     typename T21, typename T22, typename T23, typename T24, typename T25,
12141     typename T26, typename T27, typename T28, typename T29, typename T30,
12142     typename T31, typename T32, typename T33>
12143 class ValueArray33 {
12144  public:
12145   ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12146       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12147       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12148       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
12149       T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12150       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12151       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12152       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12153       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12154       v33_(v33) {}
12155 
12156   template <typename T>
12157   operator ParamGenerator<T>() const {
12158     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12159         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12160         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12161         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12162         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12163         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12164         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12165         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12166         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12167         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12168         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12169         static_cast<T>(v33_)};
12170     return ValuesIn(array);
12171   }
12172 
12173  private:
12174   // No implementation - assignment is unsupported.
12175   void operator=(const ValueArray33& other);
12176 
12177   const T1 v1_;
12178   const T2 v2_;
12179   const T3 v3_;
12180   const T4 v4_;
12181   const T5 v5_;
12182   const T6 v6_;
12183   const T7 v7_;
12184   const T8 v8_;
12185   const T9 v9_;
12186   const T10 v10_;
12187   const T11 v11_;
12188   const T12 v12_;
12189   const T13 v13_;
12190   const T14 v14_;
12191   const T15 v15_;
12192   const T16 v16_;
12193   const T17 v17_;
12194   const T18 v18_;
12195   const T19 v19_;
12196   const T20 v20_;
12197   const T21 v21_;
12198   const T22 v22_;
12199   const T23 v23_;
12200   const T24 v24_;
12201   const T25 v25_;
12202   const T26 v26_;
12203   const T27 v27_;
12204   const T28 v28_;
12205   const T29 v29_;
12206   const T30 v30_;
12207   const T31 v31_;
12208   const T32 v32_;
12209   const T33 v33_;
12210 };
12211 
12212 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12213     typename T6, typename T7, typename T8, typename T9, typename T10,
12214     typename T11, typename T12, typename T13, typename T14, typename T15,
12215     typename T16, typename T17, typename T18, typename T19, typename T20,
12216     typename T21, typename T22, typename T23, typename T24, typename T25,
12217     typename T26, typename T27, typename T28, typename T29, typename T30,
12218     typename T31, typename T32, typename T33, typename T34>
12219 class ValueArray34 {
12220  public:
12221   ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12222       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12223       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12224       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12225       T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12226       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12227       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12228       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12229       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12230       v33_(v33), v34_(v34) {}
12231 
12232   template <typename T>
12233   operator ParamGenerator<T>() const {
12234     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12235         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12236         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12237         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12238         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12239         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12240         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12241         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12242         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12243         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12244         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12245         static_cast<T>(v33_), static_cast<T>(v34_)};
12246     return ValuesIn(array);
12247   }
12248 
12249  private:
12250   // No implementation - assignment is unsupported.
12251   void operator=(const ValueArray34& other);
12252 
12253   const T1 v1_;
12254   const T2 v2_;
12255   const T3 v3_;
12256   const T4 v4_;
12257   const T5 v5_;
12258   const T6 v6_;
12259   const T7 v7_;
12260   const T8 v8_;
12261   const T9 v9_;
12262   const T10 v10_;
12263   const T11 v11_;
12264   const T12 v12_;
12265   const T13 v13_;
12266   const T14 v14_;
12267   const T15 v15_;
12268   const T16 v16_;
12269   const T17 v17_;
12270   const T18 v18_;
12271   const T19 v19_;
12272   const T20 v20_;
12273   const T21 v21_;
12274   const T22 v22_;
12275   const T23 v23_;
12276   const T24 v24_;
12277   const T25 v25_;
12278   const T26 v26_;
12279   const T27 v27_;
12280   const T28 v28_;
12281   const T29 v29_;
12282   const T30 v30_;
12283   const T31 v31_;
12284   const T32 v32_;
12285   const T33 v33_;
12286   const T34 v34_;
12287 };
12288 
12289 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12290     typename T6, typename T7, typename T8, typename T9, typename T10,
12291     typename T11, typename T12, typename T13, typename T14, typename T15,
12292     typename T16, typename T17, typename T18, typename T19, typename T20,
12293     typename T21, typename T22, typename T23, typename T24, typename T25,
12294     typename T26, typename T27, typename T28, typename T29, typename T30,
12295     typename T31, typename T32, typename T33, typename T34, typename T35>
12296 class ValueArray35 {
12297  public:
12298   ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12299       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12300       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12301       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12302       T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12303       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12304       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12305       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12306       v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12307       v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
12308 
12309   template <typename T>
12310   operator ParamGenerator<T>() const {
12311     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12312         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12313         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12314         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12315         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12316         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12317         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12318         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12319         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12320         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12321         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12322         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
12323     return ValuesIn(array);
12324   }
12325 
12326  private:
12327   // No implementation - assignment is unsupported.
12328   void operator=(const ValueArray35& other);
12329 
12330   const T1 v1_;
12331   const T2 v2_;
12332   const T3 v3_;
12333   const T4 v4_;
12334   const T5 v5_;
12335   const T6 v6_;
12336   const T7 v7_;
12337   const T8 v8_;
12338   const T9 v9_;
12339   const T10 v10_;
12340   const T11 v11_;
12341   const T12 v12_;
12342   const T13 v13_;
12343   const T14 v14_;
12344   const T15 v15_;
12345   const T16 v16_;
12346   const T17 v17_;
12347   const T18 v18_;
12348   const T19 v19_;
12349   const T20 v20_;
12350   const T21 v21_;
12351   const T22 v22_;
12352   const T23 v23_;
12353   const T24 v24_;
12354   const T25 v25_;
12355   const T26 v26_;
12356   const T27 v27_;
12357   const T28 v28_;
12358   const T29 v29_;
12359   const T30 v30_;
12360   const T31 v31_;
12361   const T32 v32_;
12362   const T33 v33_;
12363   const T34 v34_;
12364   const T35 v35_;
12365 };
12366 
12367 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12368     typename T6, typename T7, typename T8, typename T9, typename T10,
12369     typename T11, typename T12, typename T13, typename T14, typename T15,
12370     typename T16, typename T17, typename T18, typename T19, typename T20,
12371     typename T21, typename T22, typename T23, typename T24, typename T25,
12372     typename T26, typename T27, typename T28, typename T29, typename T30,
12373     typename T31, typename T32, typename T33, typename T34, typename T35,
12374     typename T36>
12375 class ValueArray36 {
12376  public:
12377   ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12378       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12379       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12380       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12381       T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
12382       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
12383       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
12384       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
12385       v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
12386       v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
12387 
12388   template <typename T>
12389   operator ParamGenerator<T>() const {
12390     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12391         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12392         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12393         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12394         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12395         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12396         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12397         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12398         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12399         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12400         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12401         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12402         static_cast<T>(v36_)};
12403     return ValuesIn(array);
12404   }
12405 
12406  private:
12407   // No implementation - assignment is unsupported.
12408   void operator=(const ValueArray36& other);
12409 
12410   const T1 v1_;
12411   const T2 v2_;
12412   const T3 v3_;
12413   const T4 v4_;
12414   const T5 v5_;
12415   const T6 v6_;
12416   const T7 v7_;
12417   const T8 v8_;
12418   const T9 v9_;
12419   const T10 v10_;
12420   const T11 v11_;
12421   const T12 v12_;
12422   const T13 v13_;
12423   const T14 v14_;
12424   const T15 v15_;
12425   const T16 v16_;
12426   const T17 v17_;
12427   const T18 v18_;
12428   const T19 v19_;
12429   const T20 v20_;
12430   const T21 v21_;
12431   const T22 v22_;
12432   const T23 v23_;
12433   const T24 v24_;
12434   const T25 v25_;
12435   const T26 v26_;
12436   const T27 v27_;
12437   const T28 v28_;
12438   const T29 v29_;
12439   const T30 v30_;
12440   const T31 v31_;
12441   const T32 v32_;
12442   const T33 v33_;
12443   const T34 v34_;
12444   const T35 v35_;
12445   const T36 v36_;
12446 };
12447 
12448 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12449     typename T6, typename T7, typename T8, typename T9, typename T10,
12450     typename T11, typename T12, typename T13, typename T14, typename T15,
12451     typename T16, typename T17, typename T18, typename T19, typename T20,
12452     typename T21, typename T22, typename T23, typename T24, typename T25,
12453     typename T26, typename T27, typename T28, typename T29, typename T30,
12454     typename T31, typename T32, typename T33, typename T34, typename T35,
12455     typename T36, typename T37>
12456 class ValueArray37 {
12457  public:
12458   ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12459       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12460       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12461       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12462       T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
12463       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
12464       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
12465       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
12466       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
12467       v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
12468       v36_(v36), v37_(v37) {}
12469 
12470   template <typename T>
12471   operator ParamGenerator<T>() const {
12472     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12473         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12474         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12475         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12476         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12477         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12478         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12479         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12480         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12481         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12482         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12483         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12484         static_cast<T>(v36_), static_cast<T>(v37_)};
12485     return ValuesIn(array);
12486   }
12487 
12488  private:
12489   // No implementation - assignment is unsupported.
12490   void operator=(const ValueArray37& other);
12491 
12492   const T1 v1_;
12493   const T2 v2_;
12494   const T3 v3_;
12495   const T4 v4_;
12496   const T5 v5_;
12497   const T6 v6_;
12498   const T7 v7_;
12499   const T8 v8_;
12500   const T9 v9_;
12501   const T10 v10_;
12502   const T11 v11_;
12503   const T12 v12_;
12504   const T13 v13_;
12505   const T14 v14_;
12506   const T15 v15_;
12507   const T16 v16_;
12508   const T17 v17_;
12509   const T18 v18_;
12510   const T19 v19_;
12511   const T20 v20_;
12512   const T21 v21_;
12513   const T22 v22_;
12514   const T23 v23_;
12515   const T24 v24_;
12516   const T25 v25_;
12517   const T26 v26_;
12518   const T27 v27_;
12519   const T28 v28_;
12520   const T29 v29_;
12521   const T30 v30_;
12522   const T31 v31_;
12523   const T32 v32_;
12524   const T33 v33_;
12525   const T34 v34_;
12526   const T35 v35_;
12527   const T36 v36_;
12528   const T37 v37_;
12529 };
12530 
12531 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12532     typename T6, typename T7, typename T8, typename T9, typename T10,
12533     typename T11, typename T12, typename T13, typename T14, typename T15,
12534     typename T16, typename T17, typename T18, typename T19, typename T20,
12535     typename T21, typename T22, typename T23, typename T24, typename T25,
12536     typename T26, typename T27, typename T28, typename T29, typename T30,
12537     typename T31, typename T32, typename T33, typename T34, typename T35,
12538     typename T36, typename T37, typename T38>
12539 class ValueArray38 {
12540  public:
12541   ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12542       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12543       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12544       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12545       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
12546       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12547       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12548       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12549       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12550       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12551       v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
12552 
12553   template <typename T>
12554   operator ParamGenerator<T>() const {
12555     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12556         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12557         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12558         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12559         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12560         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12561         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12562         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12563         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12564         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12565         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12566         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12567         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
12568     return ValuesIn(array);
12569   }
12570 
12571  private:
12572   // No implementation - assignment is unsupported.
12573   void operator=(const ValueArray38& other);
12574 
12575   const T1 v1_;
12576   const T2 v2_;
12577   const T3 v3_;
12578   const T4 v4_;
12579   const T5 v5_;
12580   const T6 v6_;
12581   const T7 v7_;
12582   const T8 v8_;
12583   const T9 v9_;
12584   const T10 v10_;
12585   const T11 v11_;
12586   const T12 v12_;
12587   const T13 v13_;
12588   const T14 v14_;
12589   const T15 v15_;
12590   const T16 v16_;
12591   const T17 v17_;
12592   const T18 v18_;
12593   const T19 v19_;
12594   const T20 v20_;
12595   const T21 v21_;
12596   const T22 v22_;
12597   const T23 v23_;
12598   const T24 v24_;
12599   const T25 v25_;
12600   const T26 v26_;
12601   const T27 v27_;
12602   const T28 v28_;
12603   const T29 v29_;
12604   const T30 v30_;
12605   const T31 v31_;
12606   const T32 v32_;
12607   const T33 v33_;
12608   const T34 v34_;
12609   const T35 v35_;
12610   const T36 v36_;
12611   const T37 v37_;
12612   const T38 v38_;
12613 };
12614 
12615 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12616     typename T6, typename T7, typename T8, typename T9, typename T10,
12617     typename T11, typename T12, typename T13, typename T14, typename T15,
12618     typename T16, typename T17, typename T18, typename T19, typename T20,
12619     typename T21, typename T22, typename T23, typename T24, typename T25,
12620     typename T26, typename T27, typename T28, typename T29, typename T30,
12621     typename T31, typename T32, typename T33, typename T34, typename T35,
12622     typename T36, typename T37, typename T38, typename T39>
12623 class ValueArray39 {
12624  public:
12625   ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12626       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12627       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12628       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12629       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
12630       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
12631       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
12632       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
12633       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
12634       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
12635       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
12636 
12637   template <typename T>
12638   operator ParamGenerator<T>() const {
12639     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12640         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12641         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12642         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12643         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12644         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12645         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12646         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12647         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12648         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12649         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12650         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12651         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12652         static_cast<T>(v39_)};
12653     return ValuesIn(array);
12654   }
12655 
12656  private:
12657   // No implementation - assignment is unsupported.
12658   void operator=(const ValueArray39& other);
12659 
12660   const T1 v1_;
12661   const T2 v2_;
12662   const T3 v3_;
12663   const T4 v4_;
12664   const T5 v5_;
12665   const T6 v6_;
12666   const T7 v7_;
12667   const T8 v8_;
12668   const T9 v9_;
12669   const T10 v10_;
12670   const T11 v11_;
12671   const T12 v12_;
12672   const T13 v13_;
12673   const T14 v14_;
12674   const T15 v15_;
12675   const T16 v16_;
12676   const T17 v17_;
12677   const T18 v18_;
12678   const T19 v19_;
12679   const T20 v20_;
12680   const T21 v21_;
12681   const T22 v22_;
12682   const T23 v23_;
12683   const T24 v24_;
12684   const T25 v25_;
12685   const T26 v26_;
12686   const T27 v27_;
12687   const T28 v28_;
12688   const T29 v29_;
12689   const T30 v30_;
12690   const T31 v31_;
12691   const T32 v32_;
12692   const T33 v33_;
12693   const T34 v34_;
12694   const T35 v35_;
12695   const T36 v36_;
12696   const T37 v37_;
12697   const T38 v38_;
12698   const T39 v39_;
12699 };
12700 
12701 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12702     typename T6, typename T7, typename T8, typename T9, typename T10,
12703     typename T11, typename T12, typename T13, typename T14, typename T15,
12704     typename T16, typename T17, typename T18, typename T19, typename T20,
12705     typename T21, typename T22, typename T23, typename T24, typename T25,
12706     typename T26, typename T27, typename T28, typename T29, typename T30,
12707     typename T31, typename T32, typename T33, typename T34, typename T35,
12708     typename T36, typename T37, typename T38, typename T39, typename T40>
12709 class ValueArray40 {
12710  public:
12711   ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12712       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12713       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12714       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12715       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
12716       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
12717       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
12718       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
12719       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
12720       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
12721       v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
12722       v40_(v40) {}
12723 
12724   template <typename T>
12725   operator ParamGenerator<T>() const {
12726     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12727         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12728         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12729         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12730         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12731         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12732         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12733         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12734         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12735         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12736         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12737         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12738         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12739         static_cast<T>(v39_), static_cast<T>(v40_)};
12740     return ValuesIn(array);
12741   }
12742 
12743  private:
12744   // No implementation - assignment is unsupported.
12745   void operator=(const ValueArray40& other);
12746 
12747   const T1 v1_;
12748   const T2 v2_;
12749   const T3 v3_;
12750   const T4 v4_;
12751   const T5 v5_;
12752   const T6 v6_;
12753   const T7 v7_;
12754   const T8 v8_;
12755   const T9 v9_;
12756   const T10 v10_;
12757   const T11 v11_;
12758   const T12 v12_;
12759   const T13 v13_;
12760   const T14 v14_;
12761   const T15 v15_;
12762   const T16 v16_;
12763   const T17 v17_;
12764   const T18 v18_;
12765   const T19 v19_;
12766   const T20 v20_;
12767   const T21 v21_;
12768   const T22 v22_;
12769   const T23 v23_;
12770   const T24 v24_;
12771   const T25 v25_;
12772   const T26 v26_;
12773   const T27 v27_;
12774   const T28 v28_;
12775   const T29 v29_;
12776   const T30 v30_;
12777   const T31 v31_;
12778   const T32 v32_;
12779   const T33 v33_;
12780   const T34 v34_;
12781   const T35 v35_;
12782   const T36 v36_;
12783   const T37 v37_;
12784   const T38 v38_;
12785   const T39 v39_;
12786   const T40 v40_;
12787 };
12788 
12789 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12790     typename T6, typename T7, typename T8, typename T9, typename T10,
12791     typename T11, typename T12, typename T13, typename T14, typename T15,
12792     typename T16, typename T17, typename T18, typename T19, typename T20,
12793     typename T21, typename T22, typename T23, typename T24, typename T25,
12794     typename T26, typename T27, typename T28, typename T29, typename T30,
12795     typename T31, typename T32, typename T33, typename T34, typename T35,
12796     typename T36, typename T37, typename T38, typename T39, typename T40,
12797     typename T41>
12798 class ValueArray41 {
12799  public:
12800   ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12801       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12802       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12803       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12804       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
12805       T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12806       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12807       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12808       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12809       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12810       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12811       v39_(v39), v40_(v40), v41_(v41) {}
12812 
12813   template <typename T>
12814   operator ParamGenerator<T>() const {
12815     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12816         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12817         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12818         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12819         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12820         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12821         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12822         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12823         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12824         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12825         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12826         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12827         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12828         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
12829     return ValuesIn(array);
12830   }
12831 
12832  private:
12833   // No implementation - assignment is unsupported.
12834   void operator=(const ValueArray41& other);
12835 
12836   const T1 v1_;
12837   const T2 v2_;
12838   const T3 v3_;
12839   const T4 v4_;
12840   const T5 v5_;
12841   const T6 v6_;
12842   const T7 v7_;
12843   const T8 v8_;
12844   const T9 v9_;
12845   const T10 v10_;
12846   const T11 v11_;
12847   const T12 v12_;
12848   const T13 v13_;
12849   const T14 v14_;
12850   const T15 v15_;
12851   const T16 v16_;
12852   const T17 v17_;
12853   const T18 v18_;
12854   const T19 v19_;
12855   const T20 v20_;
12856   const T21 v21_;
12857   const T22 v22_;
12858   const T23 v23_;
12859   const T24 v24_;
12860   const T25 v25_;
12861   const T26 v26_;
12862   const T27 v27_;
12863   const T28 v28_;
12864   const T29 v29_;
12865   const T30 v30_;
12866   const T31 v31_;
12867   const T32 v32_;
12868   const T33 v33_;
12869   const T34 v34_;
12870   const T35 v35_;
12871   const T36 v36_;
12872   const T37 v37_;
12873   const T38 v38_;
12874   const T39 v39_;
12875   const T40 v40_;
12876   const T41 v41_;
12877 };
12878 
12879 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12880     typename T6, typename T7, typename T8, typename T9, typename T10,
12881     typename T11, typename T12, typename T13, typename T14, typename T15,
12882     typename T16, typename T17, typename T18, typename T19, typename T20,
12883     typename T21, typename T22, typename T23, typename T24, typename T25,
12884     typename T26, typename T27, typename T28, typename T29, typename T30,
12885     typename T31, typename T32, typename T33, typename T34, typename T35,
12886     typename T36, typename T37, typename T38, typename T39, typename T40,
12887     typename T41, typename T42>
12888 class ValueArray42 {
12889  public:
12890   ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12891       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12892       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12893       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12894       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12895       T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
12896       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
12897       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
12898       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
12899       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
12900       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
12901       v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
12902 
12903   template <typename T>
12904   operator ParamGenerator<T>() const {
12905     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12906         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12907         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
12908         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
12909         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
12910         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
12911         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
12912         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
12913         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
12914         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
12915         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
12916         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
12917         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
12918         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
12919         static_cast<T>(v42_)};
12920     return ValuesIn(array);
12921   }
12922 
12923  private:
12924   // No implementation - assignment is unsupported.
12925   void operator=(const ValueArray42& other);
12926 
12927   const T1 v1_;
12928   const T2 v2_;
12929   const T3 v3_;
12930   const T4 v4_;
12931   const T5 v5_;
12932   const T6 v6_;
12933   const T7 v7_;
12934   const T8 v8_;
12935   const T9 v9_;
12936   const T10 v10_;
12937   const T11 v11_;
12938   const T12 v12_;
12939   const T13 v13_;
12940   const T14 v14_;
12941   const T15 v15_;
12942   const T16 v16_;
12943   const T17 v17_;
12944   const T18 v18_;
12945   const T19 v19_;
12946   const T20 v20_;
12947   const T21 v21_;
12948   const T22 v22_;
12949   const T23 v23_;
12950   const T24 v24_;
12951   const T25 v25_;
12952   const T26 v26_;
12953   const T27 v27_;
12954   const T28 v28_;
12955   const T29 v29_;
12956   const T30 v30_;
12957   const T31 v31_;
12958   const T32 v32_;
12959   const T33 v33_;
12960   const T34 v34_;
12961   const T35 v35_;
12962   const T36 v36_;
12963   const T37 v37_;
12964   const T38 v38_;
12965   const T39 v39_;
12966   const T40 v40_;
12967   const T41 v41_;
12968   const T42 v42_;
12969 };
12970 
12971 template <typename T1, typename T2, typename T3, typename T4, typename T5,
12972     typename T6, typename T7, typename T8, typename T9, typename T10,
12973     typename T11, typename T12, typename T13, typename T14, typename T15,
12974     typename T16, typename T17, typename T18, typename T19, typename T20,
12975     typename T21, typename T22, typename T23, typename T24, typename T25,
12976     typename T26, typename T27, typename T28, typename T29, typename T30,
12977     typename T31, typename T32, typename T33, typename T34, typename T35,
12978     typename T36, typename T37, typename T38, typename T39, typename T40,
12979     typename T41, typename T42, typename T43>
12980 class ValueArray43 {
12981  public:
12982   ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
12983       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
12984       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
12985       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
12986       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
12987       T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
12988       v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
12989       v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
12990       v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
12991       v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
12992       v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
12993       v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
12994 
12995   template <typename T>
12996   operator ParamGenerator<T>() const {
12997     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
12998         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
12999         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13000         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13001         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13002         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13003         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13004         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13005         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13006         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13007         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13008         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13009         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13010         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13011         static_cast<T>(v42_), static_cast<T>(v43_)};
13012     return ValuesIn(array);
13013   }
13014 
13015  private:
13016   // No implementation - assignment is unsupported.
13017   void operator=(const ValueArray43& other);
13018 
13019   const T1 v1_;
13020   const T2 v2_;
13021   const T3 v3_;
13022   const T4 v4_;
13023   const T5 v5_;
13024   const T6 v6_;
13025   const T7 v7_;
13026   const T8 v8_;
13027   const T9 v9_;
13028   const T10 v10_;
13029   const T11 v11_;
13030   const T12 v12_;
13031   const T13 v13_;
13032   const T14 v14_;
13033   const T15 v15_;
13034   const T16 v16_;
13035   const T17 v17_;
13036   const T18 v18_;
13037   const T19 v19_;
13038   const T20 v20_;
13039   const T21 v21_;
13040   const T22 v22_;
13041   const T23 v23_;
13042   const T24 v24_;
13043   const T25 v25_;
13044   const T26 v26_;
13045   const T27 v27_;
13046   const T28 v28_;
13047   const T29 v29_;
13048   const T30 v30_;
13049   const T31 v31_;
13050   const T32 v32_;
13051   const T33 v33_;
13052   const T34 v34_;
13053   const T35 v35_;
13054   const T36 v36_;
13055   const T37 v37_;
13056   const T38 v38_;
13057   const T39 v39_;
13058   const T40 v40_;
13059   const T41 v41_;
13060   const T42 v42_;
13061   const T43 v43_;
13062 };
13063 
13064 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13065     typename T6, typename T7, typename T8, typename T9, typename T10,
13066     typename T11, typename T12, typename T13, typename T14, typename T15,
13067     typename T16, typename T17, typename T18, typename T19, typename T20,
13068     typename T21, typename T22, typename T23, typename T24, typename T25,
13069     typename T26, typename T27, typename T28, typename T29, typename T30,
13070     typename T31, typename T32, typename T33, typename T34, typename T35,
13071     typename T36, typename T37, typename T38, typename T39, typename T40,
13072     typename T41, typename T42, typename T43, typename T44>
13073 class ValueArray44 {
13074  public:
13075   ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13076       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13077       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13078       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13079       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13080       T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
13081       v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
13082       v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
13083       v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
13084       v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
13085       v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
13086       v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
13087       v43_(v43), v44_(v44) {}
13088 
13089   template <typename T>
13090   operator ParamGenerator<T>() const {
13091     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13092         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13093         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13094         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13095         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13096         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13097         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13098         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13099         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13100         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13101         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13102         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13103         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13104         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13105         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
13106     return ValuesIn(array);
13107   }
13108 
13109  private:
13110   // No implementation - assignment is unsupported.
13111   void operator=(const ValueArray44& other);
13112 
13113   const T1 v1_;
13114   const T2 v2_;
13115   const T3 v3_;
13116   const T4 v4_;
13117   const T5 v5_;
13118   const T6 v6_;
13119   const T7 v7_;
13120   const T8 v8_;
13121   const T9 v9_;
13122   const T10 v10_;
13123   const T11 v11_;
13124   const T12 v12_;
13125   const T13 v13_;
13126   const T14 v14_;
13127   const T15 v15_;
13128   const T16 v16_;
13129   const T17 v17_;
13130   const T18 v18_;
13131   const T19 v19_;
13132   const T20 v20_;
13133   const T21 v21_;
13134   const T22 v22_;
13135   const T23 v23_;
13136   const T24 v24_;
13137   const T25 v25_;
13138   const T26 v26_;
13139   const T27 v27_;
13140   const T28 v28_;
13141   const T29 v29_;
13142   const T30 v30_;
13143   const T31 v31_;
13144   const T32 v32_;
13145   const T33 v33_;
13146   const T34 v34_;
13147   const T35 v35_;
13148   const T36 v36_;
13149   const T37 v37_;
13150   const T38 v38_;
13151   const T39 v39_;
13152   const T40 v40_;
13153   const T41 v41_;
13154   const T42 v42_;
13155   const T43 v43_;
13156   const T44 v44_;
13157 };
13158 
13159 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13160     typename T6, typename T7, typename T8, typename T9, typename T10,
13161     typename T11, typename T12, typename T13, typename T14, typename T15,
13162     typename T16, typename T17, typename T18, typename T19, typename T20,
13163     typename T21, typename T22, typename T23, typename T24, typename T25,
13164     typename T26, typename T27, typename T28, typename T29, typename T30,
13165     typename T31, typename T32, typename T33, typename T34, typename T35,
13166     typename T36, typename T37, typename T38, typename T39, typename T40,
13167     typename T41, typename T42, typename T43, typename T44, typename T45>
13168 class ValueArray45 {
13169  public:
13170   ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13171       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13172       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13173       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13174       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13175       T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
13176       v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
13177       v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
13178       v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
13179       v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
13180       v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
13181       v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
13182       v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
13183 
13184   template <typename T>
13185   operator ParamGenerator<T>() const {
13186     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13187         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13188         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13189         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13190         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13191         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13192         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13193         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13194         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13195         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13196         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13197         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13198         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13199         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13200         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13201         static_cast<T>(v45_)};
13202     return ValuesIn(array);
13203   }
13204 
13205  private:
13206   // No implementation - assignment is unsupported.
13207   void operator=(const ValueArray45& other);
13208 
13209   const T1 v1_;
13210   const T2 v2_;
13211   const T3 v3_;
13212   const T4 v4_;
13213   const T5 v5_;
13214   const T6 v6_;
13215   const T7 v7_;
13216   const T8 v8_;
13217   const T9 v9_;
13218   const T10 v10_;
13219   const T11 v11_;
13220   const T12 v12_;
13221   const T13 v13_;
13222   const T14 v14_;
13223   const T15 v15_;
13224   const T16 v16_;
13225   const T17 v17_;
13226   const T18 v18_;
13227   const T19 v19_;
13228   const T20 v20_;
13229   const T21 v21_;
13230   const T22 v22_;
13231   const T23 v23_;
13232   const T24 v24_;
13233   const T25 v25_;
13234   const T26 v26_;
13235   const T27 v27_;
13236   const T28 v28_;
13237   const T29 v29_;
13238   const T30 v30_;
13239   const T31 v31_;
13240   const T32 v32_;
13241   const T33 v33_;
13242   const T34 v34_;
13243   const T35 v35_;
13244   const T36 v36_;
13245   const T37 v37_;
13246   const T38 v38_;
13247   const T39 v39_;
13248   const T40 v40_;
13249   const T41 v41_;
13250   const T42 v42_;
13251   const T43 v43_;
13252   const T44 v44_;
13253   const T45 v45_;
13254 };
13255 
13256 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13257     typename T6, typename T7, typename T8, typename T9, typename T10,
13258     typename T11, typename T12, typename T13, typename T14, typename T15,
13259     typename T16, typename T17, typename T18, typename T19, typename T20,
13260     typename T21, typename T22, typename T23, typename T24, typename T25,
13261     typename T26, typename T27, typename T28, typename T29, typename T30,
13262     typename T31, typename T32, typename T33, typename T34, typename T35,
13263     typename T36, typename T37, typename T38, typename T39, typename T40,
13264     typename T41, typename T42, typename T43, typename T44, typename T45,
13265     typename T46>
13266 class ValueArray46 {
13267  public:
13268   ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13269       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13270       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13271       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13272       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13273       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
13274       v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13275       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13276       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13277       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13278       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13279       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13280       v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
13281 
13282   template <typename T>
13283   operator ParamGenerator<T>() const {
13284     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13285         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13286         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13287         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13288         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13289         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13290         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13291         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13292         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13293         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13294         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13295         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13296         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13297         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13298         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13299         static_cast<T>(v45_), static_cast<T>(v46_)};
13300     return ValuesIn(array);
13301   }
13302 
13303  private:
13304   // No implementation - assignment is unsupported.
13305   void operator=(const ValueArray46& other);
13306 
13307   const T1 v1_;
13308   const T2 v2_;
13309   const T3 v3_;
13310   const T4 v4_;
13311   const T5 v5_;
13312   const T6 v6_;
13313   const T7 v7_;
13314   const T8 v8_;
13315   const T9 v9_;
13316   const T10 v10_;
13317   const T11 v11_;
13318   const T12 v12_;
13319   const T13 v13_;
13320   const T14 v14_;
13321   const T15 v15_;
13322   const T16 v16_;
13323   const T17 v17_;
13324   const T18 v18_;
13325   const T19 v19_;
13326   const T20 v20_;
13327   const T21 v21_;
13328   const T22 v22_;
13329   const T23 v23_;
13330   const T24 v24_;
13331   const T25 v25_;
13332   const T26 v26_;
13333   const T27 v27_;
13334   const T28 v28_;
13335   const T29 v29_;
13336   const T30 v30_;
13337   const T31 v31_;
13338   const T32 v32_;
13339   const T33 v33_;
13340   const T34 v34_;
13341   const T35 v35_;
13342   const T36 v36_;
13343   const T37 v37_;
13344   const T38 v38_;
13345   const T39 v39_;
13346   const T40 v40_;
13347   const T41 v41_;
13348   const T42 v42_;
13349   const T43 v43_;
13350   const T44 v44_;
13351   const T45 v45_;
13352   const T46 v46_;
13353 };
13354 
13355 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13356     typename T6, typename T7, typename T8, typename T9, typename T10,
13357     typename T11, typename T12, typename T13, typename T14, typename T15,
13358     typename T16, typename T17, typename T18, typename T19, typename T20,
13359     typename T21, typename T22, typename T23, typename T24, typename T25,
13360     typename T26, typename T27, typename T28, typename T29, typename T30,
13361     typename T31, typename T32, typename T33, typename T34, typename T35,
13362     typename T36, typename T37, typename T38, typename T39, typename T40,
13363     typename T41, typename T42, typename T43, typename T44, typename T45,
13364     typename T46, typename T47>
13365 class ValueArray47 {
13366  public:
13367   ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13368       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13369       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13370       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13371       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13372       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
13373       v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
13374       v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
13375       v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
13376       v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
13377       v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
13378       v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
13379       v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
13380       v47_(v47) {}
13381 
13382   template <typename T>
13383   operator ParamGenerator<T>() const {
13384     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13385         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13386         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13387         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13388         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13389         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13390         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13391         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13392         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13393         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13394         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13395         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13396         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13397         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13398         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13399         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
13400     return ValuesIn(array);
13401   }
13402 
13403  private:
13404   // No implementation - assignment is unsupported.
13405   void operator=(const ValueArray47& other);
13406 
13407   const T1 v1_;
13408   const T2 v2_;
13409   const T3 v3_;
13410   const T4 v4_;
13411   const T5 v5_;
13412   const T6 v6_;
13413   const T7 v7_;
13414   const T8 v8_;
13415   const T9 v9_;
13416   const T10 v10_;
13417   const T11 v11_;
13418   const T12 v12_;
13419   const T13 v13_;
13420   const T14 v14_;
13421   const T15 v15_;
13422   const T16 v16_;
13423   const T17 v17_;
13424   const T18 v18_;
13425   const T19 v19_;
13426   const T20 v20_;
13427   const T21 v21_;
13428   const T22 v22_;
13429   const T23 v23_;
13430   const T24 v24_;
13431   const T25 v25_;
13432   const T26 v26_;
13433   const T27 v27_;
13434   const T28 v28_;
13435   const T29 v29_;
13436   const T30 v30_;
13437   const T31 v31_;
13438   const T32 v32_;
13439   const T33 v33_;
13440   const T34 v34_;
13441   const T35 v35_;
13442   const T36 v36_;
13443   const T37 v37_;
13444   const T38 v38_;
13445   const T39 v39_;
13446   const T40 v40_;
13447   const T41 v41_;
13448   const T42 v42_;
13449   const T43 v43_;
13450   const T44 v44_;
13451   const T45 v45_;
13452   const T46 v46_;
13453   const T47 v47_;
13454 };
13455 
13456 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13457     typename T6, typename T7, typename T8, typename T9, typename T10,
13458     typename T11, typename T12, typename T13, typename T14, typename T15,
13459     typename T16, typename T17, typename T18, typename T19, typename T20,
13460     typename T21, typename T22, typename T23, typename T24, typename T25,
13461     typename T26, typename T27, typename T28, typename T29, typename T30,
13462     typename T31, typename T32, typename T33, typename T34, typename T35,
13463     typename T36, typename T37, typename T38, typename T39, typename T40,
13464     typename T41, typename T42, typename T43, typename T44, typename T45,
13465     typename T46, typename T47, typename T48>
13466 class ValueArray48 {
13467  public:
13468   ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13469       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13470       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13471       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13472       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13473       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
13474       v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
13475       v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
13476       v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
13477       v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
13478       v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
13479       v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
13480       v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
13481       v46_(v46), v47_(v47), v48_(v48) {}
13482 
13483   template <typename T>
13484   operator ParamGenerator<T>() const {
13485     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13486         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13487         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13488         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13489         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13490         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13491         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13492         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13493         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13494         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13495         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13496         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13497         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13498         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13499         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13500         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13501         static_cast<T>(v48_)};
13502     return ValuesIn(array);
13503   }
13504 
13505  private:
13506   // No implementation - assignment is unsupported.
13507   void operator=(const ValueArray48& other);
13508 
13509   const T1 v1_;
13510   const T2 v2_;
13511   const T3 v3_;
13512   const T4 v4_;
13513   const T5 v5_;
13514   const T6 v6_;
13515   const T7 v7_;
13516   const T8 v8_;
13517   const T9 v9_;
13518   const T10 v10_;
13519   const T11 v11_;
13520   const T12 v12_;
13521   const T13 v13_;
13522   const T14 v14_;
13523   const T15 v15_;
13524   const T16 v16_;
13525   const T17 v17_;
13526   const T18 v18_;
13527   const T19 v19_;
13528   const T20 v20_;
13529   const T21 v21_;
13530   const T22 v22_;
13531   const T23 v23_;
13532   const T24 v24_;
13533   const T25 v25_;
13534   const T26 v26_;
13535   const T27 v27_;
13536   const T28 v28_;
13537   const T29 v29_;
13538   const T30 v30_;
13539   const T31 v31_;
13540   const T32 v32_;
13541   const T33 v33_;
13542   const T34 v34_;
13543   const T35 v35_;
13544   const T36 v36_;
13545   const T37 v37_;
13546   const T38 v38_;
13547   const T39 v39_;
13548   const T40 v40_;
13549   const T41 v41_;
13550   const T42 v42_;
13551   const T43 v43_;
13552   const T44 v44_;
13553   const T45 v45_;
13554   const T46 v46_;
13555   const T47 v47_;
13556   const T48 v48_;
13557 };
13558 
13559 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13560     typename T6, typename T7, typename T8, typename T9, typename T10,
13561     typename T11, typename T12, typename T13, typename T14, typename T15,
13562     typename T16, typename T17, typename T18, typename T19, typename T20,
13563     typename T21, typename T22, typename T23, typename T24, typename T25,
13564     typename T26, typename T27, typename T28, typename T29, typename T30,
13565     typename T31, typename T32, typename T33, typename T34, typename T35,
13566     typename T36, typename T37, typename T38, typename T39, typename T40,
13567     typename T41, typename T42, typename T43, typename T44, typename T45,
13568     typename T46, typename T47, typename T48, typename T49>
13569 class ValueArray49 {
13570  public:
13571   ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13572       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13573       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13574       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13575       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13576       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
13577       T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13578       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13579       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13580       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13581       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13582       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13583       v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13584       v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
13585 
13586   template <typename T>
13587   operator ParamGenerator<T>() const {
13588     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13589         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13590         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13591         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13592         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13593         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13594         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13595         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13596         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13597         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13598         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13599         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13600         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13601         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13602         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13603         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13604         static_cast<T>(v48_), static_cast<T>(v49_)};
13605     return ValuesIn(array);
13606   }
13607 
13608  private:
13609   // No implementation - assignment is unsupported.
13610   void operator=(const ValueArray49& other);
13611 
13612   const T1 v1_;
13613   const T2 v2_;
13614   const T3 v3_;
13615   const T4 v4_;
13616   const T5 v5_;
13617   const T6 v6_;
13618   const T7 v7_;
13619   const T8 v8_;
13620   const T9 v9_;
13621   const T10 v10_;
13622   const T11 v11_;
13623   const T12 v12_;
13624   const T13 v13_;
13625   const T14 v14_;
13626   const T15 v15_;
13627   const T16 v16_;
13628   const T17 v17_;
13629   const T18 v18_;
13630   const T19 v19_;
13631   const T20 v20_;
13632   const T21 v21_;
13633   const T22 v22_;
13634   const T23 v23_;
13635   const T24 v24_;
13636   const T25 v25_;
13637   const T26 v26_;
13638   const T27 v27_;
13639   const T28 v28_;
13640   const T29 v29_;
13641   const T30 v30_;
13642   const T31 v31_;
13643   const T32 v32_;
13644   const T33 v33_;
13645   const T34 v34_;
13646   const T35 v35_;
13647   const T36 v36_;
13648   const T37 v37_;
13649   const T38 v38_;
13650   const T39 v39_;
13651   const T40 v40_;
13652   const T41 v41_;
13653   const T42 v42_;
13654   const T43 v43_;
13655   const T44 v44_;
13656   const T45 v45_;
13657   const T46 v46_;
13658   const T47 v47_;
13659   const T48 v48_;
13660   const T49 v49_;
13661 };
13662 
13663 template <typename T1, typename T2, typename T3, typename T4, typename T5,
13664     typename T6, typename T7, typename T8, typename T9, typename T10,
13665     typename T11, typename T12, typename T13, typename T14, typename T15,
13666     typename T16, typename T17, typename T18, typename T19, typename T20,
13667     typename T21, typename T22, typename T23, typename T24, typename T25,
13668     typename T26, typename T27, typename T28, typename T29, typename T30,
13669     typename T31, typename T32, typename T33, typename T34, typename T35,
13670     typename T36, typename T37, typename T38, typename T39, typename T40,
13671     typename T41, typename T42, typename T43, typename T44, typename T45,
13672     typename T46, typename T47, typename T48, typename T49, typename T50>
13673 class ValueArray50 {
13674  public:
13675   ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
13676       T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
13677       T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
13678       T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
13679       T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
13680       T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
13681       T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
13682       v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
13683       v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
13684       v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
13685       v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
13686       v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
13687       v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
13688       v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
13689 
13690   template <typename T>
13691   operator ParamGenerator<T>() const {
13692     const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
13693         static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
13694         static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
13695         static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
13696         static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
13697         static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
13698         static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
13699         static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
13700         static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
13701         static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
13702         static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
13703         static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
13704         static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
13705         static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
13706         static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
13707         static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
13708         static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
13709     return ValuesIn(array);
13710   }
13711 
13712  private:
13713   // No implementation - assignment is unsupported.
13714   void operator=(const ValueArray50& other);
13715 
13716   const T1 v1_;
13717   const T2 v2_;
13718   const T3 v3_;
13719   const T4 v4_;
13720   const T5 v5_;
13721   const T6 v6_;
13722   const T7 v7_;
13723   const T8 v8_;
13724   const T9 v9_;
13725   const T10 v10_;
13726   const T11 v11_;
13727   const T12 v12_;
13728   const T13 v13_;
13729   const T14 v14_;
13730   const T15 v15_;
13731   const T16 v16_;
13732   const T17 v17_;
13733   const T18 v18_;
13734   const T19 v19_;
13735   const T20 v20_;
13736   const T21 v21_;
13737   const T22 v22_;
13738   const T23 v23_;
13739   const T24 v24_;
13740   const T25 v25_;
13741   const T26 v26_;
13742   const T27 v27_;
13743   const T28 v28_;
13744   const T29 v29_;
13745   const T30 v30_;
13746   const T31 v31_;
13747   const T32 v32_;
13748   const T33 v33_;
13749   const T34 v34_;
13750   const T35 v35_;
13751   const T36 v36_;
13752   const T37 v37_;
13753   const T38 v38_;
13754   const T39 v39_;
13755   const T40 v40_;
13756   const T41 v41_;
13757   const T42 v42_;
13758   const T43 v43_;
13759   const T44 v44_;
13760   const T45 v45_;
13761   const T46 v46_;
13762   const T47 v47_;
13763   const T48 v48_;
13764   const T49 v49_;
13765   const T50 v50_;
13766 };
13767 
13768 # if GTEST_HAS_COMBINE
13769 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
13770 //
13771 // Generates values from the Cartesian product of values produced
13772 // by the argument generators.
13773 //
13774 template <typename T1, typename T2>
13775 class CartesianProductGenerator2
13776     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
13777  public:
13778   typedef ::std::tr1::tuple<T1, T2> ParamType;
13779 
13780   CartesianProductGenerator2(const ParamGenerator<T1>& g1,
13781       const ParamGenerator<T2>& g2)
13782       : g1_(g1), g2_(g2) {}
13783   virtual ~CartesianProductGenerator2() {}
13784 
13785   virtual ParamIteratorInterface<ParamType>* Begin() const {
13786     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
13787   }
13788   virtual ParamIteratorInterface<ParamType>* End() const {
13789     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
13790   }
13791 
13792  private:
13793   class Iterator : public ParamIteratorInterface<ParamType> {
13794    public:
13795     Iterator(const ParamGeneratorInterface<ParamType>* base,
13796       const ParamGenerator<T1>& g1,
13797       const typename ParamGenerator<T1>::iterator& current1,
13798       const ParamGenerator<T2>& g2,
13799       const typename ParamGenerator<T2>::iterator& current2)
13800         : base_(base),
13801           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13802           begin2_(g2.begin()), end2_(g2.end()), current2_(current2)    {
13803       ComputeCurrentValue();
13804     }
13805     virtual ~Iterator() {}
13806 
13807     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13808       return base_;
13809     }
13810     // Advance should not be called on beyond-of-range iterators
13811     // so no component iterators must be beyond end of range, either.
13812     virtual void Advance() {
13813       assert(!AtEnd());
13814       ++current2_;
13815       if (current2_ == end2_) {
13816         current2_ = begin2_;
13817         ++current1_;
13818       }
13819       ComputeCurrentValue();
13820     }
13821     virtual ParamIteratorInterface<ParamType>* Clone() const {
13822       return new Iterator(*this);
13823     }
13824     virtual const ParamType* Current() const { return &current_value_; }
13825     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13826       // Having the same base generator guarantees that the other
13827       // iterator is of the same type and we can downcast.
13828       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13829           << "The program attempted to compare iterators "
13830           << "from different generators." << std::endl;
13831       const Iterator* typed_other =
13832           CheckedDowncastToActualType<const Iterator>(&other);
13833       // We must report iterators equal if they both point beyond their
13834       // respective ranges. That can happen in a variety of fashions,
13835       // so we have to consult AtEnd().
13836       return (AtEnd() && typed_other->AtEnd()) ||
13837          (
13838           current1_ == typed_other->current1_ &&
13839           current2_ == typed_other->current2_);
13840     }
13841 
13842    private:
13843     Iterator(const Iterator& other)
13844         : base_(other.base_),
13845         begin1_(other.begin1_),
13846         end1_(other.end1_),
13847         current1_(other.current1_),
13848         begin2_(other.begin2_),
13849         end2_(other.end2_),
13850         current2_(other.current2_) {
13851       ComputeCurrentValue();
13852     }
13853 
13854     void ComputeCurrentValue() {
13855       if (!AtEnd())
13856         current_value_ = ParamType(*current1_, *current2_);
13857     }
13858     bool AtEnd() const {
13859       // We must report iterator past the end of the range when either of the
13860       // component iterators has reached the end of its range.
13861       return
13862           current1_ == end1_ ||
13863           current2_ == end2_;
13864     }
13865 
13866     // No implementation - assignment is unsupported.
13867     void operator=(const Iterator& other);
13868 
13869     const ParamGeneratorInterface<ParamType>* const base_;
13870     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13871     // current[i]_ is the actual traversing iterator.
13872     const typename ParamGenerator<T1>::iterator begin1_;
13873     const typename ParamGenerator<T1>::iterator end1_;
13874     typename ParamGenerator<T1>::iterator current1_;
13875     const typename ParamGenerator<T2>::iterator begin2_;
13876     const typename ParamGenerator<T2>::iterator end2_;
13877     typename ParamGenerator<T2>::iterator current2_;
13878     ParamType current_value_;
13879   };  // class CartesianProductGenerator2::Iterator
13880 
13881   // No implementation - assignment is unsupported.
13882   void operator=(const CartesianProductGenerator2& other);
13883 
13884   const ParamGenerator<T1> g1_;
13885   const ParamGenerator<T2> g2_;
13886 };  // class CartesianProductGenerator2
13887 
13888 
13889 template <typename T1, typename T2, typename T3>
13890 class CartesianProductGenerator3
13891     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
13892  public:
13893   typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
13894 
13895   CartesianProductGenerator3(const ParamGenerator<T1>& g1,
13896       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
13897       : g1_(g1), g2_(g2), g3_(g3) {}
13898   virtual ~CartesianProductGenerator3() {}
13899 
13900   virtual ParamIteratorInterface<ParamType>* Begin() const {
13901     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
13902         g3_.begin());
13903   }
13904   virtual ParamIteratorInterface<ParamType>* End() const {
13905     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
13906   }
13907 
13908  private:
13909   class Iterator : public ParamIteratorInterface<ParamType> {
13910    public:
13911     Iterator(const ParamGeneratorInterface<ParamType>* base,
13912       const ParamGenerator<T1>& g1,
13913       const typename ParamGenerator<T1>::iterator& current1,
13914       const ParamGenerator<T2>& g2,
13915       const typename ParamGenerator<T2>::iterator& current2,
13916       const ParamGenerator<T3>& g3,
13917       const typename ParamGenerator<T3>::iterator& current3)
13918         : base_(base),
13919           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
13920           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
13921           begin3_(g3.begin()), end3_(g3.end()), current3_(current3)    {
13922       ComputeCurrentValue();
13923     }
13924     virtual ~Iterator() {}
13925 
13926     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
13927       return base_;
13928     }
13929     // Advance should not be called on beyond-of-range iterators
13930     // so no component iterators must be beyond end of range, either.
13931     virtual void Advance() {
13932       assert(!AtEnd());
13933       ++current3_;
13934       if (current3_ == end3_) {
13935         current3_ = begin3_;
13936         ++current2_;
13937       }
13938       if (current2_ == end2_) {
13939         current2_ = begin2_;
13940         ++current1_;
13941       }
13942       ComputeCurrentValue();
13943     }
13944     virtual ParamIteratorInterface<ParamType>* Clone() const {
13945       return new Iterator(*this);
13946     }
13947     virtual const ParamType* Current() const { return &current_value_; }
13948     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
13949       // Having the same base generator guarantees that the other
13950       // iterator is of the same type and we can downcast.
13951       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
13952           << "The program attempted to compare iterators "
13953           << "from different generators." << std::endl;
13954       const Iterator* typed_other =
13955           CheckedDowncastToActualType<const Iterator>(&other);
13956       // We must report iterators equal if they both point beyond their
13957       // respective ranges. That can happen in a variety of fashions,
13958       // so we have to consult AtEnd().
13959       return (AtEnd() && typed_other->AtEnd()) ||
13960          (
13961           current1_ == typed_other->current1_ &&
13962           current2_ == typed_other->current2_ &&
13963           current3_ == typed_other->current3_);
13964     }
13965 
13966    private:
13967     Iterator(const Iterator& other)
13968         : base_(other.base_),
13969         begin1_(other.begin1_),
13970         end1_(other.end1_),
13971         current1_(other.current1_),
13972         begin2_(other.begin2_),
13973         end2_(other.end2_),
13974         current2_(other.current2_),
13975         begin3_(other.begin3_),
13976         end3_(other.end3_),
13977         current3_(other.current3_) {
13978       ComputeCurrentValue();
13979     }
13980 
13981     void ComputeCurrentValue() {
13982       if (!AtEnd())
13983         current_value_ = ParamType(*current1_, *current2_, *current3_);
13984     }
13985     bool AtEnd() const {
13986       // We must report iterator past the end of the range when either of the
13987       // component iterators has reached the end of its range.
13988       return
13989           current1_ == end1_ ||
13990           current2_ == end2_ ||
13991           current3_ == end3_;
13992     }
13993 
13994     // No implementation - assignment is unsupported.
13995     void operator=(const Iterator& other);
13996 
13997     const ParamGeneratorInterface<ParamType>* const base_;
13998     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
13999     // current[i]_ is the actual traversing iterator.
14000     const typename ParamGenerator<T1>::iterator begin1_;
14001     const typename ParamGenerator<T1>::iterator end1_;
14002     typename ParamGenerator<T1>::iterator current1_;
14003     const typename ParamGenerator<T2>::iterator begin2_;
14004     const typename ParamGenerator<T2>::iterator end2_;
14005     typename ParamGenerator<T2>::iterator current2_;
14006     const typename ParamGenerator<T3>::iterator begin3_;
14007     const typename ParamGenerator<T3>::iterator end3_;
14008     typename ParamGenerator<T3>::iterator current3_;
14009     ParamType current_value_;
14010   };  // class CartesianProductGenerator3::Iterator
14011 
14012   // No implementation - assignment is unsupported.
14013   void operator=(const CartesianProductGenerator3& other);
14014 
14015   const ParamGenerator<T1> g1_;
14016   const ParamGenerator<T2> g2_;
14017   const ParamGenerator<T3> g3_;
14018 };  // class CartesianProductGenerator3
14019 
14020 
14021 template <typename T1, typename T2, typename T3, typename T4>
14022 class CartesianProductGenerator4
14023     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
14024  public:
14025   typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
14026 
14027   CartesianProductGenerator4(const ParamGenerator<T1>& g1,
14028       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14029       const ParamGenerator<T4>& g4)
14030       : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
14031   virtual ~CartesianProductGenerator4() {}
14032 
14033   virtual ParamIteratorInterface<ParamType>* Begin() const {
14034     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14035         g3_.begin(), g4_, g4_.begin());
14036   }
14037   virtual ParamIteratorInterface<ParamType>* End() const {
14038     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14039         g4_, g4_.end());
14040   }
14041 
14042  private:
14043   class Iterator : public ParamIteratorInterface<ParamType> {
14044    public:
14045     Iterator(const ParamGeneratorInterface<ParamType>* base,
14046       const ParamGenerator<T1>& g1,
14047       const typename ParamGenerator<T1>::iterator& current1,
14048       const ParamGenerator<T2>& g2,
14049       const typename ParamGenerator<T2>::iterator& current2,
14050       const ParamGenerator<T3>& g3,
14051       const typename ParamGenerator<T3>::iterator& current3,
14052       const ParamGenerator<T4>& g4,
14053       const typename ParamGenerator<T4>::iterator& current4)
14054         : base_(base),
14055           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14056           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14057           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14058           begin4_(g4.begin()), end4_(g4.end()), current4_(current4)    {
14059       ComputeCurrentValue();
14060     }
14061     virtual ~Iterator() {}
14062 
14063     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14064       return base_;
14065     }
14066     // Advance should not be called on beyond-of-range iterators
14067     // so no component iterators must be beyond end of range, either.
14068     virtual void Advance() {
14069       assert(!AtEnd());
14070       ++current4_;
14071       if (current4_ == end4_) {
14072         current4_ = begin4_;
14073         ++current3_;
14074       }
14075       if (current3_ == end3_) {
14076         current3_ = begin3_;
14077         ++current2_;
14078       }
14079       if (current2_ == end2_) {
14080         current2_ = begin2_;
14081         ++current1_;
14082       }
14083       ComputeCurrentValue();
14084     }
14085     virtual ParamIteratorInterface<ParamType>* Clone() const {
14086       return new Iterator(*this);
14087     }
14088     virtual const ParamType* Current() const { return &current_value_; }
14089     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14090       // Having the same base generator guarantees that the other
14091       // iterator is of the same type and we can downcast.
14092       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14093           << "The program attempted to compare iterators "
14094           << "from different generators." << std::endl;
14095       const Iterator* typed_other =
14096           CheckedDowncastToActualType<const Iterator>(&other);
14097       // We must report iterators equal if they both point beyond their
14098       // respective ranges. That can happen in a variety of fashions,
14099       // so we have to consult AtEnd().
14100       return (AtEnd() && typed_other->AtEnd()) ||
14101          (
14102           current1_ == typed_other->current1_ &&
14103           current2_ == typed_other->current2_ &&
14104           current3_ == typed_other->current3_ &&
14105           current4_ == typed_other->current4_);
14106     }
14107 
14108    private:
14109     Iterator(const Iterator& other)
14110         : base_(other.base_),
14111         begin1_(other.begin1_),
14112         end1_(other.end1_),
14113         current1_(other.current1_),
14114         begin2_(other.begin2_),
14115         end2_(other.end2_),
14116         current2_(other.current2_),
14117         begin3_(other.begin3_),
14118         end3_(other.end3_),
14119         current3_(other.current3_),
14120         begin4_(other.begin4_),
14121         end4_(other.end4_),
14122         current4_(other.current4_) {
14123       ComputeCurrentValue();
14124     }
14125 
14126     void ComputeCurrentValue() {
14127       if (!AtEnd())
14128         current_value_ = ParamType(*current1_, *current2_, *current3_,
14129             *current4_);
14130     }
14131     bool AtEnd() const {
14132       // We must report iterator past the end of the range when either of the
14133       // component iterators has reached the end of its range.
14134       return
14135           current1_ == end1_ ||
14136           current2_ == end2_ ||
14137           current3_ == end3_ ||
14138           current4_ == end4_;
14139     }
14140 
14141     // No implementation - assignment is unsupported.
14142     void operator=(const Iterator& other);
14143 
14144     const ParamGeneratorInterface<ParamType>* const base_;
14145     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14146     // current[i]_ is the actual traversing iterator.
14147     const typename ParamGenerator<T1>::iterator begin1_;
14148     const typename ParamGenerator<T1>::iterator end1_;
14149     typename ParamGenerator<T1>::iterator current1_;
14150     const typename ParamGenerator<T2>::iterator begin2_;
14151     const typename ParamGenerator<T2>::iterator end2_;
14152     typename ParamGenerator<T2>::iterator current2_;
14153     const typename ParamGenerator<T3>::iterator begin3_;
14154     const typename ParamGenerator<T3>::iterator end3_;
14155     typename ParamGenerator<T3>::iterator current3_;
14156     const typename ParamGenerator<T4>::iterator begin4_;
14157     const typename ParamGenerator<T4>::iterator end4_;
14158     typename ParamGenerator<T4>::iterator current4_;
14159     ParamType current_value_;
14160   };  // class CartesianProductGenerator4::Iterator
14161 
14162   // No implementation - assignment is unsupported.
14163   void operator=(const CartesianProductGenerator4& other);
14164 
14165   const ParamGenerator<T1> g1_;
14166   const ParamGenerator<T2> g2_;
14167   const ParamGenerator<T3> g3_;
14168   const ParamGenerator<T4> g4_;
14169 };  // class CartesianProductGenerator4
14170 
14171 
14172 template <typename T1, typename T2, typename T3, typename T4, typename T5>
14173 class CartesianProductGenerator5
14174     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
14175  public:
14176   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
14177 
14178   CartesianProductGenerator5(const ParamGenerator<T1>& g1,
14179       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14180       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
14181       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
14182   virtual ~CartesianProductGenerator5() {}
14183 
14184   virtual ParamIteratorInterface<ParamType>* Begin() const {
14185     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14186         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
14187   }
14188   virtual ParamIteratorInterface<ParamType>* End() const {
14189     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14190         g4_, g4_.end(), g5_, g5_.end());
14191   }
14192 
14193  private:
14194   class Iterator : public ParamIteratorInterface<ParamType> {
14195    public:
14196     Iterator(const ParamGeneratorInterface<ParamType>* base,
14197       const ParamGenerator<T1>& g1,
14198       const typename ParamGenerator<T1>::iterator& current1,
14199       const ParamGenerator<T2>& g2,
14200       const typename ParamGenerator<T2>::iterator& current2,
14201       const ParamGenerator<T3>& g3,
14202       const typename ParamGenerator<T3>::iterator& current3,
14203       const ParamGenerator<T4>& g4,
14204       const typename ParamGenerator<T4>::iterator& current4,
14205       const ParamGenerator<T5>& g5,
14206       const typename ParamGenerator<T5>::iterator& current5)
14207         : base_(base),
14208           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14209           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14210           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14211           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14212           begin5_(g5.begin()), end5_(g5.end()), current5_(current5)    {
14213       ComputeCurrentValue();
14214     }
14215     virtual ~Iterator() {}
14216 
14217     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14218       return base_;
14219     }
14220     // Advance should not be called on beyond-of-range iterators
14221     // so no component iterators must be beyond end of range, either.
14222     virtual void Advance() {
14223       assert(!AtEnd());
14224       ++current5_;
14225       if (current5_ == end5_) {
14226         current5_ = begin5_;
14227         ++current4_;
14228       }
14229       if (current4_ == end4_) {
14230         current4_ = begin4_;
14231         ++current3_;
14232       }
14233       if (current3_ == end3_) {
14234         current3_ = begin3_;
14235         ++current2_;
14236       }
14237       if (current2_ == end2_) {
14238         current2_ = begin2_;
14239         ++current1_;
14240       }
14241       ComputeCurrentValue();
14242     }
14243     virtual ParamIteratorInterface<ParamType>* Clone() const {
14244       return new Iterator(*this);
14245     }
14246     virtual const ParamType* Current() const { return &current_value_; }
14247     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14248       // Having the same base generator guarantees that the other
14249       // iterator is of the same type and we can downcast.
14250       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14251           << "The program attempted to compare iterators "
14252           << "from different generators." << std::endl;
14253       const Iterator* typed_other =
14254           CheckedDowncastToActualType<const Iterator>(&other);
14255       // We must report iterators equal if they both point beyond their
14256       // respective ranges. That can happen in a variety of fashions,
14257       // so we have to consult AtEnd().
14258       return (AtEnd() && typed_other->AtEnd()) ||
14259          (
14260           current1_ == typed_other->current1_ &&
14261           current2_ == typed_other->current2_ &&
14262           current3_ == typed_other->current3_ &&
14263           current4_ == typed_other->current4_ &&
14264           current5_ == typed_other->current5_);
14265     }
14266 
14267    private:
14268     Iterator(const Iterator& other)
14269         : base_(other.base_),
14270         begin1_(other.begin1_),
14271         end1_(other.end1_),
14272         current1_(other.current1_),
14273         begin2_(other.begin2_),
14274         end2_(other.end2_),
14275         current2_(other.current2_),
14276         begin3_(other.begin3_),
14277         end3_(other.end3_),
14278         current3_(other.current3_),
14279         begin4_(other.begin4_),
14280         end4_(other.end4_),
14281         current4_(other.current4_),
14282         begin5_(other.begin5_),
14283         end5_(other.end5_),
14284         current5_(other.current5_) {
14285       ComputeCurrentValue();
14286     }
14287 
14288     void ComputeCurrentValue() {
14289       if (!AtEnd())
14290         current_value_ = ParamType(*current1_, *current2_, *current3_,
14291             *current4_, *current5_);
14292     }
14293     bool AtEnd() const {
14294       // We must report iterator past the end of the range when either of the
14295       // component iterators has reached the end of its range.
14296       return
14297           current1_ == end1_ ||
14298           current2_ == end2_ ||
14299           current3_ == end3_ ||
14300           current4_ == end4_ ||
14301           current5_ == end5_;
14302     }
14303 
14304     // No implementation - assignment is unsupported.
14305     void operator=(const Iterator& other);
14306 
14307     const ParamGeneratorInterface<ParamType>* const base_;
14308     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14309     // current[i]_ is the actual traversing iterator.
14310     const typename ParamGenerator<T1>::iterator begin1_;
14311     const typename ParamGenerator<T1>::iterator end1_;
14312     typename ParamGenerator<T1>::iterator current1_;
14313     const typename ParamGenerator<T2>::iterator begin2_;
14314     const typename ParamGenerator<T2>::iterator end2_;
14315     typename ParamGenerator<T2>::iterator current2_;
14316     const typename ParamGenerator<T3>::iterator begin3_;
14317     const typename ParamGenerator<T3>::iterator end3_;
14318     typename ParamGenerator<T3>::iterator current3_;
14319     const typename ParamGenerator<T4>::iterator begin4_;
14320     const typename ParamGenerator<T4>::iterator end4_;
14321     typename ParamGenerator<T4>::iterator current4_;
14322     const typename ParamGenerator<T5>::iterator begin5_;
14323     const typename ParamGenerator<T5>::iterator end5_;
14324     typename ParamGenerator<T5>::iterator current5_;
14325     ParamType current_value_;
14326   };  // class CartesianProductGenerator5::Iterator
14327 
14328   // No implementation - assignment is unsupported.
14329   void operator=(const CartesianProductGenerator5& other);
14330 
14331   const ParamGenerator<T1> g1_;
14332   const ParamGenerator<T2> g2_;
14333   const ParamGenerator<T3> g3_;
14334   const ParamGenerator<T4> g4_;
14335   const ParamGenerator<T5> g5_;
14336 };  // class CartesianProductGenerator5
14337 
14338 
14339 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14340     typename T6>
14341 class CartesianProductGenerator6
14342     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
14343         T6> > {
14344  public:
14345   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
14346 
14347   CartesianProductGenerator6(const ParamGenerator<T1>& g1,
14348       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14349       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14350       const ParamGenerator<T6>& g6)
14351       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
14352   virtual ~CartesianProductGenerator6() {}
14353 
14354   virtual ParamIteratorInterface<ParamType>* Begin() const {
14355     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14356         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
14357   }
14358   virtual ParamIteratorInterface<ParamType>* End() const {
14359     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14360         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
14361   }
14362 
14363  private:
14364   class Iterator : public ParamIteratorInterface<ParamType> {
14365    public:
14366     Iterator(const ParamGeneratorInterface<ParamType>* base,
14367       const ParamGenerator<T1>& g1,
14368       const typename ParamGenerator<T1>::iterator& current1,
14369       const ParamGenerator<T2>& g2,
14370       const typename ParamGenerator<T2>::iterator& current2,
14371       const ParamGenerator<T3>& g3,
14372       const typename ParamGenerator<T3>::iterator& current3,
14373       const ParamGenerator<T4>& g4,
14374       const typename ParamGenerator<T4>::iterator& current4,
14375       const ParamGenerator<T5>& g5,
14376       const typename ParamGenerator<T5>::iterator& current5,
14377       const ParamGenerator<T6>& g6,
14378       const typename ParamGenerator<T6>::iterator& current6)
14379         : base_(base),
14380           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14381           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14382           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14383           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14384           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14385           begin6_(g6.begin()), end6_(g6.end()), current6_(current6)    {
14386       ComputeCurrentValue();
14387     }
14388     virtual ~Iterator() {}
14389 
14390     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14391       return base_;
14392     }
14393     // Advance should not be called on beyond-of-range iterators
14394     // so no component iterators must be beyond end of range, either.
14395     virtual void Advance() {
14396       assert(!AtEnd());
14397       ++current6_;
14398       if (current6_ == end6_) {
14399         current6_ = begin6_;
14400         ++current5_;
14401       }
14402       if (current5_ == end5_) {
14403         current5_ = begin5_;
14404         ++current4_;
14405       }
14406       if (current4_ == end4_) {
14407         current4_ = begin4_;
14408         ++current3_;
14409       }
14410       if (current3_ == end3_) {
14411         current3_ = begin3_;
14412         ++current2_;
14413       }
14414       if (current2_ == end2_) {
14415         current2_ = begin2_;
14416         ++current1_;
14417       }
14418       ComputeCurrentValue();
14419     }
14420     virtual ParamIteratorInterface<ParamType>* Clone() const {
14421       return new Iterator(*this);
14422     }
14423     virtual const ParamType* Current() const { return &current_value_; }
14424     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14425       // Having the same base generator guarantees that the other
14426       // iterator is of the same type and we can downcast.
14427       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14428           << "The program attempted to compare iterators "
14429           << "from different generators." << std::endl;
14430       const Iterator* typed_other =
14431           CheckedDowncastToActualType<const Iterator>(&other);
14432       // We must report iterators equal if they both point beyond their
14433       // respective ranges. That can happen in a variety of fashions,
14434       // so we have to consult AtEnd().
14435       return (AtEnd() && typed_other->AtEnd()) ||
14436          (
14437           current1_ == typed_other->current1_ &&
14438           current2_ == typed_other->current2_ &&
14439           current3_ == typed_other->current3_ &&
14440           current4_ == typed_other->current4_ &&
14441           current5_ == typed_other->current5_ &&
14442           current6_ == typed_other->current6_);
14443     }
14444 
14445    private:
14446     Iterator(const Iterator& other)
14447         : base_(other.base_),
14448         begin1_(other.begin1_),
14449         end1_(other.end1_),
14450         current1_(other.current1_),
14451         begin2_(other.begin2_),
14452         end2_(other.end2_),
14453         current2_(other.current2_),
14454         begin3_(other.begin3_),
14455         end3_(other.end3_),
14456         current3_(other.current3_),
14457         begin4_(other.begin4_),
14458         end4_(other.end4_),
14459         current4_(other.current4_),
14460         begin5_(other.begin5_),
14461         end5_(other.end5_),
14462         current5_(other.current5_),
14463         begin6_(other.begin6_),
14464         end6_(other.end6_),
14465         current6_(other.current6_) {
14466       ComputeCurrentValue();
14467     }
14468 
14469     void ComputeCurrentValue() {
14470       if (!AtEnd())
14471         current_value_ = ParamType(*current1_, *current2_, *current3_,
14472             *current4_, *current5_, *current6_);
14473     }
14474     bool AtEnd() const {
14475       // We must report iterator past the end of the range when either of the
14476       // component iterators has reached the end of its range.
14477       return
14478           current1_ == end1_ ||
14479           current2_ == end2_ ||
14480           current3_ == end3_ ||
14481           current4_ == end4_ ||
14482           current5_ == end5_ ||
14483           current6_ == end6_;
14484     }
14485 
14486     // No implementation - assignment is unsupported.
14487     void operator=(const Iterator& other);
14488 
14489     const ParamGeneratorInterface<ParamType>* const base_;
14490     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14491     // current[i]_ is the actual traversing iterator.
14492     const typename ParamGenerator<T1>::iterator begin1_;
14493     const typename ParamGenerator<T1>::iterator end1_;
14494     typename ParamGenerator<T1>::iterator current1_;
14495     const typename ParamGenerator<T2>::iterator begin2_;
14496     const typename ParamGenerator<T2>::iterator end2_;
14497     typename ParamGenerator<T2>::iterator current2_;
14498     const typename ParamGenerator<T3>::iterator begin3_;
14499     const typename ParamGenerator<T3>::iterator end3_;
14500     typename ParamGenerator<T3>::iterator current3_;
14501     const typename ParamGenerator<T4>::iterator begin4_;
14502     const typename ParamGenerator<T4>::iterator end4_;
14503     typename ParamGenerator<T4>::iterator current4_;
14504     const typename ParamGenerator<T5>::iterator begin5_;
14505     const typename ParamGenerator<T5>::iterator end5_;
14506     typename ParamGenerator<T5>::iterator current5_;
14507     const typename ParamGenerator<T6>::iterator begin6_;
14508     const typename ParamGenerator<T6>::iterator end6_;
14509     typename ParamGenerator<T6>::iterator current6_;
14510     ParamType current_value_;
14511   };  // class CartesianProductGenerator6::Iterator
14512 
14513   // No implementation - assignment is unsupported.
14514   void operator=(const CartesianProductGenerator6& other);
14515 
14516   const ParamGenerator<T1> g1_;
14517   const ParamGenerator<T2> g2_;
14518   const ParamGenerator<T3> g3_;
14519   const ParamGenerator<T4> g4_;
14520   const ParamGenerator<T5> g5_;
14521   const ParamGenerator<T6> g6_;
14522 };  // class CartesianProductGenerator6
14523 
14524 
14525 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14526     typename T6, typename T7>
14527 class CartesianProductGenerator7
14528     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14529         T7> > {
14530  public:
14531   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
14532 
14533   CartesianProductGenerator7(const ParamGenerator<T1>& g1,
14534       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14535       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14536       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
14537       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
14538   virtual ~CartesianProductGenerator7() {}
14539 
14540   virtual ParamIteratorInterface<ParamType>* Begin() const {
14541     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14542         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14543         g7_.begin());
14544   }
14545   virtual ParamIteratorInterface<ParamType>* End() const {
14546     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14547         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
14548   }
14549 
14550  private:
14551   class Iterator : public ParamIteratorInterface<ParamType> {
14552    public:
14553     Iterator(const ParamGeneratorInterface<ParamType>* base,
14554       const ParamGenerator<T1>& g1,
14555       const typename ParamGenerator<T1>::iterator& current1,
14556       const ParamGenerator<T2>& g2,
14557       const typename ParamGenerator<T2>::iterator& current2,
14558       const ParamGenerator<T3>& g3,
14559       const typename ParamGenerator<T3>::iterator& current3,
14560       const ParamGenerator<T4>& g4,
14561       const typename ParamGenerator<T4>::iterator& current4,
14562       const ParamGenerator<T5>& g5,
14563       const typename ParamGenerator<T5>::iterator& current5,
14564       const ParamGenerator<T6>& g6,
14565       const typename ParamGenerator<T6>::iterator& current6,
14566       const ParamGenerator<T7>& g7,
14567       const typename ParamGenerator<T7>::iterator& current7)
14568         : base_(base),
14569           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14570           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14571           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14572           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14573           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14574           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14575           begin7_(g7.begin()), end7_(g7.end()), current7_(current7)    {
14576       ComputeCurrentValue();
14577     }
14578     virtual ~Iterator() {}
14579 
14580     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14581       return base_;
14582     }
14583     // Advance should not be called on beyond-of-range iterators
14584     // so no component iterators must be beyond end of range, either.
14585     virtual void Advance() {
14586       assert(!AtEnd());
14587       ++current7_;
14588       if (current7_ == end7_) {
14589         current7_ = begin7_;
14590         ++current6_;
14591       }
14592       if (current6_ == end6_) {
14593         current6_ = begin6_;
14594         ++current5_;
14595       }
14596       if (current5_ == end5_) {
14597         current5_ = begin5_;
14598         ++current4_;
14599       }
14600       if (current4_ == end4_) {
14601         current4_ = begin4_;
14602         ++current3_;
14603       }
14604       if (current3_ == end3_) {
14605         current3_ = begin3_;
14606         ++current2_;
14607       }
14608       if (current2_ == end2_) {
14609         current2_ = begin2_;
14610         ++current1_;
14611       }
14612       ComputeCurrentValue();
14613     }
14614     virtual ParamIteratorInterface<ParamType>* Clone() const {
14615       return new Iterator(*this);
14616     }
14617     virtual const ParamType* Current() const { return &current_value_; }
14618     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14619       // Having the same base generator guarantees that the other
14620       // iterator is of the same type and we can downcast.
14621       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14622           << "The program attempted to compare iterators "
14623           << "from different generators." << std::endl;
14624       const Iterator* typed_other =
14625           CheckedDowncastToActualType<const Iterator>(&other);
14626       // We must report iterators equal if they both point beyond their
14627       // respective ranges. That can happen in a variety of fashions,
14628       // so we have to consult AtEnd().
14629       return (AtEnd() && typed_other->AtEnd()) ||
14630          (
14631           current1_ == typed_other->current1_ &&
14632           current2_ == typed_other->current2_ &&
14633           current3_ == typed_other->current3_ &&
14634           current4_ == typed_other->current4_ &&
14635           current5_ == typed_other->current5_ &&
14636           current6_ == typed_other->current6_ &&
14637           current7_ == typed_other->current7_);
14638     }
14639 
14640    private:
14641     Iterator(const Iterator& other)
14642         : base_(other.base_),
14643         begin1_(other.begin1_),
14644         end1_(other.end1_),
14645         current1_(other.current1_),
14646         begin2_(other.begin2_),
14647         end2_(other.end2_),
14648         current2_(other.current2_),
14649         begin3_(other.begin3_),
14650         end3_(other.end3_),
14651         current3_(other.current3_),
14652         begin4_(other.begin4_),
14653         end4_(other.end4_),
14654         current4_(other.current4_),
14655         begin5_(other.begin5_),
14656         end5_(other.end5_),
14657         current5_(other.current5_),
14658         begin6_(other.begin6_),
14659         end6_(other.end6_),
14660         current6_(other.current6_),
14661         begin7_(other.begin7_),
14662         end7_(other.end7_),
14663         current7_(other.current7_) {
14664       ComputeCurrentValue();
14665     }
14666 
14667     void ComputeCurrentValue() {
14668       if (!AtEnd())
14669         current_value_ = ParamType(*current1_, *current2_, *current3_,
14670             *current4_, *current5_, *current6_, *current7_);
14671     }
14672     bool AtEnd() const {
14673       // We must report iterator past the end of the range when either of the
14674       // component iterators has reached the end of its range.
14675       return
14676           current1_ == end1_ ||
14677           current2_ == end2_ ||
14678           current3_ == end3_ ||
14679           current4_ == end4_ ||
14680           current5_ == end5_ ||
14681           current6_ == end6_ ||
14682           current7_ == end7_;
14683     }
14684 
14685     // No implementation - assignment is unsupported.
14686     void operator=(const Iterator& other);
14687 
14688     const ParamGeneratorInterface<ParamType>* const base_;
14689     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14690     // current[i]_ is the actual traversing iterator.
14691     const typename ParamGenerator<T1>::iterator begin1_;
14692     const typename ParamGenerator<T1>::iterator end1_;
14693     typename ParamGenerator<T1>::iterator current1_;
14694     const typename ParamGenerator<T2>::iterator begin2_;
14695     const typename ParamGenerator<T2>::iterator end2_;
14696     typename ParamGenerator<T2>::iterator current2_;
14697     const typename ParamGenerator<T3>::iterator begin3_;
14698     const typename ParamGenerator<T3>::iterator end3_;
14699     typename ParamGenerator<T3>::iterator current3_;
14700     const typename ParamGenerator<T4>::iterator begin4_;
14701     const typename ParamGenerator<T4>::iterator end4_;
14702     typename ParamGenerator<T4>::iterator current4_;
14703     const typename ParamGenerator<T5>::iterator begin5_;
14704     const typename ParamGenerator<T5>::iterator end5_;
14705     typename ParamGenerator<T5>::iterator current5_;
14706     const typename ParamGenerator<T6>::iterator begin6_;
14707     const typename ParamGenerator<T6>::iterator end6_;
14708     typename ParamGenerator<T6>::iterator current6_;
14709     const typename ParamGenerator<T7>::iterator begin7_;
14710     const typename ParamGenerator<T7>::iterator end7_;
14711     typename ParamGenerator<T7>::iterator current7_;
14712     ParamType current_value_;
14713   };  // class CartesianProductGenerator7::Iterator
14714 
14715   // No implementation - assignment is unsupported.
14716   void operator=(const CartesianProductGenerator7& other);
14717 
14718   const ParamGenerator<T1> g1_;
14719   const ParamGenerator<T2> g2_;
14720   const ParamGenerator<T3> g3_;
14721   const ParamGenerator<T4> g4_;
14722   const ParamGenerator<T5> g5_;
14723   const ParamGenerator<T6> g6_;
14724   const ParamGenerator<T7> g7_;
14725 };  // class CartesianProductGenerator7
14726 
14727 
14728 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14729     typename T6, typename T7, typename T8>
14730 class CartesianProductGenerator8
14731     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14732         T7, T8> > {
14733  public:
14734   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
14735 
14736   CartesianProductGenerator8(const ParamGenerator<T1>& g1,
14737       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14738       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14739       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14740       const ParamGenerator<T8>& g8)
14741       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
14742           g8_(g8) {}
14743   virtual ~CartesianProductGenerator8() {}
14744 
14745   virtual ParamIteratorInterface<ParamType>* Begin() const {
14746     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14747         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14748         g7_.begin(), g8_, g8_.begin());
14749   }
14750   virtual ParamIteratorInterface<ParamType>* End() const {
14751     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14752         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14753         g8_.end());
14754   }
14755 
14756  private:
14757   class Iterator : public ParamIteratorInterface<ParamType> {
14758    public:
14759     Iterator(const ParamGeneratorInterface<ParamType>* base,
14760       const ParamGenerator<T1>& g1,
14761       const typename ParamGenerator<T1>::iterator& current1,
14762       const ParamGenerator<T2>& g2,
14763       const typename ParamGenerator<T2>::iterator& current2,
14764       const ParamGenerator<T3>& g3,
14765       const typename ParamGenerator<T3>::iterator& current3,
14766       const ParamGenerator<T4>& g4,
14767       const typename ParamGenerator<T4>::iterator& current4,
14768       const ParamGenerator<T5>& g5,
14769       const typename ParamGenerator<T5>::iterator& current5,
14770       const ParamGenerator<T6>& g6,
14771       const typename ParamGenerator<T6>::iterator& current6,
14772       const ParamGenerator<T7>& g7,
14773       const typename ParamGenerator<T7>::iterator& current7,
14774       const ParamGenerator<T8>& g8,
14775       const typename ParamGenerator<T8>::iterator& current8)
14776         : base_(base),
14777           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
14778           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
14779           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
14780           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
14781           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
14782           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
14783           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
14784           begin8_(g8.begin()), end8_(g8.end()), current8_(current8)    {
14785       ComputeCurrentValue();
14786     }
14787     virtual ~Iterator() {}
14788 
14789     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
14790       return base_;
14791     }
14792     // Advance should not be called on beyond-of-range iterators
14793     // so no component iterators must be beyond end of range, either.
14794     virtual void Advance() {
14795       assert(!AtEnd());
14796       ++current8_;
14797       if (current8_ == end8_) {
14798         current8_ = begin8_;
14799         ++current7_;
14800       }
14801       if (current7_ == end7_) {
14802         current7_ = begin7_;
14803         ++current6_;
14804       }
14805       if (current6_ == end6_) {
14806         current6_ = begin6_;
14807         ++current5_;
14808       }
14809       if (current5_ == end5_) {
14810         current5_ = begin5_;
14811         ++current4_;
14812       }
14813       if (current4_ == end4_) {
14814         current4_ = begin4_;
14815         ++current3_;
14816       }
14817       if (current3_ == end3_) {
14818         current3_ = begin3_;
14819         ++current2_;
14820       }
14821       if (current2_ == end2_) {
14822         current2_ = begin2_;
14823         ++current1_;
14824       }
14825       ComputeCurrentValue();
14826     }
14827     virtual ParamIteratorInterface<ParamType>* Clone() const {
14828       return new Iterator(*this);
14829     }
14830     virtual const ParamType* Current() const { return &current_value_; }
14831     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
14832       // Having the same base generator guarantees that the other
14833       // iterator is of the same type and we can downcast.
14834       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
14835           << "The program attempted to compare iterators "
14836           << "from different generators." << std::endl;
14837       const Iterator* typed_other =
14838           CheckedDowncastToActualType<const Iterator>(&other);
14839       // We must report iterators equal if they both point beyond their
14840       // respective ranges. That can happen in a variety of fashions,
14841       // so we have to consult AtEnd().
14842       return (AtEnd() && typed_other->AtEnd()) ||
14843          (
14844           current1_ == typed_other->current1_ &&
14845           current2_ == typed_other->current2_ &&
14846           current3_ == typed_other->current3_ &&
14847           current4_ == typed_other->current4_ &&
14848           current5_ == typed_other->current5_ &&
14849           current6_ == typed_other->current6_ &&
14850           current7_ == typed_other->current7_ &&
14851           current8_ == typed_other->current8_);
14852     }
14853 
14854    private:
14855     Iterator(const Iterator& other)
14856         : base_(other.base_),
14857         begin1_(other.begin1_),
14858         end1_(other.end1_),
14859         current1_(other.current1_),
14860         begin2_(other.begin2_),
14861         end2_(other.end2_),
14862         current2_(other.current2_),
14863         begin3_(other.begin3_),
14864         end3_(other.end3_),
14865         current3_(other.current3_),
14866         begin4_(other.begin4_),
14867         end4_(other.end4_),
14868         current4_(other.current4_),
14869         begin5_(other.begin5_),
14870         end5_(other.end5_),
14871         current5_(other.current5_),
14872         begin6_(other.begin6_),
14873         end6_(other.end6_),
14874         current6_(other.current6_),
14875         begin7_(other.begin7_),
14876         end7_(other.end7_),
14877         current7_(other.current7_),
14878         begin8_(other.begin8_),
14879         end8_(other.end8_),
14880         current8_(other.current8_) {
14881       ComputeCurrentValue();
14882     }
14883 
14884     void ComputeCurrentValue() {
14885       if (!AtEnd())
14886         current_value_ = ParamType(*current1_, *current2_, *current3_,
14887             *current4_, *current5_, *current6_, *current7_, *current8_);
14888     }
14889     bool AtEnd() const {
14890       // We must report iterator past the end of the range when either of the
14891       // component iterators has reached the end of its range.
14892       return
14893           current1_ == end1_ ||
14894           current2_ == end2_ ||
14895           current3_ == end3_ ||
14896           current4_ == end4_ ||
14897           current5_ == end5_ ||
14898           current6_ == end6_ ||
14899           current7_ == end7_ ||
14900           current8_ == end8_;
14901     }
14902 
14903     // No implementation - assignment is unsupported.
14904     void operator=(const Iterator& other);
14905 
14906     const ParamGeneratorInterface<ParamType>* const base_;
14907     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
14908     // current[i]_ is the actual traversing iterator.
14909     const typename ParamGenerator<T1>::iterator begin1_;
14910     const typename ParamGenerator<T1>::iterator end1_;
14911     typename ParamGenerator<T1>::iterator current1_;
14912     const typename ParamGenerator<T2>::iterator begin2_;
14913     const typename ParamGenerator<T2>::iterator end2_;
14914     typename ParamGenerator<T2>::iterator current2_;
14915     const typename ParamGenerator<T3>::iterator begin3_;
14916     const typename ParamGenerator<T3>::iterator end3_;
14917     typename ParamGenerator<T3>::iterator current3_;
14918     const typename ParamGenerator<T4>::iterator begin4_;
14919     const typename ParamGenerator<T4>::iterator end4_;
14920     typename ParamGenerator<T4>::iterator current4_;
14921     const typename ParamGenerator<T5>::iterator begin5_;
14922     const typename ParamGenerator<T5>::iterator end5_;
14923     typename ParamGenerator<T5>::iterator current5_;
14924     const typename ParamGenerator<T6>::iterator begin6_;
14925     const typename ParamGenerator<T6>::iterator end6_;
14926     typename ParamGenerator<T6>::iterator current6_;
14927     const typename ParamGenerator<T7>::iterator begin7_;
14928     const typename ParamGenerator<T7>::iterator end7_;
14929     typename ParamGenerator<T7>::iterator current7_;
14930     const typename ParamGenerator<T8>::iterator begin8_;
14931     const typename ParamGenerator<T8>::iterator end8_;
14932     typename ParamGenerator<T8>::iterator current8_;
14933     ParamType current_value_;
14934   };  // class CartesianProductGenerator8::Iterator
14935 
14936   // No implementation - assignment is unsupported.
14937   void operator=(const CartesianProductGenerator8& other);
14938 
14939   const ParamGenerator<T1> g1_;
14940   const ParamGenerator<T2> g2_;
14941   const ParamGenerator<T3> g3_;
14942   const ParamGenerator<T4> g4_;
14943   const ParamGenerator<T5> g5_;
14944   const ParamGenerator<T6> g6_;
14945   const ParamGenerator<T7> g7_;
14946   const ParamGenerator<T8> g8_;
14947 };  // class CartesianProductGenerator8
14948 
14949 
14950 template <typename T1, typename T2, typename T3, typename T4, typename T5,
14951     typename T6, typename T7, typename T8, typename T9>
14952 class CartesianProductGenerator9
14953     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
14954         T7, T8, T9> > {
14955  public:
14956   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
14957 
14958   CartesianProductGenerator9(const ParamGenerator<T1>& g1,
14959       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
14960       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
14961       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
14962       const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
14963       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
14964           g9_(g9) {}
14965   virtual ~CartesianProductGenerator9() {}
14966 
14967   virtual ParamIteratorInterface<ParamType>* Begin() const {
14968     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
14969         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
14970         g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
14971   }
14972   virtual ParamIteratorInterface<ParamType>* End() const {
14973     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
14974         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
14975         g8_.end(), g9_, g9_.end());
14976   }
14977 
14978  private:
14979   class Iterator : public ParamIteratorInterface<ParamType> {
14980    public:
14981     Iterator(const ParamGeneratorInterface<ParamType>* base,
14982       const ParamGenerator<T1>& g1,
14983       const typename ParamGenerator<T1>::iterator& current1,
14984       const ParamGenerator<T2>& g2,
14985       const typename ParamGenerator<T2>::iterator& current2,
14986       const ParamGenerator<T3>& g3,
14987       const typename ParamGenerator<T3>::iterator& current3,
14988       const ParamGenerator<T4>& g4,
14989       const typename ParamGenerator<T4>::iterator& current4,
14990       const ParamGenerator<T5>& g5,
14991       const typename ParamGenerator<T5>::iterator& current5,
14992       const ParamGenerator<T6>& g6,
14993       const typename ParamGenerator<T6>::iterator& current6,
14994       const ParamGenerator<T7>& g7,
14995       const typename ParamGenerator<T7>::iterator& current7,
14996       const ParamGenerator<T8>& g8,
14997       const typename ParamGenerator<T8>::iterator& current8,
14998       const ParamGenerator<T9>& g9,
14999       const typename ParamGenerator<T9>::iterator& current9)
15000         : base_(base),
15001           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15002           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15003           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15004           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15005           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15006           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15007           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15008           begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15009           begin9_(g9.begin()), end9_(g9.end()), current9_(current9)    {
15010       ComputeCurrentValue();
15011     }
15012     virtual ~Iterator() {}
15013 
15014     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15015       return base_;
15016     }
15017     // Advance should not be called on beyond-of-range iterators
15018     // so no component iterators must be beyond end of range, either.
15019     virtual void Advance() {
15020       assert(!AtEnd());
15021       ++current9_;
15022       if (current9_ == end9_) {
15023         current9_ = begin9_;
15024         ++current8_;
15025       }
15026       if (current8_ == end8_) {
15027         current8_ = begin8_;
15028         ++current7_;
15029       }
15030       if (current7_ == end7_) {
15031         current7_ = begin7_;
15032         ++current6_;
15033       }
15034       if (current6_ == end6_) {
15035         current6_ = begin6_;
15036         ++current5_;
15037       }
15038       if (current5_ == end5_) {
15039         current5_ = begin5_;
15040         ++current4_;
15041       }
15042       if (current4_ == end4_) {
15043         current4_ = begin4_;
15044         ++current3_;
15045       }
15046       if (current3_ == end3_) {
15047         current3_ = begin3_;
15048         ++current2_;
15049       }
15050       if (current2_ == end2_) {
15051         current2_ = begin2_;
15052         ++current1_;
15053       }
15054       ComputeCurrentValue();
15055     }
15056     virtual ParamIteratorInterface<ParamType>* Clone() const {
15057       return new Iterator(*this);
15058     }
15059     virtual const ParamType* Current() const { return &current_value_; }
15060     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15061       // Having the same base generator guarantees that the other
15062       // iterator is of the same type and we can downcast.
15063       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15064           << "The program attempted to compare iterators "
15065           << "from different generators." << std::endl;
15066       const Iterator* typed_other =
15067           CheckedDowncastToActualType<const Iterator>(&other);
15068       // We must report iterators equal if they both point beyond their
15069       // respective ranges. That can happen in a variety of fashions,
15070       // so we have to consult AtEnd().
15071       return (AtEnd() && typed_other->AtEnd()) ||
15072          (
15073           current1_ == typed_other->current1_ &&
15074           current2_ == typed_other->current2_ &&
15075           current3_ == typed_other->current3_ &&
15076           current4_ == typed_other->current4_ &&
15077           current5_ == typed_other->current5_ &&
15078           current6_ == typed_other->current6_ &&
15079           current7_ == typed_other->current7_ &&
15080           current8_ == typed_other->current8_ &&
15081           current9_ == typed_other->current9_);
15082     }
15083 
15084    private:
15085     Iterator(const Iterator& other)
15086         : base_(other.base_),
15087         begin1_(other.begin1_),
15088         end1_(other.end1_),
15089         current1_(other.current1_),
15090         begin2_(other.begin2_),
15091         end2_(other.end2_),
15092         current2_(other.current2_),
15093         begin3_(other.begin3_),
15094         end3_(other.end3_),
15095         current3_(other.current3_),
15096         begin4_(other.begin4_),
15097         end4_(other.end4_),
15098         current4_(other.current4_),
15099         begin5_(other.begin5_),
15100         end5_(other.end5_),
15101         current5_(other.current5_),
15102         begin6_(other.begin6_),
15103         end6_(other.end6_),
15104         current6_(other.current6_),
15105         begin7_(other.begin7_),
15106         end7_(other.end7_),
15107         current7_(other.current7_),
15108         begin8_(other.begin8_),
15109         end8_(other.end8_),
15110         current8_(other.current8_),
15111         begin9_(other.begin9_),
15112         end9_(other.end9_),
15113         current9_(other.current9_) {
15114       ComputeCurrentValue();
15115     }
15116 
15117     void ComputeCurrentValue() {
15118       if (!AtEnd())
15119         current_value_ = ParamType(*current1_, *current2_, *current3_,
15120             *current4_, *current5_, *current6_, *current7_, *current8_,
15121             *current9_);
15122     }
15123     bool AtEnd() const {
15124       // We must report iterator past the end of the range when either of the
15125       // component iterators has reached the end of its range.
15126       return
15127           current1_ == end1_ ||
15128           current2_ == end2_ ||
15129           current3_ == end3_ ||
15130           current4_ == end4_ ||
15131           current5_ == end5_ ||
15132           current6_ == end6_ ||
15133           current7_ == end7_ ||
15134           current8_ == end8_ ||
15135           current9_ == end9_;
15136     }
15137 
15138     // No implementation - assignment is unsupported.
15139     void operator=(const Iterator& other);
15140 
15141     const ParamGeneratorInterface<ParamType>* const base_;
15142     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15143     // current[i]_ is the actual traversing iterator.
15144     const typename ParamGenerator<T1>::iterator begin1_;
15145     const typename ParamGenerator<T1>::iterator end1_;
15146     typename ParamGenerator<T1>::iterator current1_;
15147     const typename ParamGenerator<T2>::iterator begin2_;
15148     const typename ParamGenerator<T2>::iterator end2_;
15149     typename ParamGenerator<T2>::iterator current2_;
15150     const typename ParamGenerator<T3>::iterator begin3_;
15151     const typename ParamGenerator<T3>::iterator end3_;
15152     typename ParamGenerator<T3>::iterator current3_;
15153     const typename ParamGenerator<T4>::iterator begin4_;
15154     const typename ParamGenerator<T4>::iterator end4_;
15155     typename ParamGenerator<T4>::iterator current4_;
15156     const typename ParamGenerator<T5>::iterator begin5_;
15157     const typename ParamGenerator<T5>::iterator end5_;
15158     typename ParamGenerator<T5>::iterator current5_;
15159     const typename ParamGenerator<T6>::iterator begin6_;
15160     const typename ParamGenerator<T6>::iterator end6_;
15161     typename ParamGenerator<T6>::iterator current6_;
15162     const typename ParamGenerator<T7>::iterator begin7_;
15163     const typename ParamGenerator<T7>::iterator end7_;
15164     typename ParamGenerator<T7>::iterator current7_;
15165     const typename ParamGenerator<T8>::iterator begin8_;
15166     const typename ParamGenerator<T8>::iterator end8_;
15167     typename ParamGenerator<T8>::iterator current8_;
15168     const typename ParamGenerator<T9>::iterator begin9_;
15169     const typename ParamGenerator<T9>::iterator end9_;
15170     typename ParamGenerator<T9>::iterator current9_;
15171     ParamType current_value_;
15172   };  // class CartesianProductGenerator9::Iterator
15173 
15174   // No implementation - assignment is unsupported.
15175   void operator=(const CartesianProductGenerator9& other);
15176 
15177   const ParamGenerator<T1> g1_;
15178   const ParamGenerator<T2> g2_;
15179   const ParamGenerator<T3> g3_;
15180   const ParamGenerator<T4> g4_;
15181   const ParamGenerator<T5> g5_;
15182   const ParamGenerator<T6> g6_;
15183   const ParamGenerator<T7> g7_;
15184   const ParamGenerator<T8> g8_;
15185   const ParamGenerator<T9> g9_;
15186 };  // class CartesianProductGenerator9
15187 
15188 
15189 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15190     typename T6, typename T7, typename T8, typename T9, typename T10>
15191 class CartesianProductGenerator10
15192     : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15193         T7, T8, T9, T10> > {
15194  public:
15195   typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
15196 
15197   CartesianProductGenerator10(const ParamGenerator<T1>& g1,
15198       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
15199       const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
15200       const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
15201       const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
15202       const ParamGenerator<T10>& g10)
15203       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15204           g9_(g9), g10_(g10) {}
15205   virtual ~CartesianProductGenerator10() {}
15206 
15207   virtual ParamIteratorInterface<ParamType>* Begin() const {
15208     return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
15209         g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
15210         g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
15211   }
15212   virtual ParamIteratorInterface<ParamType>* End() const {
15213     return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
15214         g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
15215         g8_.end(), g9_, g9_.end(), g10_, g10_.end());
15216   }
15217 
15218  private:
15219   class Iterator : public ParamIteratorInterface<ParamType> {
15220    public:
15221     Iterator(const ParamGeneratorInterface<ParamType>* base,
15222       const ParamGenerator<T1>& g1,
15223       const typename ParamGenerator<T1>::iterator& current1,
15224       const ParamGenerator<T2>& g2,
15225       const typename ParamGenerator<T2>::iterator& current2,
15226       const ParamGenerator<T3>& g3,
15227       const typename ParamGenerator<T3>::iterator& current3,
15228       const ParamGenerator<T4>& g4,
15229       const typename ParamGenerator<T4>::iterator& current4,
15230       const ParamGenerator<T5>& g5,
15231       const typename ParamGenerator<T5>::iterator& current5,
15232       const ParamGenerator<T6>& g6,
15233       const typename ParamGenerator<T6>::iterator& current6,
15234       const ParamGenerator<T7>& g7,
15235       const typename ParamGenerator<T7>::iterator& current7,
15236       const ParamGenerator<T8>& g8,
15237       const typename ParamGenerator<T8>::iterator& current8,
15238       const ParamGenerator<T9>& g9,
15239       const typename ParamGenerator<T9>::iterator& current9,
15240       const ParamGenerator<T10>& g10,
15241       const typename ParamGenerator<T10>::iterator& current10)
15242         : base_(base),
15243           begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
15244           begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
15245           begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
15246           begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
15247           begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
15248           begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
15249           begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
15250           begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
15251           begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
15252           begin10_(g10.begin()), end10_(g10.end()), current10_(current10)    {
15253       ComputeCurrentValue();
15254     }
15255     virtual ~Iterator() {}
15256 
15257     virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
15258       return base_;
15259     }
15260     // Advance should not be called on beyond-of-range iterators
15261     // so no component iterators must be beyond end of range, either.
15262     virtual void Advance() {
15263       assert(!AtEnd());
15264       ++current10_;
15265       if (current10_ == end10_) {
15266         current10_ = begin10_;
15267         ++current9_;
15268       }
15269       if (current9_ == end9_) {
15270         current9_ = begin9_;
15271         ++current8_;
15272       }
15273       if (current8_ == end8_) {
15274         current8_ = begin8_;
15275         ++current7_;
15276       }
15277       if (current7_ == end7_) {
15278         current7_ = begin7_;
15279         ++current6_;
15280       }
15281       if (current6_ == end6_) {
15282         current6_ = begin6_;
15283         ++current5_;
15284       }
15285       if (current5_ == end5_) {
15286         current5_ = begin5_;
15287         ++current4_;
15288       }
15289       if (current4_ == end4_) {
15290         current4_ = begin4_;
15291         ++current3_;
15292       }
15293       if (current3_ == end3_) {
15294         current3_ = begin3_;
15295         ++current2_;
15296       }
15297       if (current2_ == end2_) {
15298         current2_ = begin2_;
15299         ++current1_;
15300       }
15301       ComputeCurrentValue();
15302     }
15303     virtual ParamIteratorInterface<ParamType>* Clone() const {
15304       return new Iterator(*this);
15305     }
15306     virtual const ParamType* Current() const { return &current_value_; }
15307     virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
15308       // Having the same base generator guarantees that the other
15309       // iterator is of the same type and we can downcast.
15310       GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
15311           << "The program attempted to compare iterators "
15312           << "from different generators." << std::endl;
15313       const Iterator* typed_other =
15314           CheckedDowncastToActualType<const Iterator>(&other);
15315       // We must report iterators equal if they both point beyond their
15316       // respective ranges. That can happen in a variety of fashions,
15317       // so we have to consult AtEnd().
15318       return (AtEnd() && typed_other->AtEnd()) ||
15319          (
15320           current1_ == typed_other->current1_ &&
15321           current2_ == typed_other->current2_ &&
15322           current3_ == typed_other->current3_ &&
15323           current4_ == typed_other->current4_ &&
15324           current5_ == typed_other->current5_ &&
15325           current6_ == typed_other->current6_ &&
15326           current7_ == typed_other->current7_ &&
15327           current8_ == typed_other->current8_ &&
15328           current9_ == typed_other->current9_ &&
15329           current10_ == typed_other->current10_);
15330     }
15331 
15332    private:
15333     Iterator(const Iterator& other)
15334         : base_(other.base_),
15335         begin1_(other.begin1_),
15336         end1_(other.end1_),
15337         current1_(other.current1_),
15338         begin2_(other.begin2_),
15339         end2_(other.end2_),
15340         current2_(other.current2_),
15341         begin3_(other.begin3_),
15342         end3_(other.end3_),
15343         current3_(other.current3_),
15344         begin4_(other.begin4_),
15345         end4_(other.end4_),
15346         current4_(other.current4_),
15347         begin5_(other.begin5_),
15348         end5_(other.end5_),
15349         current5_(other.current5_),
15350         begin6_(other.begin6_),
15351         end6_(other.end6_),
15352         current6_(other.current6_),
15353         begin7_(other.begin7_),
15354         end7_(other.end7_),
15355         current7_(other.current7_),
15356         begin8_(other.begin8_),
15357         end8_(other.end8_),
15358         current8_(other.current8_),
15359         begin9_(other.begin9_),
15360         end9_(other.end9_),
15361         current9_(other.current9_),
15362         begin10_(other.begin10_),
15363         end10_(other.end10_),
15364         current10_(other.current10_) {
15365       ComputeCurrentValue();
15366     }
15367 
15368     void ComputeCurrentValue() {
15369       if (!AtEnd())
15370         current_value_ = ParamType(*current1_, *current2_, *current3_,
15371             *current4_, *current5_, *current6_, *current7_, *current8_,
15372             *current9_, *current10_);
15373     }
15374     bool AtEnd() const {
15375       // We must report iterator past the end of the range when either of the
15376       // component iterators has reached the end of its range.
15377       return
15378           current1_ == end1_ ||
15379           current2_ == end2_ ||
15380           current3_ == end3_ ||
15381           current4_ == end4_ ||
15382           current5_ == end5_ ||
15383           current6_ == end6_ ||
15384           current7_ == end7_ ||
15385           current8_ == end8_ ||
15386           current9_ == end9_ ||
15387           current10_ == end10_;
15388     }
15389 
15390     // No implementation - assignment is unsupported.
15391     void operator=(const Iterator& other);
15392 
15393     const ParamGeneratorInterface<ParamType>* const base_;
15394     // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
15395     // current[i]_ is the actual traversing iterator.
15396     const typename ParamGenerator<T1>::iterator begin1_;
15397     const typename ParamGenerator<T1>::iterator end1_;
15398     typename ParamGenerator<T1>::iterator current1_;
15399     const typename ParamGenerator<T2>::iterator begin2_;
15400     const typename ParamGenerator<T2>::iterator end2_;
15401     typename ParamGenerator<T2>::iterator current2_;
15402     const typename ParamGenerator<T3>::iterator begin3_;
15403     const typename ParamGenerator<T3>::iterator end3_;
15404     typename ParamGenerator<T3>::iterator current3_;
15405     const typename ParamGenerator<T4>::iterator begin4_;
15406     const typename ParamGenerator<T4>::iterator end4_;
15407     typename ParamGenerator<T4>::iterator current4_;
15408     const typename ParamGenerator<T5>::iterator begin5_;
15409     const typename ParamGenerator<T5>::iterator end5_;
15410     typename ParamGenerator<T5>::iterator current5_;
15411     const typename ParamGenerator<T6>::iterator begin6_;
15412     const typename ParamGenerator<T6>::iterator end6_;
15413     typename ParamGenerator<T6>::iterator current6_;
15414     const typename ParamGenerator<T7>::iterator begin7_;
15415     const typename ParamGenerator<T7>::iterator end7_;
15416     typename ParamGenerator<T7>::iterator current7_;
15417     const typename ParamGenerator<T8>::iterator begin8_;
15418     const typename ParamGenerator<T8>::iterator end8_;
15419     typename ParamGenerator<T8>::iterator current8_;
15420     const typename ParamGenerator<T9>::iterator begin9_;
15421     const typename ParamGenerator<T9>::iterator end9_;
15422     typename ParamGenerator<T9>::iterator current9_;
15423     const typename ParamGenerator<T10>::iterator begin10_;
15424     const typename ParamGenerator<T10>::iterator end10_;
15425     typename ParamGenerator<T10>::iterator current10_;
15426     ParamType current_value_;
15427   };  // class CartesianProductGenerator10::Iterator
15428 
15429   // No implementation - assignment is unsupported.
15430   void operator=(const CartesianProductGenerator10& other);
15431 
15432   const ParamGenerator<T1> g1_;
15433   const ParamGenerator<T2> g2_;
15434   const ParamGenerator<T3> g3_;
15435   const ParamGenerator<T4> g4_;
15436   const ParamGenerator<T5> g5_;
15437   const ParamGenerator<T6> g6_;
15438   const ParamGenerator<T7> g7_;
15439   const ParamGenerator<T8> g8_;
15440   const ParamGenerator<T9> g9_;
15441   const ParamGenerator<T10> g10_;
15442 };  // class CartesianProductGenerator10
15443 
15444 
15445 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
15446 //
15447 // Helper classes providing Combine() with polymorphic features. They allow
15448 // casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
15449 // convertible to U.
15450 //
15451 template <class Generator1, class Generator2>
15452 class CartesianProductHolder2 {
15453  public:
15454 CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
15455       : g1_(g1), g2_(g2) {}
15456   template <typename T1, typename T2>
15457   operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
15458     return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
15459         new CartesianProductGenerator2<T1, T2>(
15460         static_cast<ParamGenerator<T1> >(g1_),
15461         static_cast<ParamGenerator<T2> >(g2_)));
15462   }
15463 
15464  private:
15465   // No implementation - assignment is unsupported.
15466   void operator=(const CartesianProductHolder2& other);
15467 
15468   const Generator1 g1_;
15469   const Generator2 g2_;
15470 };  // class CartesianProductHolder2
15471 
15472 template <class Generator1, class Generator2, class Generator3>
15473 class CartesianProductHolder3 {
15474  public:
15475 CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
15476     const Generator3& g3)
15477       : g1_(g1), g2_(g2), g3_(g3) {}
15478   template <typename T1, typename T2, typename T3>
15479   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
15480     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
15481         new CartesianProductGenerator3<T1, T2, T3>(
15482         static_cast<ParamGenerator<T1> >(g1_),
15483         static_cast<ParamGenerator<T2> >(g2_),
15484         static_cast<ParamGenerator<T3> >(g3_)));
15485   }
15486 
15487  private:
15488   // No implementation - assignment is unsupported.
15489   void operator=(const CartesianProductHolder3& other);
15490 
15491   const Generator1 g1_;
15492   const Generator2 g2_;
15493   const Generator3 g3_;
15494 };  // class CartesianProductHolder3
15495 
15496 template <class Generator1, class Generator2, class Generator3,
15497     class Generator4>
15498 class CartesianProductHolder4 {
15499  public:
15500 CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
15501     const Generator3& g3, const Generator4& g4)
15502       : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
15503   template <typename T1, typename T2, typename T3, typename T4>
15504   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
15505     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
15506         new CartesianProductGenerator4<T1, T2, T3, T4>(
15507         static_cast<ParamGenerator<T1> >(g1_),
15508         static_cast<ParamGenerator<T2> >(g2_),
15509         static_cast<ParamGenerator<T3> >(g3_),
15510         static_cast<ParamGenerator<T4> >(g4_)));
15511   }
15512 
15513  private:
15514   // No implementation - assignment is unsupported.
15515   void operator=(const CartesianProductHolder4& other);
15516 
15517   const Generator1 g1_;
15518   const Generator2 g2_;
15519   const Generator3 g3_;
15520   const Generator4 g4_;
15521 };  // class CartesianProductHolder4
15522 
15523 template <class Generator1, class Generator2, class Generator3,
15524     class Generator4, class Generator5>
15525 class CartesianProductHolder5 {
15526  public:
15527 CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
15528     const Generator3& g3, const Generator4& g4, const Generator5& g5)
15529       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
15530   template <typename T1, typename T2, typename T3, typename T4, typename T5>
15531   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
15532     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
15533         new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
15534         static_cast<ParamGenerator<T1> >(g1_),
15535         static_cast<ParamGenerator<T2> >(g2_),
15536         static_cast<ParamGenerator<T3> >(g3_),
15537         static_cast<ParamGenerator<T4> >(g4_),
15538         static_cast<ParamGenerator<T5> >(g5_)));
15539   }
15540 
15541  private:
15542   // No implementation - assignment is unsupported.
15543   void operator=(const CartesianProductHolder5& other);
15544 
15545   const Generator1 g1_;
15546   const Generator2 g2_;
15547   const Generator3 g3_;
15548   const Generator4 g4_;
15549   const Generator5 g5_;
15550 };  // class CartesianProductHolder5
15551 
15552 template <class Generator1, class Generator2, class Generator3,
15553     class Generator4, class Generator5, class Generator6>
15554 class CartesianProductHolder6 {
15555  public:
15556 CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
15557     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15558     const Generator6& g6)
15559       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
15560   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15561       typename T6>
15562   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
15563     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
15564         new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
15565         static_cast<ParamGenerator<T1> >(g1_),
15566         static_cast<ParamGenerator<T2> >(g2_),
15567         static_cast<ParamGenerator<T3> >(g3_),
15568         static_cast<ParamGenerator<T4> >(g4_),
15569         static_cast<ParamGenerator<T5> >(g5_),
15570         static_cast<ParamGenerator<T6> >(g6_)));
15571   }
15572 
15573  private:
15574   // No implementation - assignment is unsupported.
15575   void operator=(const CartesianProductHolder6& other);
15576 
15577   const Generator1 g1_;
15578   const Generator2 g2_;
15579   const Generator3 g3_;
15580   const Generator4 g4_;
15581   const Generator5 g5_;
15582   const Generator6 g6_;
15583 };  // class CartesianProductHolder6
15584 
15585 template <class Generator1, class Generator2, class Generator3,
15586     class Generator4, class Generator5, class Generator6, class Generator7>
15587 class CartesianProductHolder7 {
15588  public:
15589 CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
15590     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15591     const Generator6& g6, const Generator7& g7)
15592       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
15593   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15594       typename T6, typename T7>
15595   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
15596       T7> >() const {
15597     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
15598         new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
15599         static_cast<ParamGenerator<T1> >(g1_),
15600         static_cast<ParamGenerator<T2> >(g2_),
15601         static_cast<ParamGenerator<T3> >(g3_),
15602         static_cast<ParamGenerator<T4> >(g4_),
15603         static_cast<ParamGenerator<T5> >(g5_),
15604         static_cast<ParamGenerator<T6> >(g6_),
15605         static_cast<ParamGenerator<T7> >(g7_)));
15606   }
15607 
15608  private:
15609   // No implementation - assignment is unsupported.
15610   void operator=(const CartesianProductHolder7& other);
15611 
15612   const Generator1 g1_;
15613   const Generator2 g2_;
15614   const Generator3 g3_;
15615   const Generator4 g4_;
15616   const Generator5 g5_;
15617   const Generator6 g6_;
15618   const Generator7 g7_;
15619 };  // class CartesianProductHolder7
15620 
15621 template <class Generator1, class Generator2, class Generator3,
15622     class Generator4, class Generator5, class Generator6, class Generator7,
15623     class Generator8>
15624 class CartesianProductHolder8 {
15625  public:
15626 CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
15627     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15628     const Generator6& g6, const Generator7& g7, const Generator8& g8)
15629       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
15630           g8_(g8) {}
15631   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15632       typename T6, typename T7, typename T8>
15633   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
15634       T8> >() const {
15635     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
15636         new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
15637         static_cast<ParamGenerator<T1> >(g1_),
15638         static_cast<ParamGenerator<T2> >(g2_),
15639         static_cast<ParamGenerator<T3> >(g3_),
15640         static_cast<ParamGenerator<T4> >(g4_),
15641         static_cast<ParamGenerator<T5> >(g5_),
15642         static_cast<ParamGenerator<T6> >(g6_),
15643         static_cast<ParamGenerator<T7> >(g7_),
15644         static_cast<ParamGenerator<T8> >(g8_)));
15645   }
15646 
15647  private:
15648   // No implementation - assignment is unsupported.
15649   void operator=(const CartesianProductHolder8& other);
15650 
15651   const Generator1 g1_;
15652   const Generator2 g2_;
15653   const Generator3 g3_;
15654   const Generator4 g4_;
15655   const Generator5 g5_;
15656   const Generator6 g6_;
15657   const Generator7 g7_;
15658   const Generator8 g8_;
15659 };  // class CartesianProductHolder8
15660 
15661 template <class Generator1, class Generator2, class Generator3,
15662     class Generator4, class Generator5, class Generator6, class Generator7,
15663     class Generator8, class Generator9>
15664 class CartesianProductHolder9 {
15665  public:
15666 CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
15667     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15668     const Generator6& g6, const Generator7& g7, const Generator8& g8,
15669     const Generator9& g9)
15670       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15671           g9_(g9) {}
15672   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15673       typename T6, typename T7, typename T8, typename T9>
15674   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15675       T9> >() const {
15676     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15677         T9> >(
15678         new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
15679         static_cast<ParamGenerator<T1> >(g1_),
15680         static_cast<ParamGenerator<T2> >(g2_),
15681         static_cast<ParamGenerator<T3> >(g3_),
15682         static_cast<ParamGenerator<T4> >(g4_),
15683         static_cast<ParamGenerator<T5> >(g5_),
15684         static_cast<ParamGenerator<T6> >(g6_),
15685         static_cast<ParamGenerator<T7> >(g7_),
15686         static_cast<ParamGenerator<T8> >(g8_),
15687         static_cast<ParamGenerator<T9> >(g9_)));
15688   }
15689 
15690  private:
15691   // No implementation - assignment is unsupported.
15692   void operator=(const CartesianProductHolder9& other);
15693 
15694   const Generator1 g1_;
15695   const Generator2 g2_;
15696   const Generator3 g3_;
15697   const Generator4 g4_;
15698   const Generator5 g5_;
15699   const Generator6 g6_;
15700   const Generator7 g7_;
15701   const Generator8 g8_;
15702   const Generator9 g9_;
15703 };  // class CartesianProductHolder9
15704 
15705 template <class Generator1, class Generator2, class Generator3,
15706     class Generator4, class Generator5, class Generator6, class Generator7,
15707     class Generator8, class Generator9, class Generator10>
15708 class CartesianProductHolder10 {
15709  public:
15710 CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
15711     const Generator3& g3, const Generator4& g4, const Generator5& g5,
15712     const Generator6& g6, const Generator7& g7, const Generator8& g8,
15713     const Generator9& g9, const Generator10& g10)
15714       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
15715           g9_(g9), g10_(g10) {}
15716   template <typename T1, typename T2, typename T3, typename T4, typename T5,
15717       typename T6, typename T7, typename T8, typename T9, typename T10>
15718   operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15719       T9, T10> >() const {
15720     return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
15721         T9, T10> >(
15722         new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
15723             T10>(
15724         static_cast<ParamGenerator<T1> >(g1_),
15725         static_cast<ParamGenerator<T2> >(g2_),
15726         static_cast<ParamGenerator<T3> >(g3_),
15727         static_cast<ParamGenerator<T4> >(g4_),
15728         static_cast<ParamGenerator<T5> >(g5_),
15729         static_cast<ParamGenerator<T6> >(g6_),
15730         static_cast<ParamGenerator<T7> >(g7_),
15731         static_cast<ParamGenerator<T8> >(g8_),
15732         static_cast<ParamGenerator<T9> >(g9_),
15733         static_cast<ParamGenerator<T10> >(g10_)));
15734   }
15735 
15736  private:
15737   // No implementation - assignment is unsupported.
15738   void operator=(const CartesianProductHolder10& other);
15739 
15740   const Generator1 g1_;
15741   const Generator2 g2_;
15742   const Generator3 g3_;
15743   const Generator4 g4_;
15744   const Generator5 g5_;
15745   const Generator6 g6_;
15746   const Generator7 g7_;
15747   const Generator8 g8_;
15748   const Generator9 g9_;
15749   const Generator10 g10_;
15750 };  // class CartesianProductHolder10
15751 
15752 # endif  // GTEST_HAS_COMBINE
15753 
15754 }  // namespace internal
15755 }  // namespace testing
15756 
15757 #endif  //  GTEST_HAS_PARAM_TEST
15758 
15759 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
15760 
15761 #if GTEST_HAS_PARAM_TEST
15762 
15763 namespace testing {
15764 
15765 // Functions producing parameter generators.
15766 //
15767 // Google Test uses these generators to produce parameters for value-
15768 // parameterized tests. When a parameterized test case is instantiated
15769 // with a particular generator, Google Test creates and runs tests
15770 // for each element in the sequence produced by the generator.
15771 //
15772 // In the following sample, tests from test case FooTest are instantiated
15773 // each three times with parameter values 3, 5, and 8:
15774 //
15775 // class FooTest : public TestWithParam<int> { ... };
15776 //
15777 // TEST_P(FooTest, TestThis) {
15778 // }
15779 // TEST_P(FooTest, TestThat) {
15780 // }
15781 // INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
15782 //
15783 
15784 // Range() returns generators providing sequences of values in a range.
15785 //
15786 // Synopsis:
15787 // Range(start, end)
15788 //   - returns a generator producing a sequence of values {start, start+1,
15789 //     start+2, ..., }.
15790 // Range(start, end, step)
15791 //   - returns a generator producing a sequence of values {start, start+step,
15792 //     start+step+step, ..., }.
15793 // Notes:
15794 //   * The generated sequences never include end. For example, Range(1, 5)
15795 //     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
15796 //     returns a generator producing {1, 3, 5, 7}.
15797 //   * start and end must have the same type. That type may be any integral or
15798 //     floating-point type or a user defined type satisfying these conditions:
15799 //     * It must be assignable (have operator=() defined).
15800 //     * It must have operator+() (operator+(int-compatible type) for
15801 //       two-operand version).
15802 //     * It must have operator<() defined.
15803 //     Elements in the resulting sequences will also have that type.
15804 //   * Condition start < end must be satisfied in order for resulting sequences
15805 //     to contain any elements.
15806 //
15807 template <typename T, typename IncrementT>
15808 internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
15809   return internal::ParamGenerator<T>(
15810       new internal::RangeGenerator<T, IncrementT>(start, end, step));
15811 }
15812 
15813 template <typename T>
15814 internal::ParamGenerator<T> Range(T start, T end) {
15815   return Range(start, end, 1);
15816 }
15817 
15818 // ValuesIn() function allows generation of tests with parameters coming from
15819 // a container.
15820 //
15821 // Synopsis:
15822 // ValuesIn(const T (&array)[N])
15823 //   - returns a generator producing sequences with elements from
15824 //     a C-style array.
15825 // ValuesIn(const Container& container)
15826 //   - returns a generator producing sequences with elements from
15827 //     an STL-style container.
15828 // ValuesIn(Iterator begin, Iterator end)
15829 //   - returns a generator producing sequences with elements from
15830 //     a range [begin, end) defined by a pair of STL-style iterators. These
15831 //     iterators can also be plain C pointers.
15832 //
15833 // Please note that ValuesIn copies the values from the containers
15834 // passed in and keeps them to generate tests in RUN_ALL_TESTS().
15835 //
15836 // Examples:
15837 //
15838 // This instantiates tests from test case StringTest
15839 // each with C-string values of "foo", "bar", and "baz":
15840 //
15841 // const char* strings[] = {"foo", "bar", "baz"};
15842 // INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
15843 //
15844 // This instantiates tests from test case StlStringTest
15845 // each with STL strings with values "a" and "b":
15846 //
15847 // ::std::vector< ::std::string> GetParameterStrings() {
15848 //   ::std::vector< ::std::string> v;
15849 //   v.push_back("a");
15850 //   v.push_back("b");
15851 //   return v;
15852 // }
15853 //
15854 // INSTANTIATE_TEST_CASE_P(CharSequence,
15855 //                         StlStringTest,
15856 //                         ValuesIn(GetParameterStrings()));
15857 //
15858 //
15859 // This will also instantiate tests from CharTest
15860 // each with parameter values 'a' and 'b':
15861 //
15862 // ::std::list<char> GetParameterChars() {
15863 //   ::std::list<char> list;
15864 //   list.push_back('a');
15865 //   list.push_back('b');
15866 //   return list;
15867 // }
15868 // ::std::list<char> l = GetParameterChars();
15869 // INSTANTIATE_TEST_CASE_P(CharSequence2,
15870 //                         CharTest,
15871 //                         ValuesIn(l.begin(), l.end()));
15872 //
15873 template <typename ForwardIterator>
15874 internal::ParamGenerator<
15875   typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
15876 ValuesIn(ForwardIterator begin, ForwardIterator end) {
15877   typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
15878       ::value_type ParamType;
15879   return internal::ParamGenerator<ParamType>(
15880       new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
15881 }
15882 
15883 template <typename T, size_t N>
15884 internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
15885   return ValuesIn(array, array + N);
15886 }
15887 
15888 template <class Container>
15889 internal::ParamGenerator<typename Container::value_type> ValuesIn(
15890     const Container& container) {
15891   return ValuesIn(container.begin(), container.end());
15892 }
15893 
15894 // Values() allows generating tests from explicitly specified list of
15895 // parameters.
15896 //
15897 // Synopsis:
15898 // Values(T v1, T v2, ..., T vN)
15899 //   - returns a generator producing sequences with elements v1, v2, ..., vN.
15900 //
15901 // For example, this instantiates tests from test case BarTest each
15902 // with values "one", "two", and "three":
15903 //
15904 // INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
15905 //
15906 // This instantiates tests from test case BazTest each with values 1, 2, 3.5.
15907 // The exact type of values will depend on the type of parameter in BazTest.
15908 //
15909 // INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
15910 //
15911 // Currently, Values() supports from 1 to 50 parameters.
15912 //
15913 template <typename T1>
15914 internal::ValueArray1<T1> Values(T1 v1) {
15915   return internal::ValueArray1<T1>(v1);
15916 }
15917 
15918 template <typename T1, typename T2>
15919 internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
15920   return internal::ValueArray2<T1, T2>(v1, v2);
15921 }
15922 
15923 template <typename T1, typename T2, typename T3>
15924 internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
15925   return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
15926 }
15927 
15928 template <typename T1, typename T2, typename T3, typename T4>
15929 internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
15930   return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
15931 }
15932 
15933 template <typename T1, typename T2, typename T3, typename T4, typename T5>
15934 internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
15935     T5 v5) {
15936   return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
15937 }
15938 
15939 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15940     typename T6>
15941 internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
15942     T4 v4, T5 v5, T6 v6) {
15943   return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
15944 }
15945 
15946 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15947     typename T6, typename T7>
15948 internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
15949     T4 v4, T5 v5, T6 v6, T7 v7) {
15950   return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
15951       v6, v7);
15952 }
15953 
15954 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15955     typename T6, typename T7, typename T8>
15956 internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
15957     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
15958   return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
15959       v5, v6, v7, v8);
15960 }
15961 
15962 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15963     typename T6, typename T7, typename T8, typename T9>
15964 internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
15965     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
15966   return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
15967       v4, v5, v6, v7, v8, v9);
15968 }
15969 
15970 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15971     typename T6, typename T7, typename T8, typename T9, typename T10>
15972 internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
15973     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
15974   return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
15975       v2, v3, v4, v5, v6, v7, v8, v9, v10);
15976 }
15977 
15978 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15979     typename T6, typename T7, typename T8, typename T9, typename T10,
15980     typename T11>
15981 internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
15982     T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15983     T10 v10, T11 v11) {
15984   return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
15985       T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
15986 }
15987 
15988 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15989     typename T6, typename T7, typename T8, typename T9, typename T10,
15990     typename T11, typename T12>
15991 internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15992     T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
15993     T10 v10, T11 v11, T12 v12) {
15994   return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
15995       T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
15996 }
15997 
15998 template <typename T1, typename T2, typename T3, typename T4, typename T5,
15999     typename T6, typename T7, typename T8, typename T9, typename T10,
16000     typename T11, typename T12, typename T13>
16001 internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
16002     T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16003     T10 v10, T11 v11, T12 v12, T13 v13) {
16004   return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16005       T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
16006 }
16007 
16008 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16009     typename T6, typename T7, typename T8, typename T9, typename T10,
16010     typename T11, typename T12, typename T13, typename T14>
16011 internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16012     T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16013     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
16014   return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16015       T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16016       v14);
16017 }
16018 
16019 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16020     typename T6, typename T7, typename T8, typename T9, typename T10,
16021     typename T11, typename T12, typename T13, typename T14, typename T15>
16022 internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16023     T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16024     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
16025   return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16026       T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16027       v13, v14, v15);
16028 }
16029 
16030 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16031     typename T6, typename T7, typename T8, typename T9, typename T10,
16032     typename T11, typename T12, typename T13, typename T14, typename T15,
16033     typename T16>
16034 internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16035     T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16036     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16037     T16 v16) {
16038   return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16039       T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16040       v12, v13, v14, v15, v16);
16041 }
16042 
16043 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16044     typename T6, typename T7, typename T8, typename T9, typename T10,
16045     typename T11, typename T12, typename T13, typename T14, typename T15,
16046     typename T16, typename T17>
16047 internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16048     T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16049     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16050     T16 v16, T17 v17) {
16051   return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16052       T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16053       v11, v12, v13, v14, v15, v16, v17);
16054 }
16055 
16056 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16057     typename T6, typename T7, typename T8, typename T9, typename T10,
16058     typename T11, typename T12, typename T13, typename T14, typename T15,
16059     typename T16, typename T17, typename T18>
16060 internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16061     T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16062     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16063     T16 v16, T17 v17, T18 v18) {
16064   return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16065       T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16066       v10, v11, v12, v13, v14, v15, v16, v17, v18);
16067 }
16068 
16069 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16070     typename T6, typename T7, typename T8, typename T9, typename T10,
16071     typename T11, typename T12, typename T13, typename T14, typename T15,
16072     typename T16, typename T17, typename T18, typename T19>
16073 internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16074     T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16075     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16076     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
16077   return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16078       T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
16079       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
16080 }
16081 
16082 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16083     typename T6, typename T7, typename T8, typename T9, typename T10,
16084     typename T11, typename T12, typename T13, typename T14, typename T15,
16085     typename T16, typename T17, typename T18, typename T19, typename T20>
16086 internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16087     T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16088     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16089     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
16090   return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16091       T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
16092       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
16093 }
16094 
16095 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16096     typename T6, typename T7, typename T8, typename T9, typename T10,
16097     typename T11, typename T12, typename T13, typename T14, typename T15,
16098     typename T16, typename T17, typename T18, typename T19, typename T20,
16099     typename T21>
16100 internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16101     T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16102     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16103     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
16104   return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16105       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
16106       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
16107 }
16108 
16109 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16110     typename T6, typename T7, typename T8, typename T9, typename T10,
16111     typename T11, typename T12, typename T13, typename T14, typename T15,
16112     typename T16, typename T17, typename T18, typename T19, typename T20,
16113     typename T21, typename T22>
16114 internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16115     T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
16116     T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16117     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16118     T21 v21, T22 v22) {
16119   return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16120       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
16121       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16122       v20, v21, v22);
16123 }
16124 
16125 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16126     typename T6, typename T7, typename T8, typename T9, typename T10,
16127     typename T11, typename T12, typename T13, typename T14, typename T15,
16128     typename T16, typename T17, typename T18, typename T19, typename T20,
16129     typename T21, typename T22, typename T23>
16130 internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16131     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
16132     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16133     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16134     T21 v21, T22 v22, T23 v23) {
16135   return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16136       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
16137       v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16138       v20, v21, v22, v23);
16139 }
16140 
16141 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16142     typename T6, typename T7, typename T8, typename T9, typename T10,
16143     typename T11, typename T12, typename T13, typename T14, typename T15,
16144     typename T16, typename T17, typename T18, typename T19, typename T20,
16145     typename T21, typename T22, typename T23, typename T24>
16146 internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16147     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
16148     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16149     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16150     T21 v21, T22 v22, T23 v23, T24 v24) {
16151   return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16152       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
16153       v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16154       v19, v20, v21, v22, v23, v24);
16155 }
16156 
16157 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16158     typename T6, typename T7, typename T8, typename T9, typename T10,
16159     typename T11, typename T12, typename T13, typename T14, typename T15,
16160     typename T16, typename T17, typename T18, typename T19, typename T20,
16161     typename T21, typename T22, typename T23, typename T24, typename T25>
16162 internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16163     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
16164     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16165     T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16166     T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
16167   return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16168       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
16169       v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16170       v18, v19, v20, v21, v22, v23, v24, v25);
16171 }
16172 
16173 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16174     typename T6, typename T7, typename T8, typename T9, typename T10,
16175     typename T11, typename T12, typename T13, typename T14, typename T15,
16176     typename T16, typename T17, typename T18, typename T19, typename T20,
16177     typename T21, typename T22, typename T23, typename T24, typename T25,
16178     typename T26>
16179 internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16180     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16181     T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16182     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16183     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16184     T26 v26) {
16185   return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16186       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16187       T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16188       v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
16189 }
16190 
16191 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16192     typename T6, typename T7, typename T8, typename T9, typename T10,
16193     typename T11, typename T12, typename T13, typename T14, typename T15,
16194     typename T16, typename T17, typename T18, typename T19, typename T20,
16195     typename T21, typename T22, typename T23, typename T24, typename T25,
16196     typename T26, typename T27>
16197 internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16198     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
16199     T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16200     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16201     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16202     T26 v26, T27 v27) {
16203   return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16204       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16205       T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16206       v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
16207 }
16208 
16209 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16210     typename T6, typename T7, typename T8, typename T9, typename T10,
16211     typename T11, typename T12, typename T13, typename T14, typename T15,
16212     typename T16, typename T17, typename T18, typename T19, typename T20,
16213     typename T21, typename T22, typename T23, typename T24, typename T25,
16214     typename T26, typename T27, typename T28>
16215 internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16216     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
16217     T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16218     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16219     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16220     T26 v26, T27 v27, T28 v28) {
16221   return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16222       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16223       T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16224       v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16225       v28);
16226 }
16227 
16228 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16229     typename T6, typename T7, typename T8, typename T9, typename T10,
16230     typename T11, typename T12, typename T13, typename T14, typename T15,
16231     typename T16, typename T17, typename T18, typename T19, typename T20,
16232     typename T21, typename T22, typename T23, typename T24, typename T25,
16233     typename T26, typename T27, typename T28, typename T29>
16234 internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16235     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16236     T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16237     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16238     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16239     T26 v26, T27 v27, T28 v28, T29 v29) {
16240   return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16241       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16242       T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16243       v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16244       v27, v28, v29);
16245 }
16246 
16247 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16248     typename T6, typename T7, typename T8, typename T9, typename T10,
16249     typename T11, typename T12, typename T13, typename T14, typename T15,
16250     typename T16, typename T17, typename T18, typename T19, typename T20,
16251     typename T21, typename T22, typename T23, typename T24, typename T25,
16252     typename T26, typename T27, typename T28, typename T29, typename T30>
16253 internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16254     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16255     T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16256     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16257     T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16258     T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
16259   return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16260       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16261       T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16262       v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16263       v26, v27, v28, v29, v30);
16264 }
16265 
16266 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16267     typename T6, typename T7, typename T8, typename T9, typename T10,
16268     typename T11, typename T12, typename T13, typename T14, typename T15,
16269     typename T16, typename T17, typename T18, typename T19, typename T20,
16270     typename T21, typename T22, typename T23, typename T24, typename T25,
16271     typename T26, typename T27, typename T28, typename T29, typename T30,
16272     typename T31>
16273 internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16274     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16275     T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16276     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16277     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16278     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
16279   return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16280       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16281       T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16282       v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16283       v25, v26, v27, v28, v29, v30, v31);
16284 }
16285 
16286 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16287     typename T6, typename T7, typename T8, typename T9, typename T10,
16288     typename T11, typename T12, typename T13, typename T14, typename T15,
16289     typename T16, typename T17, typename T18, typename T19, typename T20,
16290     typename T21, typename T22, typename T23, typename T24, typename T25,
16291     typename T26, typename T27, typename T28, typename T29, typename T30,
16292     typename T31, typename T32>
16293 internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16294     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16295     T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16296     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16297     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16298     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16299     T32 v32) {
16300   return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16301       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16302       T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16303       v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16304       v24, v25, v26, v27, v28, v29, v30, v31, v32);
16305 }
16306 
16307 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16308     typename T6, typename T7, typename T8, typename T9, typename T10,
16309     typename T11, typename T12, typename T13, typename T14, typename T15,
16310     typename T16, typename T17, typename T18, typename T19, typename T20,
16311     typename T21, typename T22, typename T23, typename T24, typename T25,
16312     typename T26, typename T27, typename T28, typename T29, typename T30,
16313     typename T31, typename T32, typename T33>
16314 internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16315     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16316     T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16317     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16318     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16319     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16320     T32 v32, T33 v33) {
16321   return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16322       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16323       T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
16324       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16325       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
16326 }
16327 
16328 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16329     typename T6, typename T7, typename T8, typename T9, typename T10,
16330     typename T11, typename T12, typename T13, typename T14, typename T15,
16331     typename T16, typename T17, typename T18, typename T19, typename T20,
16332     typename T21, typename T22, typename T23, typename T24, typename T25,
16333     typename T26, typename T27, typename T28, typename T29, typename T30,
16334     typename T31, typename T32, typename T33, typename T34>
16335 internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16336     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16337     T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16338     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16339     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16340     T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16341     T31 v31, T32 v32, T33 v33, T34 v34) {
16342   return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16343       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16344       T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
16345       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16346       v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
16347 }
16348 
16349 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16350     typename T6, typename T7, typename T8, typename T9, typename T10,
16351     typename T11, typename T12, typename T13, typename T14, typename T15,
16352     typename T16, typename T17, typename T18, typename T19, typename T20,
16353     typename T21, typename T22, typename T23, typename T24, typename T25,
16354     typename T26, typename T27, typename T28, typename T29, typename T30,
16355     typename T31, typename T32, typename T33, typename T34, typename T35>
16356 internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16357     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16358     T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16359     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16360     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16361     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16362     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
16363   return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16364       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16365       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
16366       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16367       v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
16368 }
16369 
16370 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16371     typename T6, typename T7, typename T8, typename T9, typename T10,
16372     typename T11, typename T12, typename T13, typename T14, typename T15,
16373     typename T16, typename T17, typename T18, typename T19, typename T20,
16374     typename T21, typename T22, typename T23, typename T24, typename T25,
16375     typename T26, typename T27, typename T28, typename T29, typename T30,
16376     typename T31, typename T32, typename T33, typename T34, typename T35,
16377     typename T36>
16378 internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16379     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16380     T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16381     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16382     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16383     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16384     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
16385   return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16386       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16387       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
16388       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16389       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16390       v34, v35, v36);
16391 }
16392 
16393 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16394     typename T6, typename T7, typename T8, typename T9, typename T10,
16395     typename T11, typename T12, typename T13, typename T14, typename T15,
16396     typename T16, typename T17, typename T18, typename T19, typename T20,
16397     typename T21, typename T22, typename T23, typename T24, typename T25,
16398     typename T26, typename T27, typename T28, typename T29, typename T30,
16399     typename T31, typename T32, typename T33, typename T34, typename T35,
16400     typename T36, typename T37>
16401 internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16402     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16403     T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
16404     T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16405     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16406     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16407     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16408     T37 v37) {
16409   return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16410       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16411       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
16412       v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16413       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16414       v34, v35, v36, v37);
16415 }
16416 
16417 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16418     typename T6, typename T7, typename T8, typename T9, typename T10,
16419     typename T11, typename T12, typename T13, typename T14, typename T15,
16420     typename T16, typename T17, typename T18, typename T19, typename T20,
16421     typename T21, typename T22, typename T23, typename T24, typename T25,
16422     typename T26, typename T27, typename T28, typename T29, typename T30,
16423     typename T31, typename T32, typename T33, typename T34, typename T35,
16424     typename T36, typename T37, typename T38>
16425 internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16426     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16427     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
16428     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16429     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16430     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16431     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16432     T37 v37, T38 v38) {
16433   return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16434       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16435       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
16436       v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
16437       v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
16438       v33, v34, v35, v36, v37, v38);
16439 }
16440 
16441 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16442     typename T6, typename T7, typename T8, typename T9, typename T10,
16443     typename T11, typename T12, typename T13, typename T14, typename T15,
16444     typename T16, typename T17, typename T18, typename T19, typename T20,
16445     typename T21, typename T22, typename T23, typename T24, typename T25,
16446     typename T26, typename T27, typename T28, typename T29, typename T30,
16447     typename T31, typename T32, typename T33, typename T34, typename T35,
16448     typename T36, typename T37, typename T38, typename T39>
16449 internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16450     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16451     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
16452     T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
16453     T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
16454     T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
16455     T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
16456     T37 v37, T38 v38, T39 v39) {
16457   return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16458       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16459       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
16460       v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
16461       v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
16462       v32, v33, v34, v35, v36, v37, v38, v39);
16463 }
16464 
16465 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16466     typename T6, typename T7, typename T8, typename T9, typename T10,
16467     typename T11, typename T12, typename T13, typename T14, typename T15,
16468     typename T16, typename T17, typename T18, typename T19, typename T20,
16469     typename T21, typename T22, typename T23, typename T24, typename T25,
16470     typename T26, typename T27, typename T28, typename T29, typename T30,
16471     typename T31, typename T32, typename T33, typename T34, typename T35,
16472     typename T36, typename T37, typename T38, typename T39, typename T40>
16473 internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16474     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16475     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
16476     T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
16477     T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
16478     T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
16479     T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
16480     T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
16481   return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16482       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16483       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16484       T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
16485       v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
16486       v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
16487 }
16488 
16489 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16490     typename T6, typename T7, typename T8, typename T9, typename T10,
16491     typename T11, typename T12, typename T13, typename T14, typename T15,
16492     typename T16, typename T17, typename T18, typename T19, typename T20,
16493     typename T21, typename T22, typename T23, typename T24, typename T25,
16494     typename T26, typename T27, typename T28, typename T29, typename T30,
16495     typename T31, typename T32, typename T33, typename T34, typename T35,
16496     typename T36, typename T37, typename T38, typename T39, typename T40,
16497     typename T41>
16498 internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16499     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16500     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
16501     T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16502     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16503     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16504     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16505     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
16506   return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16507       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16508       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16509       T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
16510       v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
16511       v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
16512 }
16513 
16514 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16515     typename T6, typename T7, typename T8, typename T9, typename T10,
16516     typename T11, typename T12, typename T13, typename T14, typename T15,
16517     typename T16, typename T17, typename T18, typename T19, typename T20,
16518     typename T21, typename T22, typename T23, typename T24, typename T25,
16519     typename T26, typename T27, typename T28, typename T29, typename T30,
16520     typename T31, typename T32, typename T33, typename T34, typename T35,
16521     typename T36, typename T37, typename T38, typename T39, typename T40,
16522     typename T41, typename T42>
16523 internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16524     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16525     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
16526     T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16527     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16528     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16529     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16530     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16531     T42 v42) {
16532   return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16533       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16534       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16535       T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
16536       v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
16537       v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
16538       v42);
16539 }
16540 
16541 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16542     typename T6, typename T7, typename T8, typename T9, typename T10,
16543     typename T11, typename T12, typename T13, typename T14, typename T15,
16544     typename T16, typename T17, typename T18, typename T19, typename T20,
16545     typename T21, typename T22, typename T23, typename T24, typename T25,
16546     typename T26, typename T27, typename T28, typename T29, typename T30,
16547     typename T31, typename T32, typename T33, typename T34, typename T35,
16548     typename T36, typename T37, typename T38, typename T39, typename T40,
16549     typename T41, typename T42, typename T43>
16550 internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16551     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16552     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
16553     T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16554     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16555     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16556     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16557     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16558     T42 v42, T43 v43) {
16559   return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16560       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16561       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16562       T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
16563       v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
16564       v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
16565       v41, v42, v43);
16566 }
16567 
16568 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16569     typename T6, typename T7, typename T8, typename T9, typename T10,
16570     typename T11, typename T12, typename T13, typename T14, typename T15,
16571     typename T16, typename T17, typename T18, typename T19, typename T20,
16572     typename T21, typename T22, typename T23, typename T24, typename T25,
16573     typename T26, typename T27, typename T28, typename T29, typename T30,
16574     typename T31, typename T32, typename T33, typename T34, typename T35,
16575     typename T36, typename T37, typename T38, typename T39, typename T40,
16576     typename T41, typename T42, typename T43, typename T44>
16577 internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16578     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16579     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16580     T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
16581     T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
16582     T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
16583     T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
16584     T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
16585     T42 v42, T43 v43, T44 v44) {
16586   return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16587       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16588       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16589       T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
16590       v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
16591       v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
16592       v40, v41, v42, v43, v44);
16593 }
16594 
16595 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16596     typename T6, typename T7, typename T8, typename T9, typename T10,
16597     typename T11, typename T12, typename T13, typename T14, typename T15,
16598     typename T16, typename T17, typename T18, typename T19, typename T20,
16599     typename T21, typename T22, typename T23, typename T24, typename T25,
16600     typename T26, typename T27, typename T28, typename T29, typename T30,
16601     typename T31, typename T32, typename T33, typename T34, typename T35,
16602     typename T36, typename T37, typename T38, typename T39, typename T40,
16603     typename T41, typename T42, typename T43, typename T44, typename T45>
16604 internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16605     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16606     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16607     T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
16608     T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
16609     T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
16610     T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
16611     T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
16612     T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
16613   return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16614       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16615       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16616       T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
16617       v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
16618       v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
16619       v39, v40, v41, v42, v43, v44, v45);
16620 }
16621 
16622 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16623     typename T6, typename T7, typename T8, typename T9, typename T10,
16624     typename T11, typename T12, typename T13, typename T14, typename T15,
16625     typename T16, typename T17, typename T18, typename T19, typename T20,
16626     typename T21, typename T22, typename T23, typename T24, typename T25,
16627     typename T26, typename T27, typename T28, typename T29, typename T30,
16628     typename T31, typename T32, typename T33, typename T34, typename T35,
16629     typename T36, typename T37, typename T38, typename T39, typename T40,
16630     typename T41, typename T42, typename T43, typename T44, typename T45,
16631     typename T46>
16632 internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16633     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16634     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16635     T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16636     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16637     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16638     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16639     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16640     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
16641   return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16642       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16643       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16644       T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
16645       v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16646       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16647       v38, v39, v40, v41, v42, v43, v44, v45, v46);
16648 }
16649 
16650 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16651     typename T6, typename T7, typename T8, typename T9, typename T10,
16652     typename T11, typename T12, typename T13, typename T14, typename T15,
16653     typename T16, typename T17, typename T18, typename T19, typename T20,
16654     typename T21, typename T22, typename T23, typename T24, typename T25,
16655     typename T26, typename T27, typename T28, typename T29, typename T30,
16656     typename T31, typename T32, typename T33, typename T34, typename T35,
16657     typename T36, typename T37, typename T38, typename T39, typename T40,
16658     typename T41, typename T42, typename T43, typename T44, typename T45,
16659     typename T46, typename T47>
16660 internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16661     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16662     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16663     T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
16664     T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16665     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16666     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16667     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16668     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
16669   return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16670       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16671       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16672       T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
16673       v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
16674       v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
16675       v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
16676 }
16677 
16678 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16679     typename T6, typename T7, typename T8, typename T9, typename T10,
16680     typename T11, typename T12, typename T13, typename T14, typename T15,
16681     typename T16, typename T17, typename T18, typename T19, typename T20,
16682     typename T21, typename T22, typename T23, typename T24, typename T25,
16683     typename T26, typename T27, typename T28, typename T29, typename T30,
16684     typename T31, typename T32, typename T33, typename T34, typename T35,
16685     typename T36, typename T37, typename T38, typename T39, typename T40,
16686     typename T41, typename T42, typename T43, typename T44, typename T45,
16687     typename T46, typename T47, typename T48>
16688 internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16689     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16690     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16691     T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
16692     T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
16693     T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
16694     T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
16695     T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
16696     T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
16697     T48 v48) {
16698   return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16699       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16700       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16701       T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
16702       v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
16703       v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
16704       v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
16705 }
16706 
16707 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16708     typename T6, typename T7, typename T8, typename T9, typename T10,
16709     typename T11, typename T12, typename T13, typename T14, typename T15,
16710     typename T16, typename T17, typename T18, typename T19, typename T20,
16711     typename T21, typename T22, typename T23, typename T24, typename T25,
16712     typename T26, typename T27, typename T28, typename T29, typename T30,
16713     typename T31, typename T32, typename T33, typename T34, typename T35,
16714     typename T36, typename T37, typename T38, typename T39, typename T40,
16715     typename T41, typename T42, typename T43, typename T44, typename T45,
16716     typename T46, typename T47, typename T48, typename T49>
16717 internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16718     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16719     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16720     T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
16721     T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
16722     T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
16723     T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
16724     T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
16725     T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
16726     T47 v47, T48 v48, T49 v49) {
16727   return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16728       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16729       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16730       T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
16731       v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
16732       v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
16733       v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
16734 }
16735 
16736 template <typename T1, typename T2, typename T3, typename T4, typename T5,
16737     typename T6, typename T7, typename T8, typename T9, typename T10,
16738     typename T11, typename T12, typename T13, typename T14, typename T15,
16739     typename T16, typename T17, typename T18, typename T19, typename T20,
16740     typename T21, typename T22, typename T23, typename T24, typename T25,
16741     typename T26, typename T27, typename T28, typename T29, typename T30,
16742     typename T31, typename T32, typename T33, typename T34, typename T35,
16743     typename T36, typename T37, typename T38, typename T39, typename T40,
16744     typename T41, typename T42, typename T43, typename T44, typename T45,
16745     typename T46, typename T47, typename T48, typename T49, typename T50>
16746 internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
16747     T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
16748     T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
16749     T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
16750     T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
16751     T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
16752     T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
16753     T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
16754     T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
16755     T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
16756   return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
16757       T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
16758       T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
16759       T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
16760       v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
16761       v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
16762       v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
16763       v48, v49, v50);
16764 }
16765 
16766 // Bool() allows generating tests with parameters in a set of (false, true).
16767 //
16768 // Synopsis:
16769 // Bool()
16770 //   - returns a generator producing sequences with elements {false, true}.
16771 //
16772 // It is useful when testing code that depends on Boolean flags. Combinations
16773 // of multiple flags can be tested when several Bool()'s are combined using
16774 // Combine() function.
16775 //
16776 // In the following example all tests in the test case FlagDependentTest
16777 // will be instantiated twice with parameters false and true.
16778 //
16779 // class FlagDependentTest : public testing::TestWithParam<bool> {
16780 //   virtual void SetUp() {
16781 //     external_flag = GetParam();
16782 //   }
16783 // }
16784 // INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
16785 //
16786 inline internal::ParamGenerator<bool> Bool() {
16787   return Values(false, true);
16788 }
16789 
16790 # if GTEST_HAS_COMBINE
16791 // Combine() allows the user to combine two or more sequences to produce
16792 // values of a Cartesian product of those sequences' elements.
16793 //
16794 // Synopsis:
16795 // Combine(gen1, gen2, ..., genN)
16796 //   - returns a generator producing sequences with elements coming from
16797 //     the Cartesian product of elements from the sequences generated by
16798 //     gen1, gen2, ..., genN. The sequence elements will have a type of
16799 //     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
16800 //     of elements from sequences produces by gen1, gen2, ..., genN.
16801 //
16802 // Combine can have up to 10 arguments. This number is currently limited
16803 // by the maximum number of elements in the tuple implementation used by Google
16804 // Test.
16805 //
16806 // Example:
16807 //
16808 // This will instantiate tests in test case AnimalTest each one with
16809 // the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
16810 // tuple("dog", BLACK), and tuple("dog", WHITE):
16811 //
16812 // enum Color { BLACK, GRAY, WHITE };
16813 // class AnimalTest
16814 //     : public testing::TestWithParam<tuple<const char*, Color> > {...};
16815 //
16816 // TEST_P(AnimalTest, AnimalLooksNice) {...}
16817 //
16818 // INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
16819 //                         Combine(Values("cat", "dog"),
16820 //                                 Values(BLACK, WHITE)));
16821 //
16822 // This will instantiate tests in FlagDependentTest with all variations of two
16823 // Boolean flags:
16824 //
16825 // class FlagDependentTest
16826 //     : public testing::TestWithParam<tuple<bool, bool> > {
16827 //   virtual void SetUp() {
16828 //     // Assigns external_flag_1 and external_flag_2 values from the tuple.
16829 //     tie(external_flag_1, external_flag_2) = GetParam();
16830 //   }
16831 // };
16832 //
16833 // TEST_P(FlagDependentTest, TestFeature1) {
16834 //   // Test your code using external_flag_1 and external_flag_2 here.
16835 // }
16836 // INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
16837 //                         Combine(Bool(), Bool()));
16838 //
16839 template <typename Generator1, typename Generator2>
16840 internal::CartesianProductHolder2<Generator1, Generator2> Combine(
16841     const Generator1& g1, const Generator2& g2) {
16842   return internal::CartesianProductHolder2<Generator1, Generator2>(
16843       g1, g2);
16844 }
16845 
16846 template <typename Generator1, typename Generator2, typename Generator3>
16847 internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
16848     const Generator1& g1, const Generator2& g2, const Generator3& g3) {
16849   return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
16850       g1, g2, g3);
16851 }
16852 
16853 template <typename Generator1, typename Generator2, typename Generator3,
16854     typename Generator4>
16855 internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16856     Generator4> Combine(
16857     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16858         const Generator4& g4) {
16859   return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
16860       Generator4>(
16861       g1, g2, g3, g4);
16862 }
16863 
16864 template <typename Generator1, typename Generator2, typename Generator3,
16865     typename Generator4, typename Generator5>
16866 internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16867     Generator4, Generator5> Combine(
16868     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16869         const Generator4& g4, const Generator5& g5) {
16870   return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
16871       Generator4, Generator5>(
16872       g1, g2, g3, g4, g5);
16873 }
16874 
16875 template <typename Generator1, typename Generator2, typename Generator3,
16876     typename Generator4, typename Generator5, typename Generator6>
16877 internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16878     Generator4, Generator5, Generator6> Combine(
16879     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16880         const Generator4& g4, const Generator5& g5, const Generator6& g6) {
16881   return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
16882       Generator4, Generator5, Generator6>(
16883       g1, g2, g3, g4, g5, g6);
16884 }
16885 
16886 template <typename Generator1, typename Generator2, typename Generator3,
16887     typename Generator4, typename Generator5, typename Generator6,
16888     typename Generator7>
16889 internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16890     Generator4, Generator5, Generator6, Generator7> Combine(
16891     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16892         const Generator4& g4, const Generator5& g5, const Generator6& g6,
16893         const Generator7& g7) {
16894   return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
16895       Generator4, Generator5, Generator6, Generator7>(
16896       g1, g2, g3, g4, g5, g6, g7);
16897 }
16898 
16899 template <typename Generator1, typename Generator2, typename Generator3,
16900     typename Generator4, typename Generator5, typename Generator6,
16901     typename Generator7, typename Generator8>
16902 internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16903     Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
16904     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16905         const Generator4& g4, const Generator5& g5, const Generator6& g6,
16906         const Generator7& g7, const Generator8& g8) {
16907   return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
16908       Generator4, Generator5, Generator6, Generator7, Generator8>(
16909       g1, g2, g3, g4, g5, g6, g7, g8);
16910 }
16911 
16912 template <typename Generator1, typename Generator2, typename Generator3,
16913     typename Generator4, typename Generator5, typename Generator6,
16914     typename Generator7, typename Generator8, typename Generator9>
16915 internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16916     Generator4, Generator5, Generator6, Generator7, Generator8,
16917     Generator9> Combine(
16918     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16919         const Generator4& g4, const Generator5& g5, const Generator6& g6,
16920         const Generator7& g7, const Generator8& g8, const Generator9& g9) {
16921   return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
16922       Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
16923       g1, g2, g3, g4, g5, g6, g7, g8, g9);
16924 }
16925 
16926 template <typename Generator1, typename Generator2, typename Generator3,
16927     typename Generator4, typename Generator5, typename Generator6,
16928     typename Generator7, typename Generator8, typename Generator9,
16929     typename Generator10>
16930 internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16931     Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16932     Generator10> Combine(
16933     const Generator1& g1, const Generator2& g2, const Generator3& g3,
16934         const Generator4& g4, const Generator5& g5, const Generator6& g6,
16935         const Generator7& g7, const Generator8& g8, const Generator9& g9,
16936         const Generator10& g10) {
16937   return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
16938       Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
16939       Generator10>(
16940       g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
16941 }
16942 # endif  // GTEST_HAS_COMBINE
16943 
16944 
16945 
16946 # define TEST_P(test_case_name, test_name) \
16947   class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
16948       : public test_case_name { \
16949    public: \
16950     GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
16951     virtual void TestBody(); \
16952    private: \
16953     static int AddToRegistry() { \
16954       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
16955           GetTestCasePatternHolder<test_case_name>(\
16956               #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
16957                   #test_case_name, \
16958                   #test_name, \
16959                   new ::testing::internal::TestMetaFactory< \
16960                       GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
16961       return 0; \
16962     } \
16963     static int gtest_registering_dummy_; \
16964     GTEST_DISALLOW_COPY_AND_ASSIGN_(\
16965         GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
16966   }; \
16967   int GTEST_TEST_CLASS_NAME_(test_case_name, \
16968                              test_name)::gtest_registering_dummy_ = \
16969       GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
16970   void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
16971 
16972 # define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
16973   ::testing::internal::ParamGenerator<test_case_name::ParamType> \
16974       gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
16975   int gtest_##prefix##test_case_name##_dummy_ = \
16976       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
16977           GetTestCasePatternHolder<test_case_name>(\
16978               #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
16979                   #prefix, \
16980                   &gtest_##prefix##test_case_name##_EvalGenerator_, \
16981                   __FILE__, __LINE__)
16982 
16983 }  // namespace testing
16984 
16985 #endif  // GTEST_HAS_PARAM_TEST
16986 
16987 #endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
16988 // Copyright 2006, Google Inc.
16989 // All rights reserved.
16990 //
16991 // Redistribution and use in source and binary forms, with or without
16992 // modification, are permitted provided that the following conditions are
16993 // met:
16994 //
16995 //     * Redistributions of source code must retain the above copyright
16996 // notice, this list of conditions and the following disclaimer.
16997 //     * Redistributions in binary form must reproduce the above
16998 // copyright notice, this list of conditions and the following disclaimer
16999 // in the documentation and/or other materials provided with the
17000 // distribution.
17001 //     * Neither the name of Google Inc. nor the names of its
17002 // contributors may be used to endorse or promote products derived from
17003 // this software without specific prior written permission.
17004 //
17005 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17006 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17007 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17008 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17009 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17010 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17011 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17012 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17013 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17014 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17015 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17016 //
17017 // Author: wan@google.com (Zhanyong Wan)
17018 //
17019 // Google C++ Testing Framework definitions useful in production code.
17020 
17021 #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17022 #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17023 
17024 // When you need to test the private or protected members of a class,
17025 // use the FRIEND_TEST macro to declare your tests as friends of the
17026 // class.  For example:
17027 //
17028 // class MyClass {
17029 //  private:
17030 //   void MyMethod();
17031 //   FRIEND_TEST(MyClassTest, MyMethod);
17032 // };
17033 //
17034 // class MyClassTest : public testing::Test {
17035 //   // ...
17036 // };
17037 //
17038 // TEST_F(MyClassTest, MyMethod) {
17039 //   // Can call MyClass::MyMethod() here.
17040 // }
17041 
17042 #define FRIEND_TEST(test_case_name, test_name)\
17043 friend class test_case_name##_##test_name##_Test
17044 
17045 #endif  // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
17046 // Copyright 2008, Google Inc.
17047 // All rights reserved.
17048 //
17049 // Redistribution and use in source and binary forms, with or without
17050 // modification, are permitted provided that the following conditions are
17051 // met:
17052 //
17053 //     * Redistributions of source code must retain the above copyright
17054 // notice, this list of conditions and the following disclaimer.
17055 //     * Redistributions in binary form must reproduce the above
17056 // copyright notice, this list of conditions and the following disclaimer
17057 // in the documentation and/or other materials provided with the
17058 // distribution.
17059 //     * Neither the name of Google Inc. nor the names of its
17060 // contributors may be used to endorse or promote products derived from
17061 // this software without specific prior written permission.
17062 //
17063 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17064 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17065 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17066 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17067 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17068 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17069 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17070 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17071 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17072 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17073 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17074 //
17075 // Author: mheule@google.com (Markus Heule)
17076 //
17077 
17078 #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17079 #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17080 
17081 #include <iosfwd>
17082 #include <vector>
17083 
17084 namespace testing {
17085 
17086 // A copyable object representing the result of a test part (i.e. an
17087 // assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
17088 //
17089 // Don't inherit from TestPartResult as its destructor is not virtual.
17090 class GTEST_API_ TestPartResult {
17091  public:
17092   // The possible outcomes of a test part (i.e. an assertion or an
17093   // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
17094   enum Type {
17095     kSuccess,          // Succeeded.
17096     kNonFatalFailure,  // Failed but the test can continue.
17097     kFatalFailure      // Failed and the test should be terminated.
17098   };
17099 
17100   // C'tor.  TestPartResult does NOT have a default constructor.
17101   // Always use this constructor (with parameters) to create a
17102   // TestPartResult object.
17103   TestPartResult(Type a_type,
17104                  const char* a_file_name,
17105                  int a_line_number,
17106                  const char* a_message)
17107       : type_(a_type),
17108         file_name_(a_file_name == NULL ? "" : a_file_name),
17109         line_number_(a_line_number),
17110         summary_(ExtractSummary(a_message)),
17111         message_(a_message) {
17112   }
17113 
17114   // Gets the outcome of the test part.
17115   Type type() const { return type_; }
17116 
17117   // Gets the name of the source file where the test part took place, or
17118   // NULL if it's unknown.
17119   const char* file_name() const {
17120     return file_name_.empty() ? NULL : file_name_.c_str();
17121   }
17122 
17123   // Gets the line in the source file where the test part took place,
17124   // or -1 if it's unknown.
17125   int line_number() const { return line_number_; }
17126 
17127   // Gets the summary of the failure message.
17128   const char* summary() const { return summary_.c_str(); }
17129 
17130   // Gets the message associated with the test part.
17131   const char* message() const { return message_.c_str(); }
17132 
17133   // Returns true iff the test part passed.
17134   bool passed() const { return type_ == kSuccess; }
17135 
17136   // Returns true iff the test part failed.
17137   bool failed() const { return type_ != kSuccess; }
17138 
17139   // Returns true iff the test part non-fatally failed.
17140   bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
17141 
17142   // Returns true iff the test part fatally failed.
17143   bool fatally_failed() const { return type_ == kFatalFailure; }
17144 
17145  private:
17146   Type type_;
17147 
17148   // Gets the summary of the failure message by omitting the stack
17149   // trace in it.
17150   static std::string ExtractSummary(const char* message);
17151 
17152   // The name of the source file where the test part took place, or
17153   // "" if the source file is unknown.
17154   std::string file_name_;
17155   // The line in the source file where the test part took place, or -1
17156   // if the line number is unknown.
17157   int line_number_;
17158   std::string summary_;  // The test failure summary.
17159   std::string message_;  // The test failure message.
17160 };
17161 
17162 // Prints a TestPartResult object.
17163 std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
17164 
17165 // An array of TestPartResult objects.
17166 //
17167 // Don't inherit from TestPartResultArray as its destructor is not
17168 // virtual.
17169 class GTEST_API_ TestPartResultArray {
17170  public:
17171   TestPartResultArray() {}
17172 
17173   // Appends the given TestPartResult to the array.
17174   void Append(const TestPartResult& result);
17175 
17176   // Returns the TestPartResult at the given index (0-based).
17177   const TestPartResult& GetTestPartResult(int index) const;
17178 
17179   // Returns the number of TestPartResult objects in the array.
17180   int size() const;
17181 
17182  private:
17183   std::vector<TestPartResult> array_;
17184 
17185   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
17186 };
17187 
17188 // This interface knows how to report a test part result.
17189 class TestPartResultReporterInterface {
17190  public:
17191   virtual ~TestPartResultReporterInterface() {}
17192 
17193   virtual void ReportTestPartResult(const TestPartResult& result) = 0;
17194 };
17195 
17196 namespace internal {
17197 
17198 // This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
17199 // statement generates new fatal failures. To do so it registers itself as the
17200 // current test part result reporter. Besides checking if fatal failures were
17201 // reported, it only delegates the reporting to the former result reporter.
17202 // The original result reporter is restored in the destructor.
17203 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
17204 class GTEST_API_ HasNewFatalFailureHelper
17205     : public TestPartResultReporterInterface {
17206  public:
17207   HasNewFatalFailureHelper();
17208   virtual ~HasNewFatalFailureHelper();
17209   virtual void ReportTestPartResult(const TestPartResult& result);
17210   bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
17211  private:
17212   bool has_new_fatal_failure_;
17213   TestPartResultReporterInterface* original_reporter_;
17214 
17215   GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
17216 };
17217 
17218 }  // namespace internal
17219 
17220 }  // namespace testing
17221 
17222 #endif  // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
17223 // Copyright 2008 Google Inc.
17224 // All Rights Reserved.
17225 //
17226 // Redistribution and use in source and binary forms, with or without
17227 // modification, are permitted provided that the following conditions are
17228 // met:
17229 //
17230 //     * Redistributions of source code must retain the above copyright
17231 // notice, this list of conditions and the following disclaimer.
17232 //     * Redistributions in binary form must reproduce the above
17233 // copyright notice, this list of conditions and the following disclaimer
17234 // in the documentation and/or other materials provided with the
17235 // distribution.
17236 //     * Neither the name of Google Inc. nor the names of its
17237 // contributors may be used to endorse or promote products derived from
17238 // this software without specific prior written permission.
17239 //
17240 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17241 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17242 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17243 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17244 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17245 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17246 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17247 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
17248 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17249 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
17250 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17251 //
17252 // Author: wan@google.com (Zhanyong Wan)
17253 
17254 #ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17255 #define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17256 
17257 // This header implements typed tests and type-parameterized tests.
17258 
17259 // Typed (aka type-driven) tests repeat the same test for types in a
17260 // list.  You must know which types you want to test with when writing
17261 // typed tests. Here's how you do it:
17262 
17263 #if 0
17264 
17265 // First, define a fixture class template.  It should be parameterized
17266 // by a type.  Remember to derive it from testing::Test.
17267 template <typename T>
17268 class FooTest : public testing::Test {
17269  public:
17270   ...
17271   typedef std::list<T> List;
17272   static T shared_;
17273   T value_;
17274 };
17275 
17276 // Next, associate a list of types with the test case, which will be
17277 // repeated for each type in the list.  The typedef is necessary for
17278 // the macro to parse correctly.
17279 typedef testing::Types<char, int, unsigned int> MyTypes;
17280 TYPED_TEST_CASE(FooTest, MyTypes);
17281 
17282 // If the type list contains only one type, you can write that type
17283 // directly without Types<...>:
17284 //   TYPED_TEST_CASE(FooTest, int);
17285 
17286 // Then, use TYPED_TEST() instead of TEST_F() to define as many typed
17287 // tests for this test case as you want.
17288 TYPED_TEST(FooTest, DoesBlah) {
17289   // Inside a test, refer to TypeParam to get the type parameter.
17290   // Since we are inside a derived class template, C++ requires use to
17291   // visit the members of FooTest via 'this'.
17292   TypeParam n = this->value_;
17293 
17294   // To visit static members of the fixture, add the TestFixture::
17295   // prefix.
17296   n += TestFixture::shared_;
17297 
17298   // To refer to typedefs in the fixture, add the "typename
17299   // TestFixture::" prefix.
17300   typename TestFixture::List values;
17301   values.push_back(n);
17302   ...
17303 }
17304 
17305 TYPED_TEST(FooTest, HasPropertyA) { ... }
17306 
17307 #endif  // 0
17308 
17309 // Type-parameterized tests are abstract test patterns parameterized
17310 // by a type.  Compared with typed tests, type-parameterized tests
17311 // allow you to define the test pattern without knowing what the type
17312 // parameters are.  The defined pattern can be instantiated with
17313 // different types any number of times, in any number of translation
17314 // units.
17315 //
17316 // If you are designing an interface or concept, you can define a
17317 // suite of type-parameterized tests to verify properties that any
17318 // valid implementation of the interface/concept should have.  Then,
17319 // each implementation can easily instantiate the test suite to verify
17320 // that it conforms to the requirements, without having to write
17321 // similar tests repeatedly.  Here's an example:
17322 
17323 #if 0
17324 
17325 // First, define a fixture class template.  It should be parameterized
17326 // by a type.  Remember to derive it from testing::Test.
17327 template <typename T>
17328 class FooTest : public testing::Test {
17329   ...
17330 };
17331 
17332 // Next, declare that you will define a type-parameterized test case
17333 // (the _P suffix is for "parameterized" or "pattern", whichever you
17334 // prefer):
17335 TYPED_TEST_CASE_P(FooTest);
17336 
17337 // Then, use TYPED_TEST_P() to define as many type-parameterized tests
17338 // for this type-parameterized test case as you want.
17339 TYPED_TEST_P(FooTest, DoesBlah) {
17340   // Inside a test, refer to TypeParam to get the type parameter.
17341   TypeParam n = 0;
17342   ...
17343 }
17344 
17345 TYPED_TEST_P(FooTest, HasPropertyA) { ... }
17346 
17347 // Now the tricky part: you need to register all test patterns before
17348 // you can instantiate them.  The first argument of the macro is the
17349 // test case name; the rest are the names of the tests in this test
17350 // case.
17351 REGISTER_TYPED_TEST_CASE_P(FooTest,
17352                            DoesBlah, HasPropertyA);
17353 
17354 // Finally, you are free to instantiate the pattern with the types you
17355 // want.  If you put the above code in a header file, you can #include
17356 // it in multiple C++ source files and instantiate it multiple times.
17357 //
17358 // To distinguish different instances of the pattern, the first
17359 // argument to the INSTANTIATE_* macro is a prefix that will be added
17360 // to the actual test case name.  Remember to pick unique prefixes for
17361 // different instances.
17362 typedef testing::Types<char, int, unsigned int> MyTypes;
17363 INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
17364 
17365 // If the type list contains only one type, you can write that type
17366 // directly without Types<...>:
17367 //   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
17368 
17369 #endif  // 0
17370 
17371 
17372 // Implements typed tests.
17373 
17374 #if GTEST_HAS_TYPED_TEST
17375 
17376 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17377 //
17378 // Expands to the name of the typedef for the type parameters of the
17379 // given test case.
17380 # define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
17381 
17382 // The 'Types' template argument below must have spaces around it
17383 // since some compilers may choke on '>>' when passing a template
17384 // instance (e.g. Types<int>)
17385 # define TYPED_TEST_CASE(CaseName, Types) \
17386   typedef ::testing::internal::TypeList< Types >::type \
17387       GTEST_TYPE_PARAMS_(CaseName)
17388 
17389 # define TYPED_TEST(CaseName, TestName) \
17390   template <typename gtest_TypeParam_> \
17391   class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
17392       : public CaseName<gtest_TypeParam_> { \
17393    private: \
17394     typedef CaseName<gtest_TypeParam_> TestFixture; \
17395     typedef gtest_TypeParam_ TypeParam; \
17396     virtual void TestBody(); \
17397   }; \
17398   bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
17399       ::testing::internal::TypeParameterizedTest< \
17400           CaseName, \
17401           ::testing::internal::TemplateSel< \
17402               GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
17403           GTEST_TYPE_PARAMS_(CaseName)>::Register(\
17404               "", #CaseName, #TestName, 0); \
17405   template <typename gtest_TypeParam_> \
17406   void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
17407 
17408 #endif  // GTEST_HAS_TYPED_TEST
17409 
17410 // Implements type-parameterized tests.
17411 
17412 #if GTEST_HAS_TYPED_TEST_P
17413 
17414 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17415 //
17416 // Expands to the namespace name that the type-parameterized tests for
17417 // the given type-parameterized test case are defined in.  The exact
17418 // name of the namespace is subject to change without notice.
17419 # define GTEST_CASE_NAMESPACE_(TestCaseName) \
17420   gtest_case_##TestCaseName##_
17421 
17422 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
17423 //
17424 // Expands to the name of the variable used to remember the names of
17425 // the defined tests in the given test case.
17426 # define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
17427   gtest_typed_test_case_p_state_##TestCaseName##_
17428 
17429 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
17430 //
17431 // Expands to the name of the variable used to remember the names of
17432 // the registered tests in the given test case.
17433 # define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
17434   gtest_registered_test_names_##TestCaseName##_
17435 
17436 // The variables defined in the type-parameterized test macros are
17437 // static as typically these macros are used in a .h file that can be
17438 // #included in multiple translation units linked together.
17439 # define TYPED_TEST_CASE_P(CaseName) \
17440   static ::testing::internal::TypedTestCasePState \
17441       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
17442 
17443 # define TYPED_TEST_P(CaseName, TestName) \
17444   namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17445   template <typename gtest_TypeParam_> \
17446   class TestName : public CaseName<gtest_TypeParam_> { \
17447    private: \
17448     typedef CaseName<gtest_TypeParam_> TestFixture; \
17449     typedef gtest_TypeParam_ TypeParam; \
17450     virtual void TestBody(); \
17451   }; \
17452   static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
17453       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
17454           __FILE__, __LINE__, #CaseName, #TestName); \
17455   } \
17456   template <typename gtest_TypeParam_> \
17457   void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
17458 
17459 # define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
17460   namespace GTEST_CASE_NAMESPACE_(CaseName) { \
17461   typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
17462   } \
17463   static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
17464       GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
17465           __FILE__, __LINE__, #__VA_ARGS__)
17466 
17467 // The 'Types' template argument below must have spaces around it
17468 // since some compilers may choke on '>>' when passing a template
17469 // instance (e.g. Types<int>)
17470 # define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
17471   bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
17472       ::testing::internal::TypeParameterizedTestCase<CaseName, \
17473           GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
17474           ::testing::internal::TypeList< Types >::type>::Register(\
17475               #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
17476 
17477 #endif  // GTEST_HAS_TYPED_TEST_P
17478 
17479 #endif  // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
17480 
17481 // Depending on the platform, different string classes are available.
17482 // On Linux, in addition to ::std::string, Google also makes use of
17483 // class ::string, which has the same interface as ::std::string, but
17484 // has a different implementation.
17485 //
17486 // The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
17487 // ::string is available AND is a distinct type to ::std::string, or
17488 // define it to 0 to indicate otherwise.
17489 //
17490 // If the user's ::std::string and ::string are the same class due to
17491 // aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
17492 //
17493 // If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
17494 // heuristically.
17495 
17496 namespace testing {
17497 
17498 // Declares the flags.
17499 
17500 // This flag temporary enables the disabled tests.
17501 GTEST_DECLARE_bool_(also_run_disabled_tests);
17502 
17503 // This flag brings the debugger on an assertion failure.
17504 GTEST_DECLARE_bool_(break_on_failure);
17505 
17506 // This flag controls whether Google Test catches all test-thrown exceptions
17507 // and logs them as failures.
17508 GTEST_DECLARE_bool_(catch_exceptions);
17509 
17510 // This flag enables using colors in terminal output. Available values are
17511 // "yes" to enable colors, "no" (disable colors), or "auto" (the default)
17512 // to let Google Test decide.
17513 GTEST_DECLARE_string_(color);
17514 
17515 // This flag sets up the filter to select by name using a glob pattern
17516 // the tests to run. If the filter is not given all tests are executed.
17517 GTEST_DECLARE_string_(filter);
17518 
17519 // This flag causes the Google Test to list tests. None of the tests listed
17520 // are actually run if the flag is provided.
17521 GTEST_DECLARE_bool_(list_tests);
17522 
17523 // This flag controls whether Google Test emits a detailed XML report to a file
17524 // in addition to its normal textual output.
17525 GTEST_DECLARE_string_(output);
17526 
17527 // This flags control whether Google Test prints the elapsed time for each
17528 // test.
17529 GTEST_DECLARE_bool_(print_time);
17530 
17531 // This flag specifies the random number seed.
17532 GTEST_DECLARE_int32_(random_seed);
17533 
17534 // This flag sets how many times the tests are repeated. The default value
17535 // is 1. If the value is -1 the tests are repeating forever.
17536 GTEST_DECLARE_int32_(repeat);
17537 
17538 // This flag controls whether Google Test includes Google Test internal
17539 // stack frames in failure stack traces.
17540 GTEST_DECLARE_bool_(show_internal_stack_frames);
17541 
17542 // When this flag is specified, tests' order is randomized on every iteration.
17543 GTEST_DECLARE_bool_(shuffle);
17544 
17545 // This flag specifies the maximum number of stack frames to be
17546 // printed in a failure message.
17547 GTEST_DECLARE_int32_(stack_trace_depth);
17548 
17549 // When this flag is specified, a failed assertion will throw an
17550 // exception if exceptions are enabled, or exit the program with a
17551 // non-zero code otherwise.
17552 GTEST_DECLARE_bool_(throw_on_failure);
17553 
17554 // When this flag is set with a "host:port" string, on supported
17555 // platforms test results are streamed to the specified port on
17556 // the specified host machine.
17557 GTEST_DECLARE_string_(stream_result_to);
17558 
17559 // The upper limit for valid stack trace depths.
17560 const int kMaxStackTraceDepth = 100;
17561 
17562 namespace internal {
17563 
17564 class AssertHelper;
17565 class DefaultGlobalTestPartResultReporter;
17566 class ExecDeathTest;
17567 class NoExecDeathTest;
17568 class FinalSuccessChecker;
17569 class GTestFlagSaver;
17570 class StreamingListenerTest;
17571 class TestResultAccessor;
17572 class TestEventListenersAccessor;
17573 class TestEventRepeater;
17574 class UnitTestRecordPropertyTestHelper;
17575 class WindowsDeathTest;
17576 class UnitTestImpl* GetUnitTestImpl();
17577 void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
17578                                     const std::string& message);
17579 
17580 }  // namespace internal
17581 
17582 // The friend relationship of some of these classes is cyclic.
17583 // If we don't forward declare them the compiler might confuse the classes
17584 // in friendship clauses with same named classes on the scope.
17585 class Test;
17586 class TestCase;
17587 class TestInfo;
17588 class UnitTest;
17589 
17590 // A class for indicating whether an assertion was successful.  When
17591 // the assertion wasn't successful, the AssertionResult object
17592 // remembers a non-empty message that describes how it failed.
17593 //
17594 // To create an instance of this class, use one of the factory functions
17595 // (AssertionSuccess() and AssertionFailure()).
17596 //
17597 // This class is useful for two purposes:
17598 //   1. Defining predicate functions to be used with Boolean test assertions
17599 //      EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
17600 //   2. Defining predicate-format functions to be
17601 //      used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
17602 //
17603 // For example, if you define IsEven predicate:
17604 //
17605 //   testing::AssertionResult IsEven(int n) {
17606 //     if ((n % 2) == 0)
17607 //       return testing::AssertionSuccess();
17608 //     else
17609 //       return testing::AssertionFailure() << n << " is odd";
17610 //   }
17611 //
17612 // Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
17613 // will print the message
17614 //
17615 //   Value of: IsEven(Fib(5))
17616 //     Actual: false (5 is odd)
17617 //   Expected: true
17618 //
17619 // instead of a more opaque
17620 //
17621 //   Value of: IsEven(Fib(5))
17622 //     Actual: false
17623 //   Expected: true
17624 //
17625 // in case IsEven is a simple Boolean predicate.
17626 //
17627 // If you expect your predicate to be reused and want to support informative
17628 // messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
17629 // about half as often as positive ones in our tests), supply messages for
17630 // both success and failure cases:
17631 //
17632 //   testing::AssertionResult IsEven(int n) {
17633 //     if ((n % 2) == 0)
17634 //       return testing::AssertionSuccess() << n << " is even";
17635 //     else
17636 //       return testing::AssertionFailure() << n << " is odd";
17637 //   }
17638 //
17639 // Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
17640 //
17641 //   Value of: IsEven(Fib(6))
17642 //     Actual: true (8 is even)
17643 //   Expected: false
17644 //
17645 // NB: Predicates that support negative Boolean assertions have reduced
17646 // performance in positive ones so be careful not to use them in tests
17647 // that have lots (tens of thousands) of positive Boolean assertions.
17648 //
17649 // To use this class with EXPECT_PRED_FORMAT assertions such as:
17650 //
17651 //   // Verifies that Foo() returns an even number.
17652 //   EXPECT_PRED_FORMAT1(IsEven, Foo());
17653 //
17654 // you need to define:
17655 //
17656 //   testing::AssertionResult IsEven(const char* expr, int n) {
17657 //     if ((n % 2) == 0)
17658 //       return testing::AssertionSuccess();
17659 //     else
17660 //       return testing::AssertionFailure()
17661 //         << "Expected: " << expr << " is even\n  Actual: it's " << n;
17662 //   }
17663 //
17664 // If Foo() returns 5, you will see the following message:
17665 //
17666 //   Expected: Foo() is even
17667 //     Actual: it's 5
17668 //
17669 class GTEST_API_ AssertionResult {
17670  public:
17671   // Copy constructor.
17672   // Used in EXPECT_TRUE/FALSE(assertion_result).
17673   AssertionResult(const AssertionResult& other);
17674   // Used in the EXPECT_TRUE/FALSE(bool_expression).
17675   explicit AssertionResult(bool success) : success_(success) {}
17676 
17677   // Returns true iff the assertion succeeded.
17678   operator bool() const { return success_; }  // NOLINT
17679 
17680   // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
17681   AssertionResult operator!() const;
17682 
17683   // Returns the text streamed into this AssertionResult. Test assertions
17684   // use it when they fail (i.e., the predicate's outcome doesn't match the
17685   // assertion's expectation). When nothing has been streamed into the
17686   // object, returns an empty string.
17687   const char* message() const {
17688     return message_.get() != NULL ?  message_->c_str() : "";
17689   }
17690   // TODO(vladl@google.com): Remove this after making sure no clients use it.
17691   // Deprecated; please use message() instead.
17692   const char* failure_message() const { return message(); }
17693 
17694   // Streams a custom failure message into this object.
17695   template <typename T> AssertionResult& operator<<(const T& value) {
17696     AppendMessage(Message() << value);
17697     return *this;
17698   }
17699 
17700   // Allows streaming basic output manipulators such as endl or flush into
17701   // this object.
17702   AssertionResult& operator<<(
17703       ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
17704     AppendMessage(Message() << basic_manipulator);
17705     return *this;
17706   }
17707 
17708  private:
17709   // Appends the contents of message to message_.
17710   void AppendMessage(const Message& a_message) {
17711     if (message_.get() == NULL)
17712       message_.reset(new ::std::string);
17713     message_->append(a_message.GetString().c_str());
17714   }
17715 
17716   // Stores result of the assertion predicate.
17717   bool success_;
17718   // Stores the message describing the condition in case the expectation
17719   // construct is not satisfied with the predicate's outcome.
17720   // Referenced via a pointer to avoid taking too much stack frame space
17721   // with test assertions.
17722   internal::scoped_ptr< ::std::string> message_;
17723 
17724   GTEST_DISALLOW_ASSIGN_(AssertionResult);
17725 };
17726 
17727 // Makes a successful assertion result.
17728 GTEST_API_ AssertionResult AssertionSuccess();
17729 
17730 // Makes a failed assertion result.
17731 GTEST_API_ AssertionResult AssertionFailure();
17732 
17733 // Makes a failed assertion result with the given failure message.
17734 // Deprecated; use AssertionFailure() << msg.
17735 GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
17736 
17737 // The abstract class that all tests inherit from.
17738 //
17739 // In Google Test, a unit test program contains one or many TestCases, and
17740 // each TestCase contains one or many Tests.
17741 //
17742 // When you define a test using the TEST macro, you don't need to
17743 // explicitly derive from Test - the TEST macro automatically does
17744 // this for you.
17745 //
17746 // The only time you derive from Test is when defining a test fixture
17747 // to be used a TEST_F.  For example:
17748 //
17749 //   class FooTest : public testing::Test {
17750 //    protected:
17751 //     virtual void SetUp() { ... }
17752 //     virtual void TearDown() { ... }
17753 //     ...
17754 //   };
17755 //
17756 //   TEST_F(FooTest, Bar) { ... }
17757 //   TEST_F(FooTest, Baz) { ... }
17758 //
17759 // Test is not copyable.
17760 class GTEST_API_ Test {
17761  public:
17762   friend class TestInfo;
17763 
17764   // Defines types for pointers to functions that set up and tear down
17765   // a test case.
17766   typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
17767   typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
17768 
17769   // The d'tor is virtual as we intend to inherit from Test.
17770   virtual ~Test();
17771 
17772   // Sets up the stuff shared by all tests in this test case.
17773   //
17774   // Google Test will call Foo::SetUpTestCase() before running the first
17775   // test in test case Foo.  Hence a sub-class can define its own
17776   // SetUpTestCase() method to shadow the one defined in the super
17777   // class.
17778   static void SetUpTestCase() {}
17779 
17780   // Tears down the stuff shared by all tests in this test case.
17781   //
17782   // Google Test will call Foo::TearDownTestCase() after running the last
17783   // test in test case Foo.  Hence a sub-class can define its own
17784   // TearDownTestCase() method to shadow the one defined in the super
17785   // class.
17786   static void TearDownTestCase() {}
17787 
17788   // Returns true iff the current test has a fatal failure.
17789   static bool HasFatalFailure();
17790 
17791   // Returns true iff the current test has a non-fatal failure.
17792   static bool HasNonfatalFailure();
17793 
17794   // Returns true iff the current test has a (either fatal or
17795   // non-fatal) failure.
17796   static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
17797 
17798   // Logs a property for the current test, test case, or for the entire
17799   // invocation of the test program when used outside of the context of a
17800   // test case.  Only the last value for a given key is remembered.  These
17801   // are public static so they can be called from utility functions that are
17802   // not members of the test fixture.  Calls to RecordProperty made during
17803   // lifespan of the test (from the moment its constructor starts to the
17804   // moment its destructor finishes) will be output in XML as attributes of
17805   // the <testcase> element.  Properties recorded from fixture's
17806   // SetUpTestCase or TearDownTestCase are logged as attributes of the
17807   // corresponding <testsuite> element.  Calls to RecordProperty made in the
17808   // global context (before or after invocation of RUN_ALL_TESTS and from
17809   // SetUp/TearDown method of Environment objects registered with Google
17810   // Test) will be output as attributes of the <testsuites> element.
17811   static void RecordProperty(const std::string& key, const std::string& value);
17812   static void RecordProperty(const std::string& key, int value);
17813 
17814  protected:
17815   // Creates a Test object.
17816   Test();
17817 
17818   // Sets up the test fixture.
17819   virtual void SetUp();
17820 
17821   // Tears down the test fixture.
17822   virtual void TearDown();
17823 
17824  private:
17825   // Returns true iff the current test has the same fixture class as
17826   // the first test in the current test case.
17827   static bool HasSameFixtureClass();
17828 
17829   // Runs the test after the test fixture has been set up.
17830   //
17831   // A sub-class must implement this to define the test logic.
17832   //
17833   // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
17834   // Instead, use the TEST or TEST_F macro.
17835   virtual void TestBody() = 0;
17836 
17837   // Sets up, executes, and tears down the test.
17838   void Run();
17839 
17840   // Deletes self.  We deliberately pick an unusual name for this
17841   // internal method to avoid clashing with names used in user TESTs.
17842   void DeleteSelf_() { delete this; }
17843 
17844   // Uses a GTestFlagSaver to save and restore all Google Test flags.
17845   const internal::GTestFlagSaver* const gtest_flag_saver_;
17846 
17847   // Often a user mis-spells SetUp() as Setup() and spends a long time
17848   // wondering why it is never called by Google Test.  The declaration of
17849   // the following method is solely for catching such an error at
17850   // compile time:
17851   //
17852   //   - The return type is deliberately chosen to be not void, so it
17853   //   will be a conflict if a user declares void Setup() in his test
17854   //   fixture.
17855   //
17856   //   - This method is private, so it will be another compiler error
17857   //   if a user calls it from his test fixture.
17858   //
17859   // DO NOT OVERRIDE THIS FUNCTION.
17860   //
17861   // If you see an error about overriding the following function or
17862   // about it being private, you have mis-spelled SetUp() as Setup().
17863   struct Setup_should_be_spelled_SetUp {};
17864   virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
17865 
17866   // We disallow copying Tests.
17867   GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
17868 };
17869 
17870 typedef internal::TimeInMillis TimeInMillis;
17871 
17872 // A copyable object representing a user specified test property which can be
17873 // output as a key/value string pair.
17874 //
17875 // Don't inherit from TestProperty as its destructor is not virtual.
17876 class TestProperty {
17877  public:
17878   // C'tor.  TestProperty does NOT have a default constructor.
17879   // Always use this constructor (with parameters) to create a
17880   // TestProperty object.
17881   TestProperty(const std::string& a_key, const std::string& a_value) :
17882     key_(a_key), value_(a_value) {
17883   }
17884 
17885   // Gets the user supplied key.
17886   const char* key() const {
17887     return key_.c_str();
17888   }
17889 
17890   // Gets the user supplied value.
17891   const char* value() const {
17892     return value_.c_str();
17893   }
17894 
17895   // Sets a new value, overriding the one supplied in the constructor.
17896   void SetValue(const std::string& new_value) {
17897     value_ = new_value;
17898   }
17899 
17900  private:
17901   // The key supplied by the user.
17902   std::string key_;
17903   // The value supplied by the user.
17904   std::string value_;
17905 };
17906 
17907 // The result of a single Test.  This includes a list of
17908 // TestPartResults, a list of TestProperties, a count of how many
17909 // death tests there are in the Test, and how much time it took to run
17910 // the Test.
17911 //
17912 // TestResult is not copyable.
17913 class GTEST_API_ TestResult {
17914  public:
17915   // Creates an empty TestResult.
17916   TestResult();
17917 
17918   // D'tor.  Do not inherit from TestResult.
17919   ~TestResult();
17920 
17921   // Gets the number of all test parts.  This is the sum of the number
17922   // of successful test parts and the number of failed test parts.
17923   int total_part_count() const;
17924 
17925   // Returns the number of the test properties.
17926   int test_property_count() const;
17927 
17928   // Returns true iff the test passed (i.e. no test part failed).
17929   bool Passed() const { return !Failed(); }
17930 
17931   // Returns true iff the test failed.
17932   bool Failed() const;
17933 
17934   // Returns true iff the test fatally failed.
17935   bool HasFatalFailure() const;
17936 
17937   // Returns true iff the test has a non-fatal failure.
17938   bool HasNonfatalFailure() const;
17939 
17940   // Returns the elapsed time, in milliseconds.
17941   TimeInMillis elapsed_time() const { return elapsed_time_; }
17942 
17943   // Returns the i-th test part result among all the results. i can range
17944   // from 0 to test_property_count() - 1. If i is not in that range, aborts
17945   // the program.
17946   const TestPartResult& GetTestPartResult(int i) const;
17947 
17948   // Returns the i-th test property. i can range from 0 to
17949   // test_property_count() - 1. If i is not in that range, aborts the
17950   // program.
17951   const TestProperty& GetTestProperty(int i) const;
17952 
17953  private:
17954   friend class TestInfo;
17955   friend class TestCase;
17956   friend class UnitTest;
17957   friend class internal::DefaultGlobalTestPartResultReporter;
17958   friend class internal::ExecDeathTest;
17959   friend class internal::TestResultAccessor;
17960   friend class internal::UnitTestImpl;
17961   friend class internal::WindowsDeathTest;
17962 
17963   // Gets the vector of TestPartResults.
17964   const std::vector<TestPartResult>& test_part_results() const {
17965     return test_part_results_;
17966   }
17967 
17968   // Gets the vector of TestProperties.
17969   const std::vector<TestProperty>& test_properties() const {
17970     return test_properties_;
17971   }
17972 
17973   // Sets the elapsed time.
17974   void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
17975 
17976   // Adds a test property to the list. The property is validated and may add
17977   // a non-fatal failure if invalid (e.g., if it conflicts with reserved
17978   // key names). If a property is already recorded for the same key, the
17979   // value will be updated, rather than storing multiple values for the same
17980   // key.  xml_element specifies the element for which the property is being
17981   // recorded and is used for validation.
17982   void RecordProperty(const std::string& xml_element,
17983                       const TestProperty& test_property);
17984 
17985   // Adds a failure if the key is a reserved attribute of Google Test
17986   // testcase tags.  Returns true if the property is valid.
17987   // TODO(russr): Validate attribute names are legal and human readable.
17988   static bool ValidateTestProperty(const std::string& xml_element,
17989                                    const TestProperty& test_property);
17990 
17991   // Adds a test part result to the list.
17992   void AddTestPartResult(const TestPartResult& test_part_result);
17993 
17994   // Returns the death test count.
17995   int death_test_count() const { return death_test_count_; }
17996 
17997   // Increments the death test count, returning the new count.
17998   int increment_death_test_count() { return ++death_test_count_; }
17999 
18000   // Clears the test part results.
18001   void ClearTestPartResults();
18002 
18003   // Clears the object.
18004   void Clear();
18005 
18006   // Protects mutable state of the property vector and of owned
18007   // properties, whose values may be updated.
18008   internal::Mutex test_properites_mutex_;
18009 
18010   // The vector of TestPartResults
18011   std::vector<TestPartResult> test_part_results_;
18012   // The vector of TestProperties
18013   std::vector<TestProperty> test_properties_;
18014   // Running count of death tests.
18015   int death_test_count_;
18016   // The elapsed time, in milliseconds.
18017   TimeInMillis elapsed_time_;
18018 
18019   // We disallow copying TestResult.
18020   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
18021 };  // class TestResult
18022 
18023 // A TestInfo object stores the following information about a test:
18024 //
18025 //   Test case name
18026 //   Test name
18027 //   Whether the test should be run
18028 //   A function pointer that creates the test object when invoked
18029 //   Test result
18030 //
18031 // The constructor of TestInfo registers itself with the UnitTest
18032 // singleton such that the RUN_ALL_TESTS() macro knows which tests to
18033 // run.
18034 class GTEST_API_ TestInfo {
18035  public:
18036   // Destructs a TestInfo object.  This function is not virtual, so
18037   // don't inherit from TestInfo.
18038   ~TestInfo();
18039 
18040   // Returns the test case name.
18041   const char* test_case_name() const { return test_case_name_.c_str(); }
18042 
18043   // Returns the test name.
18044   const char* name() const { return name_.c_str(); }
18045 
18046   // Returns the name of the parameter type, or NULL if this is not a typed
18047   // or a type-parameterized test.
18048   const char* type_param() const {
18049     if (type_param_.get() != NULL)
18050       return type_param_->c_str();
18051     return NULL;
18052   }
18053 
18054   // Returns the text representation of the value parameter, or NULL if this
18055   // is not a value-parameterized test.
18056   const char* value_param() const {
18057     if (value_param_.get() != NULL)
18058       return value_param_->c_str();
18059     return NULL;
18060   }
18061 
18062   // Returns true if this test should run, that is if the test is not
18063   // disabled (or it is disabled but the also_run_disabled_tests flag has
18064   // been specified) and its full name matches the user-specified filter.
18065   //
18066   // Google Test allows the user to filter the tests by their full names.
18067   // The full name of a test Bar in test case Foo is defined as
18068   // "Foo.Bar".  Only the tests that match the filter will run.
18069   //
18070   // A filter is a colon-separated list of glob (not regex) patterns,
18071   // optionally followed by a '-' and a colon-separated list of
18072   // negative patterns (tests to exclude).  A test is run if it
18073   // matches one of the positive patterns and does not match any of
18074   // the negative patterns.
18075   //
18076   // For example, *A*:Foo.* is a filter that matches any string that
18077   // contains the character 'A' or starts with "Foo.".
18078   bool should_run() const { return should_run_; }
18079 
18080   // Returns true iff this test will appear in the XML report.
18081   bool is_reportable() const {
18082     // For now, the XML report includes all tests matching the filter.
18083     // In the future, we may trim tests that are excluded because of
18084     // sharding.
18085     return matches_filter_;
18086   }
18087 
18088   // Returns the result of the test.
18089   const TestResult* result() const { return &result_; }
18090 
18091  private:
18092 #if GTEST_HAS_DEATH_TEST
18093   friend class internal::DefaultDeathTestFactory;
18094 #endif  // GTEST_HAS_DEATH_TEST
18095   friend class Test;
18096   friend class TestCase;
18097   friend class internal::UnitTestImpl;
18098   friend class internal::StreamingListenerTest;
18099   friend TestInfo* internal::MakeAndRegisterTestInfo(
18100       const char* test_case_name,
18101       const char* name,
18102       const char* type_param,
18103       const char* value_param,
18104       internal::TypeId fixture_class_id,
18105       Test::SetUpTestCaseFunc set_up_tc,
18106       Test::TearDownTestCaseFunc tear_down_tc,
18107       internal::TestFactoryBase* factory);
18108 
18109   // Constructs a TestInfo object. The newly constructed instance assumes
18110   // ownership of the factory object.
18111   TestInfo(const std::string& test_case_name,
18112            const std::string& name,
18113            const char* a_type_param,   // NULL if not a type-parameterized test
18114            const char* a_value_param,  // NULL if not a value-parameterized test
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 that will be reported in the XML report.
18201   int reportable_disabled_test_count() const;
18202 
18203   // Gets the number of disabled tests in this test case.
18204   int disabled_test_count() const;
18205 
18206   // Gets the number of tests to be printed in the XML report.
18207   int reportable_test_count() const;
18208 
18209   // Get the number of tests in this test case that should run.
18210   int test_to_run_count() const;
18211 
18212   // Gets the number of all tests in this test case.
18213   int total_test_count() const;
18214 
18215   // Returns true iff the test case passed.
18216   bool Passed() const { return !Failed(); }
18217 
18218   // Returns true iff the test case failed.
18219   bool Failed() const { return failed_test_count() > 0; }
18220 
18221   // Returns the elapsed time, in milliseconds.
18222   TimeInMillis elapsed_time() const { return elapsed_time_; }
18223 
18224   // Returns the i-th test among all the tests. i can range from 0 to
18225   // total_test_count() - 1. If i is not in that range, returns NULL.
18226   const TestInfo* GetTestInfo(int i) const;
18227 
18228   // Returns the TestResult that holds test properties recorded during
18229   // execution of SetUpTestCase and TearDownTestCase.
18230   const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
18231 
18232  private:
18233   friend class Test;
18234   friend class internal::UnitTestImpl;
18235 
18236   // Gets the (mutable) vector of TestInfos in this TestCase.
18237   std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
18238 
18239   // Gets the (immutable) vector of TestInfos in this TestCase.
18240   const std::vector<TestInfo*>& test_info_list() const {
18241     return test_info_list_;
18242   }
18243 
18244   // Returns the i-th test among all the tests. i can range from 0 to
18245   // total_test_count() - 1. If i is not in that range, returns NULL.
18246   TestInfo* GetMutableTestInfo(int i);
18247 
18248   // Sets the should_run member.
18249   void set_should_run(bool should) { should_run_ = should; }
18250 
18251   // Adds a TestInfo to this test case.  Will delete the TestInfo upon
18252   // destruction of the TestCase object.
18253   void AddTestInfo(TestInfo * test_info);
18254 
18255   // Clears the results of all tests in this test case.
18256   void ClearResult();
18257 
18258   // Clears the results of all tests in the given test case.
18259   static void ClearTestCaseResult(TestCase* test_case) {
18260     test_case->ClearResult();
18261   }
18262 
18263   // Runs every test in this TestCase.
18264   void Run();
18265 
18266   // Runs SetUpTestCase() for this TestCase.  This wrapper is needed
18267   // for catching exceptions thrown from SetUpTestCase().
18268   void RunSetUpTestCase() { (*set_up_tc_)(); }
18269 
18270   // Runs TearDownTestCase() for this TestCase.  This wrapper is
18271   // needed for catching exceptions thrown from TearDownTestCase().
18272   void RunTearDownTestCase() { (*tear_down_tc_)(); }
18273 
18274   // Returns true iff test passed.
18275   static bool TestPassed(const TestInfo* test_info) {
18276     return test_info->should_run() && test_info->result()->Passed();
18277   }
18278 
18279   // Returns true iff test failed.
18280   static bool TestFailed(const TestInfo* test_info) {
18281     return test_info->should_run() && test_info->result()->Failed();
18282   }
18283 
18284   // Returns true iff the test is disabled and will be reported in the XML
18285   // report.
18286   static bool TestReportableDisabled(const TestInfo* test_info) {
18287     return test_info->is_reportable() && test_info->is_disabled_;
18288   }
18289 
18290   // Returns true iff test is disabled.
18291   static bool TestDisabled(const TestInfo* test_info) {
18292     return test_info->is_disabled_;
18293   }
18294 
18295   // Returns true iff this test will appear in the XML report.
18296   static bool TestReportable(const TestInfo* test_info) {
18297     return test_info->is_reportable();
18298   }
18299 
18300   // Returns true if the given test should run.
18301   static bool ShouldRunTest(const TestInfo* test_info) {
18302     return test_info->should_run();
18303   }
18304 
18305   // Shuffles the tests in this test case.
18306   void ShuffleTests(internal::Random* random);
18307 
18308   // Restores the test order to before the first shuffle.
18309   void UnshuffleTests();
18310 
18311   // Name of the test case.
18312   std::string name_;
18313   // Name of the parameter type, or NULL if this is not a typed or a
18314   // type-parameterized test.
18315   const internal::scoped_ptr<const ::std::string> type_param_;
18316   // The vector of TestInfos in their original order.  It owns the
18317   // elements in the vector.
18318   std::vector<TestInfo*> test_info_list_;
18319   // Provides a level of indirection for the test list to allow easy
18320   // shuffling and restoring the test order.  The i-th element in this
18321   // vector is the index of the i-th test in the shuffled test list.
18322   std::vector<int> test_indices_;
18323   // Pointer to the function that sets up the test case.
18324   Test::SetUpTestCaseFunc set_up_tc_;
18325   // Pointer to the function that tears down the test case.
18326   Test::TearDownTestCaseFunc tear_down_tc_;
18327   // True iff any test in this test case should run.
18328   bool should_run_;
18329   // Elapsed time, in milliseconds.
18330   TimeInMillis elapsed_time_;
18331   // Holds test properties recorded during execution of SetUpTestCase and
18332   // TearDownTestCase.
18333   TestResult ad_hoc_test_result_;
18334 
18335   // We disallow copying TestCases.
18336   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
18337 };
18338 
18339 // An Environment object is capable of setting up and tearing down an
18340 // environment.  The user should subclass this to define his own
18341 // environment(s).
18342 //
18343 // An Environment object does the set-up and tear-down in virtual
18344 // methods SetUp() and TearDown() instead of the constructor and the
18345 // destructor, as:
18346 //
18347 //   1. You cannot safely throw from a destructor.  This is a problem
18348 //      as in some cases Google Test is used where exceptions are enabled, and
18349 //      we may want to implement ASSERT_* using exceptions where they are
18350 //      available.
18351 //   2. You cannot use ASSERT_* directly in a constructor or
18352 //      destructor.
18353 class Environment {
18354  public:
18355   // The d'tor is virtual as we need to subclass Environment.
18356   virtual ~Environment() {}
18357 
18358   // Override this to define how to set up the environment.
18359   virtual void SetUp() {}
18360 
18361   // Override this to define how to tear down the environment.
18362   virtual void TearDown() {}
18363  private:
18364   // If you see an error about overriding the following function or
18365   // about it being private, you have mis-spelled SetUp() as Setup().
18366   struct Setup_should_be_spelled_SetUp {};
18367   virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
18368 };
18369 
18370 // The interface for tracing execution of tests. The methods are organized in
18371 // the order the corresponding events are fired.
18372 class TestEventListener {
18373  public:
18374   virtual ~TestEventListener() {}
18375 
18376   // Fired before any test activity starts.
18377   virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
18378 
18379   // Fired before each iteration of tests starts.  There may be more than
18380   // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
18381   // index, starting from 0.
18382   virtual void OnTestIterationStart(const UnitTest& unit_test,
18383                                     int iteration) = 0;
18384 
18385   // Fired before environment set-up for each iteration of tests starts.
18386   virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
18387 
18388   // Fired after environment set-up for each iteration of tests ends.
18389   virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
18390 
18391   // Fired before the test case starts.
18392   virtual void OnTestCaseStart(const TestCase& test_case) = 0;
18393 
18394   // Fired before the test starts.
18395   virtual void OnTestStart(const TestInfo& test_info) = 0;
18396 
18397   // Fired after a failed assertion or a SUCCEED() invocation.
18398   virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
18399 
18400   // Fired after the test ends.
18401   virtual void OnTestEnd(const TestInfo& test_info) = 0;
18402 
18403   // Fired after the test case ends.
18404   virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
18405 
18406   // Fired before environment tear-down for each iteration of tests starts.
18407   virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
18408 
18409   // Fired after environment tear-down for each iteration of tests ends.
18410   virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
18411 
18412   // Fired after each iteration of tests finishes.
18413   virtual void OnTestIterationEnd(const UnitTest& unit_test,
18414                                   int iteration) = 0;
18415 
18416   // Fired after all test activities have ended.
18417   virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
18418 };
18419 
18420 // The convenience class for users who need to override just one or two
18421 // methods and are not concerned that a possible change to a signature of
18422 // the methods they override will not be caught during the build.  For
18423 // comments about each method please see the definition of TestEventListener
18424 // above.
18425 class EmptyTestEventListener : public TestEventListener {
18426  public:
18427   virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
18428   virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
18429                                     int /*iteration*/) {}
18430   virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
18431   virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
18432   virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
18433   virtual void OnTestStart(const TestInfo& /*test_info*/) {}
18434   virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
18435   virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
18436   virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
18437   virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
18438   virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
18439   virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
18440                                   int /*iteration*/) {}
18441   virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
18442 };
18443 
18444 // TestEventListeners lets users add listeners to track events in Google Test.
18445 class GTEST_API_ TestEventListeners {
18446  public:
18447   TestEventListeners();
18448   ~TestEventListeners();
18449 
18450   // Appends an event listener to the end of the list. Google Test assumes
18451   // the ownership of the listener (i.e. it will delete the listener when
18452   // the test program finishes).
18453   void Append(TestEventListener* listener);
18454 
18455   // Removes the given event listener from the list and returns it.  It then
18456   // becomes the caller's responsibility to delete the listener. Returns
18457   // NULL if the listener is not found in the list.
18458   TestEventListener* Release(TestEventListener* listener);
18459 
18460   // Returns the standard listener responsible for the default console
18461   // output.  Can be removed from the listeners list to shut down default
18462   // console output.  Note that removing this object from the listener list
18463   // with Release transfers its ownership to the caller and makes this
18464   // function return NULL the next time.
18465   TestEventListener* default_result_printer() const {
18466     return default_result_printer_;
18467   }
18468 
18469   // Returns the standard listener responsible for the default XML output
18470   // controlled by the --gtest_output=xml flag.  Can be removed from the
18471   // listeners list by users who want to shut down the default XML output
18472   // controlled by this flag and substitute it with custom one.  Note that
18473   // removing this object from the listener list with Release transfers its
18474   // ownership to the caller and makes this function return NULL the next
18475   // time.
18476   TestEventListener* default_xml_generator() const {
18477     return default_xml_generator_;
18478   }
18479 
18480  private:
18481   friend class TestCase;
18482   friend class TestInfo;
18483   friend class internal::DefaultGlobalTestPartResultReporter;
18484   friend class internal::NoExecDeathTest;
18485   friend class internal::TestEventListenersAccessor;
18486   friend class internal::UnitTestImpl;
18487 
18488   // Returns repeater that broadcasts the TestEventListener events to all
18489   // subscribers.
18490   TestEventListener* repeater();
18491 
18492   // Sets the default_result_printer attribute to the provided listener.
18493   // The listener is also added to the listener list and previous
18494   // default_result_printer is removed from it and deleted. The listener can
18495   // also be NULL in which case it will not be added to the list. Does
18496   // nothing if the previous and the current listener objects are the same.
18497   void SetDefaultResultPrinter(TestEventListener* listener);
18498 
18499   // Sets the default_xml_generator attribute to the provided listener.  The
18500   // listener is also added to the listener list and previous
18501   // default_xml_generator is removed from it and deleted. The listener can
18502   // also be NULL in which case it will not be added to the list. Does
18503   // nothing if the previous and the current listener objects are the same.
18504   void SetDefaultXmlGenerator(TestEventListener* listener);
18505 
18506   // Controls whether events will be forwarded by the repeater to the
18507   // listeners in the list.
18508   bool EventForwardingEnabled() const;
18509   void SuppressEventForwarding();
18510 
18511   // The actual list of listeners.
18512   internal::TestEventRepeater* repeater_;
18513   // Listener responsible for the standard result output.
18514   TestEventListener* default_result_printer_;
18515   // Listener responsible for the creation of the XML output file.
18516   TestEventListener* default_xml_generator_;
18517 
18518   // We disallow copying TestEventListeners.
18519   GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
18520 };
18521 
18522 // A UnitTest consists of a vector of TestCases.
18523 //
18524 // This is a singleton class.  The only instance of UnitTest is
18525 // created when UnitTest::GetInstance() is first called.  This
18526 // instance is never deleted.
18527 //
18528 // UnitTest is not copyable.
18529 //
18530 // This class is thread-safe as long as the methods are called
18531 // according to their specification.
18532 class GTEST_API_ UnitTest {
18533  public:
18534   // Gets the singleton UnitTest object.  The first time this method
18535   // is called, a UnitTest object is constructed and returned.
18536   // Consecutive calls will return the same object.
18537   static UnitTest* GetInstance();
18538 
18539   // Runs all tests in this UnitTest object and prints the result.
18540   // Returns 0 if successful, or 1 otherwise.
18541   //
18542   // This method can only be called from the main thread.
18543   //
18544   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18545   int Run() GTEST_MUST_USE_RESULT_;
18546 
18547   // Returns the working directory when the first TEST() or TEST_F()
18548   // was executed.  The UnitTest object owns the string.
18549   const char* original_working_dir() const;
18550 
18551   // Returns the TestCase object for the test that's currently running,
18552   // or NULL if no test is running.
18553   const TestCase* current_test_case() const
18554       GTEST_LOCK_EXCLUDED_(mutex_);
18555 
18556   // Returns the TestInfo object for the test that's currently running,
18557   // or NULL if no test is running.
18558   const TestInfo* current_test_info() const
18559       GTEST_LOCK_EXCLUDED_(mutex_);
18560 
18561   // Returns the random seed used at the start of the current test run.
18562   int random_seed() const;
18563 
18564 #if GTEST_HAS_PARAM_TEST
18565   // Returns the ParameterizedTestCaseRegistry object used to keep track of
18566   // value-parameterized tests and instantiate and register them.
18567   //
18568   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18569   internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
18570       GTEST_LOCK_EXCLUDED_(mutex_);
18571 #endif  // GTEST_HAS_PARAM_TEST
18572 
18573   // Gets the number of successful test cases.
18574   int successful_test_case_count() const;
18575 
18576   // Gets the number of failed test cases.
18577   int failed_test_case_count() const;
18578 
18579   // Gets the number of all test cases.
18580   int total_test_case_count() const;
18581 
18582   // Gets the number of all test cases that contain at least one test
18583   // that should run.
18584   int test_case_to_run_count() const;
18585 
18586   // Gets the number of successful tests.
18587   int successful_test_count() const;
18588 
18589   // Gets the number of failed tests.
18590   int failed_test_count() const;
18591 
18592   // Gets the number of disabled tests that will be reported in the XML report.
18593   int reportable_disabled_test_count() const;
18594 
18595   // Gets the number of disabled tests.
18596   int disabled_test_count() const;
18597 
18598   // Gets the number of tests to be printed in the XML report.
18599   int reportable_test_count() const;
18600 
18601   // Gets the number of all tests.
18602   int total_test_count() const;
18603 
18604   // Gets the number of tests that should run.
18605   int test_to_run_count() const;
18606 
18607   // Gets the time of the test program start, in ms from the start of the
18608   // UNIX epoch.
18609   TimeInMillis start_timestamp() const;
18610 
18611   // Gets the elapsed time, in milliseconds.
18612   TimeInMillis elapsed_time() const;
18613 
18614   // Returns true iff the unit test passed (i.e. all test cases passed).
18615   bool Passed() const;
18616 
18617   // Returns true iff the unit test failed (i.e. some test case failed
18618   // or something outside of all tests failed).
18619   bool Failed() const;
18620 
18621   // Gets the i-th test case among all the test cases. i can range from 0 to
18622   // total_test_case_count() - 1. If i is not in that range, returns NULL.
18623   const TestCase* GetTestCase(int i) const;
18624 
18625   // Returns the TestResult containing information on test failures and
18626   // properties logged outside of individual test cases.
18627   const TestResult& ad_hoc_test_result() const;
18628 
18629   // Returns the list of event listeners that can be used to track events
18630   // inside Google Test.
18631   TestEventListeners& listeners();
18632 
18633  private:
18634   // Registers and returns a global test environment.  When a test
18635   // program is run, all global test environments will be set-up in
18636   // the order they were registered.  After all tests in the program
18637   // have finished, all global test environments will be torn-down in
18638   // the *reverse* order they were registered.
18639   //
18640   // The UnitTest object takes ownership of the given environment.
18641   //
18642   // This method can only be called from the main thread.
18643   Environment* AddEnvironment(Environment* env);
18644 
18645   // Adds a TestPartResult to the current TestResult object.  All
18646   // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
18647   // eventually call this to report their results.  The user code
18648   // should use the assertion macros instead of calling this directly.
18649   void AddTestPartResult(TestPartResult::Type result_type,
18650                          const char* file_name,
18651                          int line_number,
18652                          const std::string& message,
18653                          const std::string& os_stack_trace)
18654       GTEST_LOCK_EXCLUDED_(mutex_);
18655 
18656   // Adds a TestProperty to the current TestResult object when invoked from
18657   // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
18658   // from SetUpTestCase or TearDownTestCase, or to the global property set
18659   // when invoked elsewhere.  If the result already contains a property with
18660   // the same key, the value will be updated.
18661   void RecordProperty(const std::string& key, const std::string& value);
18662 
18663   // Gets the i-th test case among all the test cases. i can range from 0 to
18664   // total_test_case_count() - 1. If i is not in that range, returns NULL.
18665   TestCase* GetMutableTestCase(int i);
18666 
18667   // Accessors for the implementation object.
18668   internal::UnitTestImpl* impl() { return impl_; }
18669   const internal::UnitTestImpl* impl() const { return impl_; }
18670 
18671   // These classes and funcions are friends as they need to access private
18672   // members of UnitTest.
18673   friend class Test;
18674   friend class internal::AssertHelper;
18675   friend class internal::ScopedTrace;
18676   friend class internal::StreamingListenerTest;
18677   friend class internal::UnitTestRecordPropertyTestHelper;
18678   friend Environment* AddGlobalTestEnvironment(Environment* env);
18679   friend internal::UnitTestImpl* internal::GetUnitTestImpl();
18680   friend void internal::ReportFailureInUnknownLocation(
18681       TestPartResult::Type result_type,
18682       const std::string& message);
18683 
18684   // Creates an empty UnitTest.
18685   UnitTest();
18686 
18687   // D'tor
18688   virtual ~UnitTest();
18689 
18690   // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
18691   // Google Test trace stack.
18692   void PushGTestTrace(const internal::TraceInfo& trace)
18693       GTEST_LOCK_EXCLUDED_(mutex_);
18694 
18695   // Pops a trace from the per-thread Google Test trace stack.
18696   void PopGTestTrace()
18697       GTEST_LOCK_EXCLUDED_(mutex_);
18698 
18699   // Protects mutable state in *impl_.  This is mutable as some const
18700   // methods need to lock it too.
18701   mutable internal::Mutex mutex_;
18702 
18703   // Opaque implementation object.  This field is never changed once
18704   // the object is constructed.  We don't mark it as const here, as
18705   // doing so will cause a warning in the constructor of UnitTest.
18706   // Mutable state in *impl_ is protected by mutex_.
18707   internal::UnitTestImpl* impl_;
18708 
18709   // We disallow copying UnitTest.
18710   GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
18711 };
18712 
18713 // A convenient wrapper for adding an environment for the test
18714 // program.
18715 //
18716 // You should call this before RUN_ALL_TESTS() is called, probably in
18717 // main().  If you use gtest_main, you need to call this before main()
18718 // starts for it to take effect.  For example, you can define a global
18719 // variable like this:
18720 //
18721 //   testing::Environment* const foo_env =
18722 //       testing::AddGlobalTestEnvironment(new FooEnvironment);
18723 //
18724 // However, we strongly recommend you to write your own main() and
18725 // call AddGlobalTestEnvironment() there, as relying on initialization
18726 // of global variables makes the code harder to read and may cause
18727 // problems when you register multiple environments from different
18728 // translation units and the environments have dependencies among them
18729 // (remember that the compiler doesn't guarantee the order in which
18730 // global variables from different translation units are initialized).
18731 inline Environment* AddGlobalTestEnvironment(Environment* env) {
18732   return UnitTest::GetInstance()->AddEnvironment(env);
18733 }
18734 
18735 // Initializes Google Test.  This must be called before calling
18736 // RUN_ALL_TESTS().  In particular, it parses a command line for the
18737 // flags that Google Test recognizes.  Whenever a Google Test flag is
18738 // seen, it is removed from argv, and *argc is decremented.
18739 //
18740 // No value is returned.  Instead, the Google Test flag variables are
18741 // updated.
18742 //
18743 // Calling the function for the second time has no user-visible effect.
18744 GTEST_API_ void InitGoogleTest(int* argc, char** argv);
18745 
18746 // This overloaded version can be used in Windows programs compiled in
18747 // UNICODE mode.
18748 GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
18749 
18750 namespace internal {
18751 
18752 // FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
18753 // value of type ToPrint that is an operand of a comparison assertion
18754 // (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in
18755 // the comparison, and is used to help determine the best way to
18756 // format the value.  In particular, when the value is a C string
18757 // (char pointer) and the other operand is an STL string object, we
18758 // want to format the C string as a string, since we know it is
18759 // compared by value with the string object.  If the value is a char
18760 // pointer but the other operand is not an STL string object, we don't
18761 // know whether the pointer is supposed to point to a NUL-terminated
18762 // string, and thus want to print it as a pointer to be safe.
18763 //
18764 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18765 
18766 // The default case.
18767 template <typename ToPrint, typename OtherOperand>
18768 class FormatForComparison {
18769  public:
18770   static ::std::string Format(const ToPrint& value) {
18771     return ::testing::PrintToString(value);
18772   }
18773 };
18774 
18775 // Array.
18776 template <typename ToPrint, size_t N, typename OtherOperand>
18777 class FormatForComparison<ToPrint[N], OtherOperand> {
18778  public:
18779   static ::std::string Format(const ToPrint* value) {
18780     return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
18781   }
18782 };
18783 
18784 // By default, print C string as pointers to be safe, as we don't know
18785 // whether they actually point to a NUL-terminated string.
18786 
18787 #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \
18788   template <typename OtherOperand>                                      \
18789   class FormatForComparison<CharType*, OtherOperand> {                  \
18790    public:                                                              \
18791     static ::std::string Format(CharType* value) {                      \
18792       return ::testing::PrintToString(static_cast<const void*>(value)); \
18793     }                                                                   \
18794   }
18795 
18796 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
18797 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
18798 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
18799 GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
18800 
18801 #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
18802 
18803 // If a C string is compared with an STL string object, we know it's meant
18804 // to point to a NUL-terminated string, and thus can print it as a string.
18805 
18806 #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
18807   template <>                                                           \
18808   class FormatForComparison<CharType*, OtherStringType> {               \
18809    public:                                                              \
18810     static ::std::string Format(CharType* value) {                      \
18811       return ::testing::PrintToString(value);                           \
18812     }                                                                   \
18813   }
18814 
18815 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
18816 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
18817 
18818 #if GTEST_HAS_GLOBAL_STRING
18819 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
18820 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
18821 #endif
18822 
18823 #if GTEST_HAS_GLOBAL_WSTRING
18824 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
18825 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
18826 #endif
18827 
18828 #if GTEST_HAS_STD_WSTRING
18829 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
18830 GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
18831 #endif
18832 
18833 #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
18834 
18835 // Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
18836 // operand to be used in a failure message.  The type (but not value)
18837 // of the other operand may affect the format.  This allows us to
18838 // print a char* as a raw pointer when it is compared against another
18839 // char* or void*, and print it as a C string when it is compared
18840 // against an std::string object, for example.
18841 //
18842 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18843 template <typename T1, typename T2>
18844 std::string FormatForComparisonFailureMessage(
18845     const T1& value, const T2& /* other_operand */) {
18846   return FormatForComparison<T1, T2>::Format(value);
18847 }
18848 
18849 // The helper function for {ASSERT|EXPECT}_EQ.
18850 template <typename T1, typename T2>
18851 AssertionResult CmpHelperEQ(const char* expected_expression,
18852                             const char* actual_expression,
18853                             const T1& expected,
18854                             const T2& actual) {
18855 #ifdef _MSC_VER
18856 # pragma warning(push)          // Saves the current warning state.
18857 # pragma warning(disable:4389)  // Temporarily disables warning on
18858                                 // signed/unsigned mismatch.
18859 #endif
18860 
18861   if (expected == actual) {
18862     return AssertionSuccess();
18863   }
18864 
18865 #ifdef _MSC_VER
18866 # pragma warning(pop)          // Restores the warning state.
18867 #endif
18868 
18869   return EqFailure(expected_expression,
18870                    actual_expression,
18871                    FormatForComparisonFailureMessage(expected, actual),
18872                    FormatForComparisonFailureMessage(actual, expected),
18873                    false);
18874 }
18875 
18876 // With this overloaded version, we allow anonymous enums to be used
18877 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
18878 // can be implicitly cast to BiggestInt.
18879 GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
18880                                        const char* actual_expression,
18881                                        BiggestInt expected,
18882                                        BiggestInt actual);
18883 
18884 // The helper class for {ASSERT|EXPECT}_EQ.  The template argument
18885 // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
18886 // is a null pointer literal.  The following default implementation is
18887 // for lhs_is_null_literal being false.
18888 template <bool lhs_is_null_literal>
18889 class EqHelper {
18890  public:
18891   // This templatized version is for the general case.
18892   template <typename T1, typename T2>
18893   static AssertionResult Compare(const char* expected_expression,
18894                                  const char* actual_expression,
18895                                  const T1& expected,
18896                                  const T2& actual) {
18897     return CmpHelperEQ(expected_expression, actual_expression, expected,
18898                        actual);
18899   }
18900 
18901   // With this overloaded version, we allow anonymous enums to be used
18902   // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
18903   // enums can be implicitly cast to BiggestInt.
18904   //
18905   // Even though its body looks the same as the above version, we
18906   // cannot merge the two, as it will make anonymous enums unhappy.
18907   static AssertionResult Compare(const char* expected_expression,
18908                                  const char* actual_expression,
18909                                  BiggestInt expected,
18910                                  BiggestInt actual) {
18911     return CmpHelperEQ(expected_expression, actual_expression, expected,
18912                        actual);
18913   }
18914 };
18915 
18916 // This specialization is used when the first argument to ASSERT_EQ()
18917 // is a null pointer literal, like NULL, false, or 0.
18918 template <>
18919 class EqHelper<true> {
18920  public:
18921   // We define two overloaded versions of Compare().  The first
18922   // version will be picked when the second argument to ASSERT_EQ() is
18923   // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
18924   // EXPECT_EQ(false, a_bool).
18925   template <typename T1, typename T2>
18926   static AssertionResult Compare(
18927       const char* expected_expression,
18928       const char* actual_expression,
18929       const T1& expected,
18930       const T2& actual,
18931       // The following line prevents this overload from being considered if T2
18932       // is not a pointer type.  We need this because ASSERT_EQ(NULL, my_ptr)
18933       // expands to Compare("", "", NULL, my_ptr), which requires a conversion
18934       // to match the Secret* in the other overload, which would otherwise make
18935       // this template match better.
18936       typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
18937     return CmpHelperEQ(expected_expression, actual_expression, expected,
18938                        actual);
18939   }
18940 
18941   // This version will be picked when the second argument to ASSERT_EQ() is a
18942   // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
18943   template <typename T>
18944   static AssertionResult Compare(
18945       const char* expected_expression,
18946       const char* actual_expression,
18947       // We used to have a second template parameter instead of Secret*.  That
18948       // template parameter would deduce to 'long', making this a better match
18949       // than the first overload even without the first overload's EnableIf.
18950       // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
18951       // non-pointer argument" (even a deduced integral argument), so the old
18952       // implementation caused warnings in user code.
18953       Secret* /* expected (NULL) */,
18954       T* actual) {
18955     // We already know that 'expected' is a null pointer.
18956     return CmpHelperEQ(expected_expression, actual_expression,
18957                        static_cast<T*>(NULL), actual);
18958   }
18959 };
18960 
18961 // A macro for implementing the helper functions needed to implement
18962 // ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste
18963 // of similar code.
18964 //
18965 // For each templatized helper function, we also define an overloaded
18966 // version for BiggestInt in order to reduce code bloat and allow
18967 // anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
18968 // with gcc 4.
18969 //
18970 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18971 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
18972 template <typename T1, typename T2>\
18973 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
18974                                    const T1& val1, const T2& val2) {\
18975   if (val1 op val2) {\
18976     return AssertionSuccess();\
18977   } else {\
18978     return AssertionFailure() \
18979         << "Expected: (" << expr1 << ") " #op " (" << expr2\
18980         << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
18981         << " vs " << FormatForComparisonFailureMessage(val2, val1);\
18982   }\
18983 }\
18984 GTEST_API_ AssertionResult CmpHelper##op_name(\
18985     const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
18986 
18987 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
18988 
18989 // Implements the helper function for {ASSERT|EXPECT}_NE
18990 GTEST_IMPL_CMP_HELPER_(NE, !=);
18991 // Implements the helper function for {ASSERT|EXPECT}_LE
18992 GTEST_IMPL_CMP_HELPER_(LE, <=);
18993 // Implements the helper function for {ASSERT|EXPECT}_LT
18994 GTEST_IMPL_CMP_HELPER_(LT, <);
18995 // Implements the helper function for {ASSERT|EXPECT}_GE
18996 GTEST_IMPL_CMP_HELPER_(GE, >=);
18997 // Implements the helper function for {ASSERT|EXPECT}_GT
18998 GTEST_IMPL_CMP_HELPER_(GT, >);
18999 
19000 #undef GTEST_IMPL_CMP_HELPER_
19001 
19002 // The helper function for {ASSERT|EXPECT}_STREQ.
19003 //
19004 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19005 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19006                                           const char* actual_expression,
19007                                           const char* expected,
19008                                           const char* actual);
19009 
19010 // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
19011 //
19012 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19013 GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
19014                                               const char* actual_expression,
19015                                               const char* expected,
19016                                               const char* actual);
19017 
19018 // The helper function for {ASSERT|EXPECT}_STRNE.
19019 //
19020 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19021 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19022                                           const char* s2_expression,
19023                                           const char* s1,
19024                                           const char* s2);
19025 
19026 // The helper function for {ASSERT|EXPECT}_STRCASENE.
19027 //
19028 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19029 GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
19030                                               const char* s2_expression,
19031                                               const char* s1,
19032                                               const char* s2);
19033 
19034 
19035 // Helper function for *_STREQ on wide strings.
19036 //
19037 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19038 GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
19039                                           const char* actual_expression,
19040                                           const wchar_t* expected,
19041                                           const wchar_t* actual);
19042 
19043 // Helper function for *_STRNE on wide strings.
19044 //
19045 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19046 GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
19047                                           const char* s2_expression,
19048                                           const wchar_t* s1,
19049                                           const wchar_t* s2);
19050 
19051 }  // namespace internal
19052 
19053 // IsSubstring() and IsNotSubstring() are intended to be used as the
19054 // first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
19055 // themselves.  They check whether needle is a substring of haystack
19056 // (NULL is considered a substring of itself only), and return an
19057 // appropriate error message when they fail.
19058 //
19059 // The {needle,haystack}_expr arguments are the stringified
19060 // expressions that generated the two real arguments.
19061 GTEST_API_ AssertionResult IsSubstring(
19062     const char* needle_expr, const char* haystack_expr,
19063     const char* needle, const char* haystack);
19064 GTEST_API_ AssertionResult IsSubstring(
19065     const char* needle_expr, const char* haystack_expr,
19066     const wchar_t* needle, const wchar_t* haystack);
19067 GTEST_API_ AssertionResult IsNotSubstring(
19068     const char* needle_expr, const char* haystack_expr,
19069     const char* needle, const char* haystack);
19070 GTEST_API_ AssertionResult IsNotSubstring(
19071     const char* needle_expr, const char* haystack_expr,
19072     const wchar_t* needle, const wchar_t* haystack);
19073 GTEST_API_ AssertionResult IsSubstring(
19074     const char* needle_expr, const char* haystack_expr,
19075     const ::std::string& needle, const ::std::string& haystack);
19076 GTEST_API_ AssertionResult IsNotSubstring(
19077     const char* needle_expr, const char* haystack_expr,
19078     const ::std::string& needle, const ::std::string& haystack);
19079 
19080 #if GTEST_HAS_STD_WSTRING
19081 GTEST_API_ AssertionResult IsSubstring(
19082     const char* needle_expr, const char* haystack_expr,
19083     const ::std::wstring& needle, const ::std::wstring& haystack);
19084 GTEST_API_ AssertionResult IsNotSubstring(
19085     const char* needle_expr, const char* haystack_expr,
19086     const ::std::wstring& needle, const ::std::wstring& haystack);
19087 #endif  // GTEST_HAS_STD_WSTRING
19088 
19089 namespace internal {
19090 
19091 // Helper template function for comparing floating-points.
19092 //
19093 // Template parameter:
19094 //
19095 //   RawType: the raw floating-point type (either float or double)
19096 //
19097 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19098 template <typename RawType>
19099 AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
19100                                          const char* actual_expression,
19101                                          RawType expected,
19102                                          RawType actual) {
19103   const FloatingPoint<RawType> lhs(expected), rhs(actual);
19104 
19105   if (lhs.AlmostEquals(rhs)) {
19106     return AssertionSuccess();
19107   }
19108 
19109   ::std::stringstream expected_ss;
19110   expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19111               << expected;
19112 
19113   ::std::stringstream actual_ss;
19114   actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
19115             << actual;
19116 
19117   return EqFailure(expected_expression,
19118                    actual_expression,
19119                    StringStreamToString(&expected_ss),
19120                    StringStreamToString(&actual_ss),
19121                    false);
19122 }
19123 
19124 // Helper function for implementing ASSERT_NEAR.
19125 //
19126 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
19127 GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
19128                                                 const char* expr2,
19129                                                 const char* abs_error_expr,
19130                                                 double val1,
19131                                                 double val2,
19132                                                 double abs_error);
19133 
19134 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
19135 // A class that enables one to stream messages to assertion macros
19136 class GTEST_API_ AssertHelper {
19137  public:
19138   // Constructor.
19139   AssertHelper(TestPartResult::Type type,
19140                const char* file,
19141                int line,
19142                const char* message);
19143   ~AssertHelper();
19144 
19145   // Message assignment is a semantic trick to enable assertion
19146   // streaming; see the GTEST_MESSAGE_ macro below.
19147   void operator=(const Message& message) const;
19148 
19149  private:
19150   // We put our data in a struct so that the size of the AssertHelper class can
19151   // be as small as possible.  This is important because gcc is incapable of
19152   // re-using stack space even for temporary variables, so every EXPECT_EQ
19153   // reserves stack space for another AssertHelper.
19154   struct AssertHelperData {
19155     AssertHelperData(TestPartResult::Type t,
19156                      const char* srcfile,
19157                      int line_num,
19158                      const char* msg)
19159         : type(t), file(srcfile), line(line_num), message(msg) { }
19160 
19161     TestPartResult::Type const type;
19162     const char* const file;
19163     int const line;
19164     std::string const message;
19165 
19166    private:
19167     GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
19168   };
19169 
19170   AssertHelperData* const data_;
19171 
19172   GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
19173 };
19174 
19175 }  // namespace internal
19176 
19177 #if GTEST_HAS_PARAM_TEST
19178 // The pure interface class that all value-parameterized tests inherit from.
19179 // A value-parameterized class must inherit from both ::testing::Test and
19180 // ::testing::WithParamInterface. In most cases that just means inheriting
19181 // from ::testing::TestWithParam, but more complicated test hierarchies
19182 // may need to inherit from Test and WithParamInterface at different levels.
19183 //
19184 // This interface has support for accessing the test parameter value via
19185 // the GetParam() method.
19186 //
19187 // Use it with one of the parameter generator defining functions, like Range(),
19188 // Values(), ValuesIn(), Bool(), and Combine().
19189 //
19190 // class FooTest : public ::testing::TestWithParam<int> {
19191 //  protected:
19192 //   FooTest() {
19193 //     // Can use GetParam() here.
19194 //   }
19195 //   virtual ~FooTest() {
19196 //     // Can use GetParam() here.
19197 //   }
19198 //   virtual void SetUp() {
19199 //     // Can use GetParam() here.
19200 //   }
19201 //   virtual void TearDown {
19202 //     // Can use GetParam() here.
19203 //   }
19204 // };
19205 // TEST_P(FooTest, DoesBar) {
19206 //   // Can use GetParam() method here.
19207 //   Foo foo;
19208 //   ASSERT_TRUE(foo.DoesBar(GetParam()));
19209 // }
19210 // INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
19211 
19212 template <typename T>
19213 class WithParamInterface {
19214  public:
19215   typedef T ParamType;
19216   virtual ~WithParamInterface() {}
19217 
19218   // The current parameter value. Is also available in the test fixture's
19219   // constructor. This member function is non-static, even though it only
19220   // references static data, to reduce the opportunity for incorrect uses
19221   // like writing 'WithParamInterface<bool>::GetParam()' for a test that
19222   // uses a fixture whose parameter type is int.
19223   const ParamType& GetParam() const {
19224     GTEST_CHECK_(parameter_ != NULL)
19225         << "GetParam() can only be called inside a value-parameterized test "
19226         << "-- did you intend to write TEST_P instead of TEST_F?";
19227     return *parameter_;
19228   }
19229 
19230  private:
19231   // Sets parameter value. The caller is responsible for making sure the value
19232   // remains alive and unchanged throughout the current test.
19233   static void SetParam(const ParamType* parameter) {
19234     parameter_ = parameter;
19235   }
19236 
19237   // Static value used for accessing parameter during a test lifetime.
19238   static const ParamType* parameter_;
19239 
19240   // TestClass must be a subclass of WithParamInterface<T> and Test.
19241   template <class TestClass> friend class internal::ParameterizedTestFactory;
19242 };
19243 
19244 template <typename T>
19245 const T* WithParamInterface<T>::parameter_ = NULL;
19246 
19247 // Most value-parameterized classes can ignore the existence of
19248 // WithParamInterface, and can just inherit from ::testing::TestWithParam.
19249 
19250 template <typename T>
19251 class TestWithParam : public Test, public WithParamInterface<T> {
19252 };
19253 
19254 #endif  // GTEST_HAS_PARAM_TEST
19255 
19256 // Macros for indicating success/failure in test code.
19257 
19258 // ADD_FAILURE unconditionally adds a failure to the current test.
19259 // SUCCEED generates a success - it doesn't automatically make the
19260 // current test successful, as a test is only successful when it has
19261 // no failure.
19262 //
19263 // EXPECT_* verifies that a certain condition is satisfied.  If not,
19264 // it behaves like ADD_FAILURE.  In particular:
19265 //
19266 //   EXPECT_TRUE  verifies that a Boolean condition is true.
19267 //   EXPECT_FALSE verifies that a Boolean condition is false.
19268 //
19269 // FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
19270 // that they will also abort the current function on failure.  People
19271 // usually want the fail-fast behavior of FAIL and ASSERT_*, but those
19272 // writing data-driven tests often find themselves using ADD_FAILURE
19273 // and EXPECT_* more.
19274 
19275 // Generates a nonfatal failure with a generic message.
19276 #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
19277 
19278 // Generates a nonfatal failure at the given source file location with
19279 // a generic message.
19280 #define ADD_FAILURE_AT(file, line) \
19281   GTEST_MESSAGE_AT_(file, line, "Failed", \
19282                     ::testing::TestPartResult::kNonFatalFailure)
19283 
19284 // Generates a fatal failure with a generic message.
19285 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
19286 
19287 // Define this macro to 1 to omit the definition of FAIL(), which is a
19288 // generic name and clashes with some other libraries.
19289 #if !GTEST_DONT_DEFINE_FAIL
19290 # define FAIL() GTEST_FAIL()
19291 #endif
19292 
19293 // Generates a success with a generic message.
19294 #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
19295 
19296 // Define this macro to 1 to omit the definition of SUCCEED(), which
19297 // is a generic name and clashes with some other libraries.
19298 #if !GTEST_DONT_DEFINE_SUCCEED
19299 # define SUCCEED() GTEST_SUCCEED()
19300 #endif
19301 
19302 // Macros for testing exceptions.
19303 //
19304 //    * {ASSERT|EXPECT}_THROW(statement, expected_exception):
19305 //         Tests that the statement throws the expected exception.
19306 //    * {ASSERT|EXPECT}_NO_THROW(statement):
19307 //         Tests that the statement doesn't throw any exception.
19308 //    * {ASSERT|EXPECT}_ANY_THROW(statement):
19309 //         Tests that the statement throws an exception.
19310 
19311 #define EXPECT_THROW(statement, expected_exception) \
19312   GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
19313 #define EXPECT_NO_THROW(statement) \
19314   GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19315 #define EXPECT_ANY_THROW(statement) \
19316   GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
19317 #define ASSERT_THROW(statement, expected_exception) \
19318   GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
19319 #define ASSERT_NO_THROW(statement) \
19320   GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
19321 #define ASSERT_ANY_THROW(statement) \
19322   GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
19323 
19324 // Boolean assertions. Condition can be either a Boolean expression or an
19325 // AssertionResult. For more information on how to use AssertionResult with
19326 // these macros see comments on that class.
19327 #define EXPECT_TRUE(condition) \
19328   GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19329                       GTEST_NONFATAL_FAILURE_)
19330 #define EXPECT_FALSE(condition) \
19331   GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19332                       GTEST_NONFATAL_FAILURE_)
19333 #define ASSERT_TRUE(condition) \
19334   GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
19335                       GTEST_FATAL_FAILURE_)
19336 #define ASSERT_FALSE(condition) \
19337   GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
19338                       GTEST_FATAL_FAILURE_)
19339 
19340 // Includes the auto-generated header that implements a family of
19341 // generic predicate assertion macros.
19342 // Copyright 2006, Google Inc.
19343 // All rights reserved.
19344 //
19345 // Redistribution and use in source and binary forms, with or without
19346 // modification, are permitted provided that the following conditions are
19347 // met:
19348 //
19349 //     * Redistributions of source code must retain the above copyright
19350 // notice, this list of conditions and the following disclaimer.
19351 //     * Redistributions in binary form must reproduce the above
19352 // copyright notice, this list of conditions and the following disclaimer
19353 // in the documentation and/or other materials provided with the
19354 // distribution.
19355 //     * Neither the name of Google Inc. nor the names of its
19356 // contributors may be used to endorse or promote products derived from
19357 // this software without specific prior written permission.
19358 //
19359 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19360 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19361 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19362 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19363 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19364 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19365 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19366 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19367 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19368 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
19369 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19370 
19371 // This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
19372 // 'gen_gtest_pred_impl.py 5'.  DO NOT EDIT BY HAND!
19373 //
19374 // Implements a family of generic predicate assertion macros.
19375 
19376 #ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19377 #define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19378 
19379 // Makes sure this header is not included before gtest.h.
19380 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_
19381 # error Do not include gtest_pred_impl.h directly.  Include gtest.h instead.
19382 #endif  // GTEST_INCLUDE_GTEST_GTEST_H_
19383 
19384 // This header implements a family of generic predicate assertion
19385 // macros:
19386 //
19387 //   ASSERT_PRED_FORMAT1(pred_format, v1)
19388 //   ASSERT_PRED_FORMAT2(pred_format, v1, v2)
19389 //   ...
19390 //
19391 // where pred_format is a function or functor that takes n (in the
19392 // case of ASSERT_PRED_FORMATn) values and their source expression
19393 // text, and returns a testing::AssertionResult.  See the definition
19394 // of ASSERT_EQ in gtest.h for an example.
19395 //
19396 // If you don't care about formatting, you can use the more
19397 // restrictive version:
19398 //
19399 //   ASSERT_PRED1(pred, v1)
19400 //   ASSERT_PRED2(pred, v1, v2)
19401 //   ...
19402 //
19403 // where pred is an n-ary function or functor that returns bool,
19404 // and the values v1, v2, ..., must support the << operator for
19405 // streaming to std::ostream.
19406 //
19407 // We also define the EXPECT_* variations.
19408 //
19409 // For now we only support predicates whose arity is at most 5.
19410 // Please email googletestframework@googlegroups.com if you need
19411 // support for higher arities.
19412 
19413 // GTEST_ASSERT_ is the basic statement to which all of the assertions
19414 // in this file reduce.  Don't use this in your code.
19415 
19416 #define GTEST_ASSERT_(expression, on_failure) \
19417   GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
19418   if (const ::testing::AssertionResult gtest_ar = (expression)) \
19419     ; \
19420   else \
19421     on_failure(gtest_ar.failure_message())
19422 
19423 
19424 // Helper function for implementing {EXPECT|ASSERT}_PRED1.  Don't use
19425 // this in your code.
19426 template <typename Pred,
19427           typename T1>
19428 AssertionResult AssertPred1Helper(const char* pred_text,
19429                                   const char* e1,
19430                                   Pred pred,
19431                                   const T1& v1) {
19432   if (pred(v1)) return AssertionSuccess();
19433 
19434   return AssertionFailure() << pred_text << "("
19435                             << e1 << ") evaluates to false, where"
19436                             << "\n" << e1 << " evaluates to " << v1;
19437 }
19438 
19439 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
19440 // Don't use this in your code.
19441 #define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
19442   GTEST_ASSERT_(pred_format(#v1, v1), \
19443                 on_failure)
19444 
19445 // Internal macro for implementing {EXPECT|ASSERT}_PRED1.  Don't use
19446 // this in your code.
19447 #define GTEST_PRED1_(pred, v1, on_failure)\
19448   GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
19449                                              #v1, \
19450                                              pred, \
19451                                              v1), on_failure)
19452 
19453 // Unary predicate assertion macros.
19454 #define EXPECT_PRED_FORMAT1(pred_format, v1) \
19455   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
19456 #define EXPECT_PRED1(pred, v1) \
19457   GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
19458 #define ASSERT_PRED_FORMAT1(pred_format, v1) \
19459   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
19460 #define ASSERT_PRED1(pred, v1) \
19461   GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
19462 
19463 
19464 
19465 // Helper function for implementing {EXPECT|ASSERT}_PRED2.  Don't use
19466 // this in your code.
19467 template <typename Pred,
19468           typename T1,
19469           typename T2>
19470 AssertionResult AssertPred2Helper(const char* pred_text,
19471                                   const char* e1,
19472                                   const char* e2,
19473                                   Pred pred,
19474                                   const T1& v1,
19475                                   const T2& v2) {
19476   if (pred(v1, v2)) return AssertionSuccess();
19477 
19478   return AssertionFailure() << pred_text << "("
19479                             << e1 << ", "
19480                             << e2 << ") evaluates to false, where"
19481                             << "\n" << e1 << " evaluates to " << v1
19482                             << "\n" << e2 << " evaluates to " << v2;
19483 }
19484 
19485 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
19486 // Don't use this in your code.
19487 #define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
19488   GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
19489                 on_failure)
19490 
19491 // Internal macro for implementing {EXPECT|ASSERT}_PRED2.  Don't use
19492 // this in your code.
19493 #define GTEST_PRED2_(pred, v1, v2, on_failure)\
19494   GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
19495                                              #v1, \
19496                                              #v2, \
19497                                              pred, \
19498                                              v1, \
19499                                              v2), on_failure)
19500 
19501 // Binary predicate assertion macros.
19502 #define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
19503   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
19504 #define EXPECT_PRED2(pred, v1, v2) \
19505   GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
19506 #define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
19507   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
19508 #define ASSERT_PRED2(pred, v1, v2) \
19509   GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
19510 
19511 
19512 
19513 // Helper function for implementing {EXPECT|ASSERT}_PRED3.  Don't use
19514 // this in your code.
19515 template <typename Pred,
19516           typename T1,
19517           typename T2,
19518           typename T3>
19519 AssertionResult AssertPred3Helper(const char* pred_text,
19520                                   const char* e1,
19521                                   const char* e2,
19522                                   const char* e3,
19523                                   Pred pred,
19524                                   const T1& v1,
19525                                   const T2& v2,
19526                                   const T3& v3) {
19527   if (pred(v1, v2, v3)) return AssertionSuccess();
19528 
19529   return AssertionFailure() << pred_text << "("
19530                             << e1 << ", "
19531                             << e2 << ", "
19532                             << e3 << ") evaluates to false, where"
19533                             << "\n" << e1 << " evaluates to " << v1
19534                             << "\n" << e2 << " evaluates to " << v2
19535                             << "\n" << e3 << " evaluates to " << v3;
19536 }
19537 
19538 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
19539 // Don't use this in your code.
19540 #define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
19541   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
19542                 on_failure)
19543 
19544 // Internal macro for implementing {EXPECT|ASSERT}_PRED3.  Don't use
19545 // this in your code.
19546 #define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
19547   GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
19548                                              #v1, \
19549                                              #v2, \
19550                                              #v3, \
19551                                              pred, \
19552                                              v1, \
19553                                              v2, \
19554                                              v3), on_failure)
19555 
19556 // Ternary predicate assertion macros.
19557 #define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19558   GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19559 #define EXPECT_PRED3(pred, v1, v2, v3) \
19560   GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
19561 #define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
19562   GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
19563 #define ASSERT_PRED3(pred, v1, v2, v3) \
19564   GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
19565 
19566 
19567 
19568 // Helper function for implementing {EXPECT|ASSERT}_PRED4.  Don't use
19569 // this in your code.
19570 template <typename Pred,
19571           typename T1,
19572           typename T2,
19573           typename T3,
19574           typename T4>
19575 AssertionResult AssertPred4Helper(const char* pred_text,
19576                                   const char* e1,
19577                                   const char* e2,
19578                                   const char* e3,
19579                                   const char* e4,
19580                                   Pred pred,
19581                                   const T1& v1,
19582                                   const T2& v2,
19583                                   const T3& v3,
19584                                   const T4& v4) {
19585   if (pred(v1, v2, v3, v4)) return AssertionSuccess();
19586 
19587   return AssertionFailure() << pred_text << "("
19588                             << e1 << ", "
19589                             << e2 << ", "
19590                             << e3 << ", "
19591                             << e4 << ") evaluates to false, where"
19592                             << "\n" << e1 << " evaluates to " << v1
19593                             << "\n" << e2 << " evaluates to " << v2
19594                             << "\n" << e3 << " evaluates to " << v3
19595                             << "\n" << e4 << " evaluates to " << v4;
19596 }
19597 
19598 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
19599 // Don't use this in your code.
19600 #define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
19601   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
19602                 on_failure)
19603 
19604 // Internal macro for implementing {EXPECT|ASSERT}_PRED4.  Don't use
19605 // this in your code.
19606 #define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
19607   GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
19608                                              #v1, \
19609                                              #v2, \
19610                                              #v3, \
19611                                              #v4, \
19612                                              pred, \
19613                                              v1, \
19614                                              v2, \
19615                                              v3, \
19616                                              v4), on_failure)
19617 
19618 // 4-ary predicate assertion macros.
19619 #define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19620   GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19621 #define EXPECT_PRED4(pred, v1, v2, v3, v4) \
19622   GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
19623 #define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
19624   GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19625 #define ASSERT_PRED4(pred, v1, v2, v3, v4) \
19626   GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
19627 
19628 
19629 
19630 // Helper function for implementing {EXPECT|ASSERT}_PRED5.  Don't use
19631 // this in your code.
19632 template <typename Pred,
19633           typename T1,
19634           typename T2,
19635           typename T3,
19636           typename T4,
19637           typename T5>
19638 AssertionResult AssertPred5Helper(const char* pred_text,
19639                                   const char* e1,
19640                                   const char* e2,
19641                                   const char* e3,
19642                                   const char* e4,
19643                                   const char* e5,
19644                                   Pred pred,
19645                                   const T1& v1,
19646                                   const T2& v2,
19647                                   const T3& v3,
19648                                   const T4& v4,
19649                                   const T5& v5) {
19650   if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
19651 
19652   return AssertionFailure() << pred_text << "("
19653                             << e1 << ", "
19654                             << e2 << ", "
19655                             << e3 << ", "
19656                             << e4 << ", "
19657                             << e5 << ") evaluates to false, where"
19658                             << "\n" << e1 << " evaluates to " << v1
19659                             << "\n" << e2 << " evaluates to " << v2
19660                             << "\n" << e3 << " evaluates to " << v3
19661                             << "\n" << e4 << " evaluates to " << v4
19662                             << "\n" << e5 << " evaluates to " << v5;
19663 }
19664 
19665 // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
19666 // Don't use this in your code.
19667 #define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
19668   GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
19669                 on_failure)
19670 
19671 // Internal macro for implementing {EXPECT|ASSERT}_PRED5.  Don't use
19672 // this in your code.
19673 #define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
19674   GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
19675                                              #v1, \
19676                                              #v2, \
19677                                              #v3, \
19678                                              #v4, \
19679                                              #v5, \
19680                                              pred, \
19681                                              v1, \
19682                                              v2, \
19683                                              v3, \
19684                                              v4, \
19685                                              v5), on_failure)
19686 
19687 // 5-ary predicate assertion macros.
19688 #define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19689   GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19690 #define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
19691   GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
19692 #define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
19693   GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19694 #define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
19695   GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
19696 
19697 
19698 
19699 #endif  // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
19700 
19701 // Macros for testing equalities and inequalities.
19702 //
19703 //    * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
19704 //    * {ASSERT|EXPECT}_NE(v1, v2):           Tests that v1 != v2
19705 //    * {ASSERT|EXPECT}_LT(v1, v2):           Tests that v1 < v2
19706 //    * {ASSERT|EXPECT}_LE(v1, v2):           Tests that v1 <= v2
19707 //    * {ASSERT|EXPECT}_GT(v1, v2):           Tests that v1 > v2
19708 //    * {ASSERT|EXPECT}_GE(v1, v2):           Tests that v1 >= v2
19709 //
19710 // When they are not, Google Test prints both the tested expressions and
19711 // their actual values.  The values must be compatible built-in types,
19712 // or you will get a compiler error.  By "compatible" we mean that the
19713 // values can be compared by the respective operator.
19714 //
19715 // Note:
19716 //
19717 //   1. It is possible to make a user-defined type work with
19718 //   {ASSERT|EXPECT}_??(), but that requires overloading the
19719 //   comparison operators and is thus discouraged by the Google C++
19720 //   Usage Guide.  Therefore, you are advised to use the
19721 //   {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
19722 //   equal.
19723 //
19724 //   2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
19725 //   pointers (in particular, C strings).  Therefore, if you use it
19726 //   with two C strings, you are testing how their locations in memory
19727 //   are related, not how their content is related.  To compare two C
19728 //   strings by content, use {ASSERT|EXPECT}_STR*().
19729 //
19730 //   3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
19731 //   {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
19732 //   what the actual value is when it fails, and similarly for the
19733 //   other comparisons.
19734 //
19735 //   4. Do not depend on the order in which {ASSERT|EXPECT}_??()
19736 //   evaluate their arguments, which is undefined.
19737 //
19738 //   5. These macros evaluate their arguments exactly once.
19739 //
19740 // Examples:
19741 //
19742 //   EXPECT_NE(5, Foo());
19743 //   EXPECT_EQ(NULL, a_pointer);
19744 //   ASSERT_LT(i, array_size);
19745 //   ASSERT_GT(records.size(), 0) << "There is no record left.";
19746 
19747 #define EXPECT_EQ(expected, actual) \
19748   EXPECT_PRED_FORMAT2(::testing::internal:: \
19749                       EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19750                       expected, actual)
19751 #define EXPECT_NE(expected, actual) \
19752   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
19753 #define EXPECT_LE(val1, val2) \
19754   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19755 #define EXPECT_LT(val1, val2) \
19756   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19757 #define EXPECT_GE(val1, val2) \
19758   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19759 #define EXPECT_GT(val1, val2) \
19760   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19761 
19762 #define GTEST_ASSERT_EQ(expected, actual) \
19763   ASSERT_PRED_FORMAT2(::testing::internal:: \
19764                       EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
19765                       expected, actual)
19766 #define GTEST_ASSERT_NE(val1, val2) \
19767   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
19768 #define GTEST_ASSERT_LE(val1, val2) \
19769   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
19770 #define GTEST_ASSERT_LT(val1, val2) \
19771   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
19772 #define GTEST_ASSERT_GE(val1, val2) \
19773   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
19774 #define GTEST_ASSERT_GT(val1, val2) \
19775   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
19776 
19777 // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
19778 // ASSERT_XY(), which clashes with some users' own code.
19779 
19780 #if !GTEST_DONT_DEFINE_ASSERT_EQ
19781 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
19782 #endif
19783 
19784 #if !GTEST_DONT_DEFINE_ASSERT_NE
19785 # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
19786 #endif
19787 
19788 #if !GTEST_DONT_DEFINE_ASSERT_LE
19789 # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
19790 #endif
19791 
19792 #if !GTEST_DONT_DEFINE_ASSERT_LT
19793 # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
19794 #endif
19795 
19796 #if !GTEST_DONT_DEFINE_ASSERT_GE
19797 # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
19798 #endif
19799 
19800 #if !GTEST_DONT_DEFINE_ASSERT_GT
19801 # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
19802 #endif
19803 
19804 // C-string Comparisons.  All tests treat NULL and any non-NULL string
19805 // as different.  Two NULLs are equal.
19806 //
19807 //    * {ASSERT|EXPECT}_STREQ(s1, s2):     Tests that s1 == s2
19808 //    * {ASSERT|EXPECT}_STRNE(s1, s2):     Tests that s1 != s2
19809 //    * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
19810 //    * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
19811 //
19812 // For wide or narrow string objects, you can use the
19813 // {ASSERT|EXPECT}_??() macros.
19814 //
19815 // Don't depend on the order in which the arguments are evaluated,
19816 // which is undefined.
19817 //
19818 // These macros evaluate their arguments exactly once.
19819 
19820 #define EXPECT_STREQ(expected, actual) \
19821   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19822 #define EXPECT_STRNE(s1, s2) \
19823   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19824 #define EXPECT_STRCASEEQ(expected, actual) \
19825   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19826 #define EXPECT_STRCASENE(s1, s2)\
19827   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19828 
19829 #define ASSERT_STREQ(expected, actual) \
19830   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
19831 #define ASSERT_STRNE(s1, s2) \
19832   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
19833 #define ASSERT_STRCASEEQ(expected, actual) \
19834   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
19835 #define ASSERT_STRCASENE(s1, s2)\
19836   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
19837 
19838 // Macros for comparing floating-point numbers.
19839 //
19840 //    * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
19841 //         Tests that two float values are almost equal.
19842 //    * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
19843 //         Tests that two double values are almost equal.
19844 //    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
19845 //         Tests that v1 and v2 are within the given distance to each other.
19846 //
19847 // Google Test uses ULP-based comparison to automatically pick a default
19848 // error bound that is appropriate for the operands.  See the
19849 // FloatingPoint template class in gtest-internal.h if you are
19850 // interested in the implementation details.
19851 
19852 #define EXPECT_FLOAT_EQ(expected, actual)\
19853   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19854                       expected, actual)
19855 
19856 #define EXPECT_DOUBLE_EQ(expected, actual)\
19857   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19858                       expected, actual)
19859 
19860 #define ASSERT_FLOAT_EQ(expected, actual)\
19861   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
19862                       expected, actual)
19863 
19864 #define ASSERT_DOUBLE_EQ(expected, actual)\
19865   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
19866                       expected, actual)
19867 
19868 #define EXPECT_NEAR(val1, val2, abs_error)\
19869   EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19870                       val1, val2, abs_error)
19871 
19872 #define ASSERT_NEAR(val1, val2, abs_error)\
19873   ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
19874                       val1, val2, abs_error)
19875 
19876 // These predicate format functions work on floating-point values, and
19877 // can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
19878 //
19879 //   EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
19880 
19881 // Asserts that val1 is less than, or almost equal to, val2.  Fails
19882 // otherwise.  In particular, it fails if either val1 or val2 is NaN.
19883 GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
19884                                    float val1, float val2);
19885 GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
19886                                     double val1, double val2);
19887 
19888 
19889 #if GTEST_OS_WINDOWS
19890 
19891 // Macros that test for HRESULT failure and success, these are only useful
19892 // on Windows, and rely on Windows SDK macros and APIs to compile.
19893 //
19894 //    * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
19895 //
19896 // When expr unexpectedly fails or succeeds, Google Test prints the
19897 // expected result and the actual result with both a human-readable
19898 // string representation of the error, if available, as well as the
19899 // hex result code.
19900 # define EXPECT_HRESULT_SUCCEEDED(expr) \
19901     EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19902 
19903 # define ASSERT_HRESULT_SUCCEEDED(expr) \
19904     ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
19905 
19906 # define EXPECT_HRESULT_FAILED(expr) \
19907     EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19908 
19909 # define ASSERT_HRESULT_FAILED(expr) \
19910     ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
19911 
19912 #endif  // GTEST_OS_WINDOWS
19913 
19914 // Macros that execute statement and check that it doesn't generate new fatal
19915 // failures in the current thread.
19916 //
19917 //   * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
19918 //
19919 // Examples:
19920 //
19921 //   EXPECT_NO_FATAL_FAILURE(Process());
19922 //   ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
19923 //
19924 #define ASSERT_NO_FATAL_FAILURE(statement) \
19925     GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
19926 #define EXPECT_NO_FATAL_FAILURE(statement) \
19927     GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
19928 
19929 // Causes a trace (including the source file path, the current line
19930 // number, and the given message) to be included in every test failure
19931 // message generated by code in the current scope.  The effect is
19932 // undone when the control leaves the current scope.
19933 //
19934 // The message argument can be anything streamable to std::ostream.
19935 //
19936 // In the implementation, we include the current line number as part
19937 // of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
19938 // to appear in the same block - as long as they are on different
19939 // lines.
19940 #define SCOPED_TRACE(message) \
19941   ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
19942     __FILE__, __LINE__, ::testing::Message() << (message))
19943 
19944 // Compile-time assertion for type equality.
19945 // StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
19946 // the same type.  The value it returns is not interesting.
19947 //
19948 // Instead of making StaticAssertTypeEq a class template, we make it a
19949 // function template that invokes a helper class template.  This
19950 // prevents a user from misusing StaticAssertTypeEq<T1, T2> by
19951 // defining objects of that type.
19952 //
19953 // CAVEAT:
19954 //
19955 // When used inside a method of a class template,
19956 // StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
19957 // instantiated.  For example, given:
19958 //
19959 //   template <typename T> class Foo {
19960 //    public:
19961 //     void Bar() { testing::StaticAssertTypeEq<int, T>(); }
19962 //   };
19963 //
19964 // the code:
19965 //
19966 //   void Test1() { Foo<bool> foo; }
19967 //
19968 // will NOT generate a compiler error, as Foo<bool>::Bar() is never
19969 // actually instantiated.  Instead, you need:
19970 //
19971 //   void Test2() { Foo<bool> foo; foo.Bar(); }
19972 //
19973 // to cause a compiler error.
19974 template <typename T1, typename T2>
19975 bool StaticAssertTypeEq() {
19976   (void)internal::StaticAssertTypeEqHelper<T1, T2>();
19977   return true;
19978 }
19979 
19980 // Defines a test.
19981 //
19982 // The first parameter is the name of the test case, and the second
19983 // parameter is the name of the test within the test case.
19984 //
19985 // The convention is to end the test case name with "Test".  For
19986 // example, a test case for the Foo class can be named FooTest.
19987 //
19988 // The user should put his test code between braces after using this
19989 // macro.  Example:
19990 //
19991 //   TEST(FooTest, InitializesCorrectly) {
19992 //     Foo foo;
19993 //     EXPECT_TRUE(foo.StatusIsOK());
19994 //   }
19995 
19996 // Note that we call GetTestTypeId() instead of GetTypeId<
19997 // ::testing::Test>() here to get the type ID of testing::Test.  This
19998 // is to work around a suspected linker bug when using Google Test as
19999 // a framework on Mac OS X.  The bug causes GetTypeId<
20000 // ::testing::Test>() to return different values depending on whether
20001 // the call is from the Google Test framework itself or from user test
20002 // code.  GetTestTypeId() is guaranteed to always return the same
20003 // value, as it always calls GetTypeId<>() from the Google Test
20004 // framework.
20005 #define GTEST_TEST(test_case_name, test_name)\
20006   GTEST_TEST_(test_case_name, test_name, \
20007               ::testing::Test, ::testing::internal::GetTestTypeId())
20008 
20009 // Define this macro to 1 to omit the definition of TEST(), which
20010 // is a generic name and clashes with some other libraries.
20011 #if !GTEST_DONT_DEFINE_TEST
20012 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
20013 #endif
20014 
20015 // Defines a test that uses a test fixture.
20016 //
20017 // The first parameter is the name of the test fixture class, which
20018 // also doubles as the test case name.  The second parameter is the
20019 // name of the test within the test case.
20020 //
20021 // A test fixture class must be declared earlier.  The user should put
20022 // his test code between braces after using this macro.  Example:
20023 //
20024 //   class FooTest : public testing::Test {
20025 //    protected:
20026 //     virtual void SetUp() { b_.AddElement(3); }
20027 //
20028 //     Foo a_;
20029 //     Foo b_;
20030 //   };
20031 //
20032 //   TEST_F(FooTest, InitializesCorrectly) {
20033 //     EXPECT_TRUE(a_.StatusIsOK());
20034 //   }
20035 //
20036 //   TEST_F(FooTest, ReturnsElementCountCorrectly) {
20037 //     EXPECT_EQ(0, a_.size());
20038 //     EXPECT_EQ(1, b_.size());
20039 //   }
20040 
20041 #define TEST_F(test_fixture, test_name)\
20042   GTEST_TEST_(test_fixture, test_name, test_fixture, \
20043               ::testing::internal::GetTypeId<test_fixture>())
20044 
20045 }  // namespace testing
20046 
20047 // Use this function in main() to run all tests.  It returns 0 if all
20048 // tests are successful, or 1 otherwise.
20049 //
20050 // RUN_ALL_TESTS() should be invoked after the command line has been
20051 // parsed by InitGoogleTest().
20052 //
20053 // This function was formerly a macro; thus, it is in the global
20054 // namespace and has an all-caps name.
20055 int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
20056 
20057 inline int RUN_ALL_TESTS() {
20058   return ::testing::UnitTest::GetInstance()->Run();
20059 }
20060 
20061 #endif  // GTEST_INCLUDE_GTEST_GTEST_H_


upstream_src
Author(s):
autogenerated on Mon Oct 6 2014 10:27:41